Skip to content

Commit 60566ae

Browse files
committed
test: add test cases related to rawset(_G, ...)
1 parent 5efe20b commit 60566ae

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

test/type_inference/common.lua

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1321,6 +1321,32 @@ TEST 'Test' [[
13211321
_G.<?Test?> = {}
13221322
]]
13231323

1324+
TEST 'integer' [[
1325+
rawset(_G, 'Test', 1)
1326+
print(<?Test?>)
1327+
]]
1328+
1329+
TEST 'string' [[
1330+
rawset(_G, 'Test', '')
1331+
print(<?Test?>)
1332+
]]
1333+
1334+
TEST 'boolean' [[
1335+
rawset(_G, 'Test', true)
1336+
print(<?Test?>)
1337+
]]
1338+
1339+
TEST 'table' [[
1340+
rawset(_G, 'Test', {})
1341+
print(<?Test?>)
1342+
]]
1343+
1344+
TEST 'Test' [[
1345+
---@class Test
1346+
rawset(_G, 'Test', {})
1347+
print(<?Test?>)
1348+
]]
1349+
13241350
TEST 'integer' [[
13251351
local mt = {}
13261352

0 commit comments

Comments
 (0)