summaryrefslogtreecommitdiff
path: root/server/test
diff options
context:
space:
mode:
Diffstat (limited to 'server/test')
-rw-r--r--server/test/full/dirty.lua (renamed from server/test/vm/dirty.lua)0
-rw-r--r--server/test/full/example.lua (renamed from server/test/vm/example.lua)2
-rw-r--r--server/test/full/init.lua15
-rw-r--r--server/test/full/normal.lua (renamed from server/test/vm/normal.lua)0
-rw-r--r--server/test/main.lua2
-rw-r--r--server/test/vm/init.lua17
6 files changed, 17 insertions, 19 deletions
diff --git a/server/test/vm/dirty.lua b/server/test/full/dirty.lua
index 9c2e65fb..9c2e65fb 100644
--- a/server/test/vm/dirty.lua
+++ b/server/test/full/dirty.lua
diff --git a/server/test/vm/example.lua b/server/test/full/example.lua
index 9a2939b5..321f3bc7 100644
--- a/server/test/vm/example.lua
+++ b/server/test/full/example.lua
@@ -1,6 +1,6 @@
local fs = require 'bee.filesystem'
-TEST(io.load(ROOT / 'src' / 'core' / 'vm.lua'))
+TEST(io.load(ROOT / 'src' / 'vm' / 'vm.lua'))
-- 临时
local function testIfExit(path)
diff --git a/server/test/full/init.lua b/server/test/full/init.lua
new file mode 100644
index 00000000..f3a7402d
--- /dev/null
+++ b/server/test/full/init.lua
@@ -0,0 +1,15 @@
+local buildVM = require 'vm'
+local parser = require 'parser'
+
+rawset(_G, 'TEST', true)
+
+function TEST(script)
+ local ast = parser:ast(script)
+ assert(ast)
+ local vm = buildVM(ast)
+ assert(vm)
+end
+
+require 'full.normal'
+require 'full.example'
+require 'full.dirty'
diff --git a/server/test/vm/normal.lua b/server/test/full/normal.lua
index 02b1f4f0..02b1f4f0 100644
--- a/server/test/vm/normal.lua
+++ b/server/test/full/normal.lua
diff --git a/server/test/main.lua b/server/test/main.lua
index 8738002c..7a498929 100644
--- a/server/test/main.lua
+++ b/server/test/main.lua
@@ -25,7 +25,7 @@ local function main()
end
test 'core'
- test 'vm'
+ test 'full'
test 'definition'
test 'diagnostics'
test 'type_inference'
diff --git a/server/test/vm/init.lua b/server/test/vm/init.lua
deleted file mode 100644
index 6e7dc3ac..00000000
--- a/server/test/vm/init.lua
+++ /dev/null
@@ -1,17 +0,0 @@
-local core = require 'core'
-local parser = require 'parser'
-
-rawset(_G, 'TEST', true)
-
-function TEST(script)
- local ast = parser:ast(script)
- assert(ast)
- local vm = core.vm(ast)
- assert(vm)
- local results = vm.results
- assert(results)
-end
-
-require 'vm.normal'
-require 'vm.example'
-require 'vm.dirty'