tests: add calc tests
[m6w6/ext-psi] / tests / calc / calc001.phpt
diff --git a/tests/calc/calc001.phpt b/tests/calc/calc001.phpt
new file mode 100644 (file)
index 0000000..2b6cbb6
--- /dev/null
@@ -0,0 +1,29 @@
+--TEST--
+calc
+--INI--
+psi.directory={PWD}/../../psi.d:{PWD}
+--SKIPIF--
+<?php
+extension_loaded("psi") or die("skip need ext/psi");
+?>
+--FILE--
+===TEST===
+<?php
+for ($i = 0; $i < 10; ++$i) {
+       $func = "test\\calc$i";
+       if (function_exists($func)) {
+               $res = $func();
+               if ($res === ["quot"=>1, "rem"=>0]) {
+                       echo "yay-";
+               } else {
+                       var_dump($res);
+               }
+       }
+}
+?>
+
+===DONE===
+--EXPECTREGEX--
+===TEST===
+(yay-)+
+===DONE===