Download:
child 34:e0912d348cb1
parent 32:b958f661c857
33:40f83ed9b472
Anton Shestakov <av6@dwimlabs.net>, Fri, 16 Sep 2016 15:50:45 +0800
spec: exit codes are not very useful, check them last Error and output channels usually have readable messages explaining what went wrong, they need to be checked first.

1 файлов изменено, 3 вставок(+), 3 удалений(-) [+]
spec/hglib_spec.lua file | annotate | diff | comparison | revisions
--- a/spec/hglib_spec.lua Fri Sep 16 15:50:07 2016 +0800
+++ b/spec/hglib_spec.lua Fri Sep 16 15:50:45 2016 +0800
@@ -54,30 +54,30 @@
local client = hglib.Client.open()
local code, o, e, d = client:runcommand({'version', '--verbose'})
client:close()
- assert.are_equal(0, code)
assert.is_not_nil(o:find('Mercurial Distributed SCM'))
assert.is_not_nil(o:find('Enabled extensions:'))
assert.are_equal('', e)
assert.are_equal('', d)
+ assert.are_equal(0, code)
end)
it('can use runcommand to run nonexistent command', function()
local client = hglib.Client.open()
local code, o, e, d = client:runcommand({'extirpate'})
client:close()
- assert.are_equal(255, code)
assert.is_not_nil(o:find('use "hg help" for the full list of commands'))
assert.is_not_nil(e:find('unknown command'))
assert.are_equal('', d)
+ assert.are_equal(255, code)
end)
it('can use runcommand to inspect this repo', function()
local client = hglib.Client.open('.')
local code, o, e, d = client:runcommand({'log', '-r0'})
client:close()
- assert.are_equal(0, code)
assert.is_not_nil(o:find('hglib: absolute basics'))
assert.are_equal('', e)
assert.are_equal('', d)
+ assert.are_equal(0, code)
end)
end)