Test.hx 499 B

12345678910111213141516
  1. class Test {
  2. static function error(msg, code) {
  3. Sys.stderr().writeString(msg);
  4. Sys.exit(code);
  5. }
  6. static function main() {
  7. var proc = new sys.io.Process("haxe", ["--display", "Main.hx@38@toplevel"]);
  8. var stderr = proc.stderr.readAll().toString();
  9. var exit = proc.exitCode();
  10. if (exit != 0)
  11. error(stderr, exit);
  12. else if (stderr.indexOf("<il>") != 0)
  13. error("Invalid toplevel completion output\n", 1);
  14. }
  15. }