> busted --list test_spec.lua
top
test_spec.lua:6: describe 1 test 1
test_spec.lua:10: describe 1 test 2
As you can see, the path and line number information is omitted for top-level tests even though they are allowed and running the tests works just fine.
I've looked at the existing issues as well as the documentation of cli options but I couldn't find anything. I've tracked down the issue to this function which only prepends the extra information if trace.what == 'Lua'. For the top-level test, trace.what is 'main' so it just prints the name of the test.
Changing the line to if trace and (trace.what == 'Lua' or trace.what == 'main') then fixes the issue but I'm not 100% if that change will break for other cases where what is 'main'. Or perhaps this is the intended behaviour? The lua docs on introspective facilities, where I assume the information is coming from, say the following.
what --- What this function is. Options are "Lua" if foo is a regular Lua function, "C" if it is a C function, or "main" if it is the main part of a Lua chunk.
I don't mind submitting a PR 🙂 In my case, this is making it difficult to consume and use the output programmatically.
I've encountered some strange behaviour when using
busted --list
. Consider the following test file:Running
busted --list
on it outputs:As you can see, the path and line number information is omitted for top-level tests even though they are allowed and running the tests works just fine.
I've looked at the existing issues as well as the documentation of cli options but I couldn't find anything. I've tracked down the issue to this function which only prepends the extra information if
trace.what == 'Lua'
. For the top-level test,trace.what
is'main'
so it just prints the name of the test.Changing the line to
if trace and (trace.what == 'Lua' or trace.what == 'main') then
fixes the issue but I'm not 100% if that change will break for other cases wherewhat
is'main'
. Or perhaps this is the intended behaviour? The lua docs on introspective facilities, where I assume the information is coming from, say the following.I don't mind submitting a PR 🙂 In my case, this is making it difficult to consume and use the output programmatically.