@@ -8,43 +8,44 @@ require "common.arg_parse"
88describe (" unception nvim tests" , function ()
99 describe (" argument parser" , function ()
1010 local tests_list = {
11- -- { -- NYI
12- -- argv = { "file", "\\+32" },
13- -- output = { { file = "open" }, { file = "+32" } }
14- -- },
1511 {
1612 argv = { " /usr/bin/nvim" , " file" , " +5" , " -p" },
17- output = { { path = " file" , line = " 5 " } },
18- option = { multi_file_open_method = " tab" }
13+ output = { file = 5 },
14+ option = { multi_file_open_method = " tab" }
1915 },
2016 {
2117 argv = { " /usr/bin/dontcare" , " file" , " file2" , " +32" },
22- output = { { path = " file " }, { path = " file2" , line = " 32 " } },
23- option = { }
18+ output = { file2 = 32 },
19+ option = {}
2420 },
2521 {
26- argv = { " /usr/bin/dontcare" , " --ignored-option-long" , " -i" , " file " , " file2" , " +32" },
27- output = { { path = " file " }, { path = " file2" , line = " 32 " } },
28- option = { }
22+ argv = { " /usr/bin/dontcare" , " --ignored-option-long" , " -i" , " file2" , " +32" },
23+ output = { file2 = 32 },
24+ option = {}
2925 },
3026 -- { -- NYI
3127 -- argv = { "/usr/bin/dontcare", "\\- file starting with dash" },
3228 -- output = { { file = "- file starting with dash" } }
3329 -- },
3430 {
35- argv = { " /usr/bin/dontcare" , " --" , " - file starting with dash" },
36- output = { { path = " - file starting with dash" } },
37- option = { }
31+ argv = { " /usr/bin/dontcare" , " +15 " , " --" , " - file starting with dash" },
32+ output = { [ " - file starting with dash" ] = 15 },
33+ option = {}
3834 },
3935 {
4036 argv = { " /usr/bin/nvim" , " file" , " +5" , " -o" },
41- output = { { path = " file" , line = " 5 " } },
42- option = { multi_file_open_method = " split" }
37+ output = { file = 5 },
38+ option = { multi_file_open_method = " split" }
4339 },
4440 {
4541 argv = { " /usr/bin/nvim" , " file" , " +5" , " -O" },
46- output = { { path = " file" , line = " 5" } },
47- option = { multi_file_open_method = " vsplit" }
42+ output = { file = 5 },
43+ option = { multi_file_open_method = " vsplit" }
44+ },
45+ {
46+ argv = { " /usr/bin/nvim" , " file" , " file2" , " +3" , " -d" },
47+ output = { file2 = 3 },
48+ option = { multi_file_open_method = " diff" }
4849 },
4950 }
5051 for i , test in ipairs (tests_list ) do
@@ -55,6 +56,5 @@ describe("unception nvim tests", function()
5556 assert .are .same (options , test .option )
5657 end )
5758 end
58-
5959 end )
6060end )
0 commit comments