Skip to content

Commit

Permalink
Add parametric failure cases
Browse files Browse the repository at this point in the history
  • Loading branch information
MisanthropicBit committed Oct 30, 2024
1 parent 7274c99 commit ccd3ff3
Show file tree
Hide file tree
Showing 9 changed files with 1,282 additions and 353 deletions.
234 changes: 118 additions & 116 deletions test_files/expected_tree_parametric_file.lua
Original file line number Diff line number Diff line change
@@ -1,176 +1,178 @@
local path = "./test_files/parametric_tests_spec.lua"
return function(path)
local tail_path = vim.fn.fnamemodify(path, ":t")

return {
{
id = path,
name = "parametric_tests_spec.lua",
path = path,
range = { 0, 0, 29, 0 },
type = "file",
},
{
return {
{
id = path .. '::"namespace 1"',
name = '"namespace 1"',
id = path,
name = tail_path,
path = path,
range = { 0, 0, 12, 4 },
type = "namespace",
range = { 0, 0, 29, 0 },
type = "file",
},
{
{
id = path .. '::"namespace 1"::"nested namespace 1"',
name = '"nested namespace 1"',
id = path .. '::"namespace 1"',
name = '"namespace 1"',
path = path,
range = { 1, 4, 11, 8 },
range = { 0, 0, 12, 4 },
type = "namespace",
},
{
{
id = path .. '::"namespace 1"::"nested namespace 1"::("test %d"):format(i)',
name = '("test %d"):format(i)',
id = path .. '::"namespace 1"::"nested namespace 1"',
name = '"nested namespace 1"',
path = path,
range = { 3, 12, 5, 16 },
type = "test",
range = { 1, 4, 11, 8 },
type = "namespace",
},
-- Two new nodes have been added to the tree for the two parametric tests that were run
{
{
id = path .. "::namespace::1::nested::namespace::1::test::1",
in_tree = false,
name = "test 1",
lnum = 4,
id = path .. '::"namespace 1"::"nested namespace 1"::("test %d"):format(i)',
name = '("test %d"):format(i)',
path = path,
range = { 3, 12, 5, 16 },
type = "test",
},
},
{
-- Two new nodes have been added to the tree for the two parametric tests that were run
{
id = path .. "::namespace::1::nested::namespace::1::test::2",
in_tree = false,
name = "test 2",
lnum = 4,
path = path,
type = "test",
{
id = path .. "::namespace::1::nested::namespace::1::test::1",
in_tree = false,
name = "test 1",
lnum = 4,
path = path,
type = "test",
},
},
{
{
id = path .. "::namespace::1::nested::namespace::1::test::2",
in_tree = false,
name = "test 2",
lnum = 4,
path = path,
type = "test",
},
},
},
},
{
{
id = path .. '::"namespace 1"::"nested namespace 1"::"test " .. "3"',
name = '"test " .. "3"',
path = path,
range = { 8, 8, 10, 12 },
type = "test",
},
{
{
id = path .. "::namespace::1::nested::namespace::1::test::3",
in_tree = false,
name = "test 3",
lnum = 9,
id = path .. '::"namespace 1"::"nested namespace 1"::"test " .. "3"',
name = '"test " .. "3"',
path = path,
range = { 8, 8, 10, 12 },
type = "test",
},
{
{
id = path .. "::namespace::1::nested::namespace::1::test::3",
in_tree = false,
name = "test 3",
lnum = 9,
path = path,
type = "test",
},
},
},
},
},
},
{
{
id = path .. '::"namespace 2"',
name = '"namespace 2"',
path = path,
range = { 14, 0, 28, 4 },
type = "namespace",
},
{
{
id = path .. '::"namespace 2"::"nested namespace 2 - " .. tostring(i)',
name = '"nested namespace 2 - " .. tostring(i)',
id = path .. '::"namespace 2"',
name = '"namespace 2"',
path = path,
range = { 16, 8, 26, 12 },
range = { 14, 0, 28, 4 },
type = "namespace",
},
{
{
id = path
.. '::"namespace 2"::"nested namespace 2 - " .. tostring(i)::"some test"',
name = '"some test"',
id = path .. '::"namespace 2"::"nested namespace 2 - " .. tostring(i)',
name = '"nested namespace 2 - " .. tostring(i)',
path = path,
range = { 17, 12, 19, 16 },
type = "test",
range = { 16, 8, 26, 12 },
type = "namespace",
},
{
{
id = path .. "::namespace::2::nested::namespace::2::-::1::some::test",
in_tree = false,
name = "some test",
lnum = 18,
id = path
.. '::"namespace 2"::"nested namespace 2 - " .. tostring(i)::"some test"',
name = '"some test"',
path = path,
range = { 17, 12, 19, 16 },
type = "test",
},
},
{
{
id = path .. "::namespace::2::nested::namespace::2::-::2::some::test",
in_tree = false,
name = "some test",
lnum = 18,
path = path,
type = "test",
{
id = path .. "::namespace::2::nested::namespace::2::-::1::some::test",
in_tree = false,
name = "some test",
lnum = 18,
path = path,
type = "test",
},
},
},
},
{
{
id = path
.. '::"namespace 2"::"nested namespace 2 - " .. tostring(i)::("test %d"):format(j)',
name = '("test %d"):format(j)',
path = path,
range = { 22, 16, 24, 20 },
type = "test",
},
{
{
id = path .. "::namespace::2::nested::namespace::2::-::1::test::1",
in_tree = false,
name = "test 1",
lnum = 23,
path = path,
type = "test",
{
id = path .. "::namespace::2::nested::namespace::2::-::2::some::test",
in_tree = false,
name = "some test",
lnum = 18,
path = path,
type = "test",
},
},
},
{
{
id = path .. "::namespace::2::nested::namespace::2::-::1::test::2",
in_tree = false,
name = "test 2",
lnum = 23,
id = path
.. '::"namespace 2"::"nested namespace 2 - " .. tostring(i)::("test %d"):format(j)',
name = '("test %d"):format(j)',
path = path,
range = { 22, 16, 24, 20 },
type = "test",
},
},
{
{
id = path .. "::namespace::2::nested::namespace::2::-::2::test::1",
in_tree = false,
name = "test 1",
lnum = 23,
path = path,
type = "test",
{
id = path .. "::namespace::2::nested::namespace::2::-::1::test::1",
in_tree = false,
name = "test 1",
lnum = 23,
path = path,
type = "test",
},
},
},
{
{
id = path .. "::namespace::2::nested::namespace::2::-::2::test::2",
in_tree = false,
name = "test 2",
lnum = 23,
path = path,
type = "test",
{
id = path .. "::namespace::2::nested::namespace::2::-::1::test::2",
in_tree = false,
name = "test 2",
lnum = 23,
path = path,
type = "test",
},
},
{
{
id = path .. "::namespace::2::nested::namespace::2::-::2::test::1",
in_tree = false,
name = "test 1",
lnum = 23,
path = path,
type = "test",
},
},
{
{
id = path .. "::namespace::2::nested::namespace::2::-::2::test::2",
in_tree = false,
name = "test 2",
lnum = 23,
path = path,
type = "test",
},
},
},
},
},
},
}
}
end
Loading

0 comments on commit ccd3ff3

Please sign in to comment.