Skip to content

Commit 8f1fa88

Browse files
committed
fix: add tests
1 parent 954bed0 commit 8f1fa88

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

spec/utils_spec.lua

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,3 +89,21 @@ describe('utils.fmt_error', function ()
8989
assert.are.same('Bad things happen', result)
9090
end)
9191
end)
92+
93+
describe('utils.split_args', function ()
94+
it('works with standard string', function ()
95+
assert.are.equal({'this', 'is', 'a', 'standard', 'string'}, require('dap.utils').split_args('this is a standard string'))
96+
end)
97+
98+
it('with "double quoted" string', function ()
99+
assert.are.equal({'with', 'double quoted', 'string'}, require('dap.utils').split_args('with "double quoted" string'))
100+
end)
101+
102+
it("with 'single quoted' string", function ()
103+
assert.are.equal({'with', 'single quoted', 'string'}, require('dap.utils').split_args("with 'single quoted' string"))
104+
end)
105+
106+
it('"double \"escaped\" quoted" string', function ()
107+
assert.are.equal({'double "escaped" quoted', 'string'}, require('dap.utils').split_args('"double \"escaped\" quoted" string'))
108+
end)
109+
end)

0 commit comments

Comments
 (0)