Skip to content

Commit 6fe0ea8

Browse files
committed
cleanup tests
1 parent 736e54a commit 6fe0ea8

22 files changed

+426
-553
lines changed

test/diagnostics/ambiguity-1.lua

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
TEST [[
2+
local x
3+
x = <!x or 0 + 1!>
4+
]]
5+
6+
TEST [[
7+
local x, y
8+
x = <!x + y or 0!>
9+
]]
10+
11+
TEST [[
12+
local x, y, z
13+
x = x and y or '' .. z
14+
]]
15+
16+
TEST [[
17+
local x
18+
x = x or -1
19+
]]
20+
21+
TEST [[
22+
local x
23+
x = x or (0 + 1)
24+
]]
25+
26+
TEST [[
27+
local x, y
28+
x = (x + y) or 0
29+
]]

test/diagnostics/assign-type-mismatch.lua

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -465,3 +465,10 @@ local arr2 = {
465465
<!3!>, -- no warnings
466466
}
467467
]]
468+
469+
TEST [[
470+
local t = {}
471+
t.a = 1
472+
t.a = 2
473+
return t
474+
]]
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
TEST [[
2+
local _ <close> = <!1!>
3+
]]
4+
5+
TEST [[
6+
local _ <close> = <!''!>
7+
]]
8+
9+
TEST [[
10+
local c <close> = <!(function () return 1 end)()!>
11+
]]
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
TEST [[
2+
while true do
3+
break
4+
<!print()
5+
print()!>
6+
end
7+
]]

0 commit comments

Comments
 (0)