diff options
author | zeertzjq <zeertzjq@outlook.com> | 2024-04-11 07:51:25 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-04-11 07:51:25 +0800 |
commit | 509c053161c0495ac41cf12343089059afb4e813 (patch) | |
tree | c565fa5ce892600cf7cd6cf51729fe44c5f96933 /test/functional/preload.lua | |
parent | d627497156162f03a36e889d316b68df66928193 (diff) | |
download | rneovim-509c053161c0495ac41cf12343089059afb4e813.tar.gz rneovim-509c053161c0495ac41cf12343089059afb4e813.tar.bz2 rneovim-509c053161c0495ac41cf12343089059afb4e813.zip |
test: fix off-by-one test IDs in logs (#28269)
Run the global before_each() before all other before_each(), so that
clear() uses the test ID of the current test, not the previous one.
Don't skip generating test IDs for skipped tests, as that'll make a
skipped test have the same test ID as the previous one.
Diffstat (limited to 'test/functional/preload.lua')
-rw-r--r-- | test/functional/preload.lua | 24 |
1 files changed, 0 insertions, 24 deletions
diff --git a/test/functional/preload.lua b/test/functional/preload.lua index 8c3aff146d..9f17ecd66c 100644 --- a/test/functional/preload.lua +++ b/test/functional/preload.lua @@ -3,7 +3,6 @@ -- for more information about this. local t = require('test.functional.testutil')(nil) require('test.functional.ui.screen') -local busted = require('busted') local is_os = t.is_os if is_os('win') then @@ -14,26 +13,3 @@ if is_os('win') then ]] ffi.C._set_fmode(0x8000) end - -local testid = (function() - local id = 0 - return function() - id = id + 1 - return id - end -end)() - --- Global before_each. https://github.com/Olivine-Labs/busted/issues/613 -local function before_each(_element, _parent) - local id = ('T%d'):format(testid()) - _G._nvim_test_id = id - return nil, true -end -busted.subscribe({ 'test', 'start' }, before_each, { - -- Ensure our --helper is handled before --output (see busted/runner.lua). - priority = 1, - -- Don't generate a test-id for skipped tests. /shrug - predicate = function(element, _, status) - return not (element.descriptor == 'pending' or status == 'pending') - end, -}) |