Skip to content

Commit

Permalink
Add test for top-level test
Browse files Browse the repository at this point in the history
  • Loading branch information
MisanthropicBit committed Dec 8, 2024
1 parent 4dccfbb commit 25ff938
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
3 changes: 3 additions & 0 deletions spec/cl_list.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
-- supporting testfile; belongs to 'cl_spec.lua'

it('top-level test', function()
end)

describe('Tests list', function()
it('test 1', function()
end)
Expand Down
14 changes: 8 additions & 6 deletions spec/cl_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -183,17 +183,19 @@ describe('Tests the busted command-line options', function()

it('tests running with -l specified', function()
local _, _, result = executeBusted('-l --pattern=cl_list.lua$')
local expected = 'spec/cl_list.lua:4: Tests list test 1\n' ..
'spec/cl_list.lua:7: Tests list test 2\n' ..
'spec/cl_list.lua:10: Tests list test 3\n'
local expected = 'spec/cl_list.lua:3: top-level test\n' ..
'spec/cl_list.lua:6: Tests list test 1\n' ..
'spec/cl_list.lua:10: Tests list test 2\n' ..
'spec/cl_list.lua:13: Tests list test 3\n'
assert.is_equal(normpath(expected), result)
end)

it('tests running with --list specified', function()
local _, _, result = executeBusted('--list --pattern=cl_list.lua$')
local expected = 'spec/cl_list.lua:4: Tests list test 1\n' ..
'spec/cl_list.lua:7: Tests list test 2\n' ..
'spec/cl_list.lua:10: Tests list test 3\n'
local expected = 'spec/cl_list.lua:3: top-level test\n' ..
'spec/cl_list.lua:6: Tests list test 1\n' ..
'spec/cl_list.lua:10: Tests list test 2\n' ..
'spec/cl_list.lua:13: Tests list test 3\n'
assert.is_equal(normpath(expected), result)
end)

Expand Down

0 comments on commit 25ff938

Please sign in to comment.