Sfoglia il codice sorgente

Merge pull request #303 from stesie/issue-302

Fixes test on V8 5.9.35
Stefan Siegl 8 anni fa
parent
commit
37ffdc6379
2 ha cambiato i file con 15 aggiunte e 4 eliminazioni
  1. 4 1
      Commandfile
  2. 11 3
      tests/exception_start_column.phpt

+ 4 - 1
Commandfile

@@ -31,8 +31,11 @@ command 'build',
 
 command 'test',
   description: 'executes "make test"',
+  parameters: {
+    tests: { wrap: "TESTS=tests/%s", optional: true },
+  },
   script: <<-eof
-    cd /data/build; `which gmake || which make` test NO_INTERACTION=1 REPORT_EXIT_STATUS=1
+    cd /data/build; `which gmake || which make` test %{tests} NO_INTERACTION=1 REPORT_EXIT_STATUS=1
     eof
 
 command 'shell',

+ 11 - 3
tests/exception_start_column.phpt

@@ -6,15 +6,23 @@ Test V8::executeString() : Test getJsStartColumn on script exception
 <?php
 $v8 = new V8Js();
 
+// V8 started to return different start column numbers,
+// hence let's do two errors and just look at the offset
+
 try {
 	$v8->executeString("print(blar());");
 }
-catch(V8JsScriptException $e) {
-	var_dump($e->getJsStartColumn());
+catch(V8JsScriptException $a) { }
+
+try {
+	$v8->executeString("(null); print(blar());");
 }
+catch(V8JsScriptException $b) { }
+
+var_dump($b->getJsStartColumn() - $a->getJsStartColumn());
 
 ?>
 ===EOF===
 --EXPECT--
-int(6)
+int(8)
 ===EOF===