瀏覽代碼

add test for toplevel completion when cursor is on the identifier (closes #3298)

Dan Korostelev 11 年之前
父節點
當前提交
39feea2459

+ 1 - 0
tests/misc/projects/Issue3298/Main.hx

@@ -0,0 +1 @@
+class Main { static function main() { h } }

+ 16 - 0
tests/misc/projects/Issue3298/Test.hx

@@ -0,0 +1,16 @@
+class Test {
+    static function error(msg, code) {
+        Sys.stderr().writeString(msg);
+        Sys.exit(code);
+    }
+
+    static function main() {
+        var proc = new sys.io.Process("haxe", ["--display", "Main.hx@38@toplevel"]);
+        var exit = proc.exitCode();
+        var stderr = proc.stderr.readAll().toString();
+        if (exit != 0)
+            error(stderr, exit);
+        else if (stderr.indexOf("<il>") != 0)
+            error("Invalid toplevel completion output\n", 1);
+    }
+}

+ 1 - 0
tests/misc/projects/Issue3298/test.hxml

@@ -0,0 +1 @@
+--run Test