Output of failing "is()" inside of subtests is not indented
Created by: ichesnokov
Here's a sample testing script:
#!/usr/bin/env lua
require 'Test.More'
is(1, 2, '1 == 2')
subtest('addition', function()
is(2, 3, '2 == 3')
subtest('subtraction', function()
is(3, 4, '3 == 4')
end)
end)
done_testing();
And here's the output of lua t.lua
:
not ok 1 - 1 == 2
# Failed test (t.lua at line 4)
# got: 1
# expected: 2
# Subtest: addition
not ok 1 - 2 == 3
# Failed test (t.lua at line 6)
# got: 2
# expected: 3
# Subtest: subtraction
not ok 1 - 3 == 4
# Failed test (t.lua at line 8)
# got: 3
# expected: 4
1..1
not ok 2 - subtraction
# Failed test (t.lua at line 7)
1..2
not ok 2 - addition
# Failed test (t.lua at line 5)
1..2
As you can see, lines with # expected:
always start at the beginning of line, and not aligned to lines with # got:
.
Here's the output of the same test rewritten in Perl:
not ok 1 - 1 == 2
# Failed test '1 == 2'
# at t.t line 6.
# got: '1'
# expected: '2'
# Subtest: addition
not ok 1 - 2 == 3
# Failed test '2 == 3'
# at t.t line 8.
# got: '2'
# expected: '3'
# Subtest: subtraction
not ok 1 - 3 == 4
# Failed test '3 == 4'
# at t.t line 10.
# got: '3'
# expected: '4'
1..1
# Looks like you failed 1 test of 1.
not ok 2 - subtraction
# Failed test 'subtraction'
# at t.t line 11.
1..2
# Looks like you failed 2 tests of 2.
not ok 2 - addition
# Failed test 'addition'
# at t.t line 12.
1..2
# Looks like you failed 2 tests of 2.
As you can see, # expected:
lines are aligned with # got:
lines here.