0
0
mirror of https://github.com/phpv8/v8js.git synced 2024-12-22 15:11:53 +00:00

Forgot to commit test for large number support.

This commit is contained in:
Taneli Leppa 2014-03-20 15:45:35 +02:00
parent 9ddac3f124
commit 66dbe7d323

44
tests/long.phpt Normal file
View File

@ -0,0 +1,44 @@
--TEST--
Test V8::executeString() : Check long integer handling from PHP to JS
--SKIPIF--
<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?>
--FILE--
<?php
$v8 = new V8Js();
$v8->long = pow(2, 31);
try {
$v8->executeString('print(PHP.long); print("\n");');
} catch (V8JsScriptException $e) {
var_dump($e->getMessage());
}
$v8->long = pow(2, 31) + 1;
try {
$v8->executeString('print(PHP.long); print("\n");');
} catch (V8JsScriptException $e) {
var_dump($e->getMessage());
}
$v8->long = -pow(2, 31);
try {
$v8->executeString('print(PHP.long); print("\n");');
} catch (V8JsScriptException $e) {
var_dump($e->getMessage());
}
$v8->long = -pow(2, 31) - 1;
try {
$v8->executeString('print(PHP.long); print("\n");');
} catch (V8JsScriptException $e) {
var_dump($e->getMessage());
}
?>
===EOF===
--EXPECT--
2147483648
2147483649
-2147483648
-2147483649
===EOF===