summaryrefslogtreecommitdiff
path: root/server/test/diagnostics/init.lua
diff options
context:
space:
mode:
Diffstat (limited to 'server/test/diagnostics/init.lua')
-rw-r--r--server/test/diagnostics/init.lua25
1 files changed, 24 insertions, 1 deletions
diff --git a/server/test/diagnostics/init.lua b/server/test/diagnostics/init.lua
index f0f7096f..555bc0a8 100644
--- a/server/test/diagnostics/init.lua
+++ b/server/test/diagnostics/init.lua
@@ -1,7 +1,8 @@
-local core = require 'core'
+local core = require 'core'
local buildVM = require 'vm'
local parser = require 'parser'
local service = require 'service'
+local config = require 'config'
rawset(_G, 'TEST', true)
@@ -151,6 +152,28 @@ print(1)
_ENV = nil
]]
+config.config.diagnostics.disable['undefined-env-child'] = true
+TEST [[
+_ENV = nil
+<!GLOBAL!> = 1 --> _ENV.GLOBAL = 1
+]]
+
+TEST [[
+_ENV = nil
+local _ = <!GLOBAL!> --> local _ = _ENV.GLOBAL
+]]
+
+TEST [[
+_ENV = {}
+GLOBAL = 1 --> _ENV.GLOBAL = 1
+]]
+
+TEST [[
+_ENV = {}
+local _ = GLOBAL --> local _ = _ENV.GLOBAL
+]]
+
+config.config.diagnostics.disable['undefined-env-child'] = nil
TEST [[
print()
<!('string')!>:sub(1, 1)