fix .gitignore

This commit is contained in:
CismonX 2019-03-19 13:36:50 +08:00
parent 9e4f51e488
commit 9f62653cea
3 changed files with 35 additions and 6 deletions

12
.gitignore vendored
View File

@ -28,11 +28,11 @@ missing
mkinstalldirs
modules
run-tests.php
tests/*/*.diff
tests/*/*.out
tests/*/*.php
tests/*/*.exp
tests/*/*.log
tests/*/*.sh
tests/*.diff
tests/*.out
tests/*.php
tests/*.exp
tests/*.log
tests/*.sh
.idea/
.vscode/

24
tests/includes/assert.php Normal file
View File

@ -0,0 +1,24 @@
<?php
/**
* Print message if test fail.
*
* @param string $test
* @param array $cases
* @return bool
*/
function batch_assert($test, ...$cases) {
foreach ($cases as $case) {
[$expected, $got] = $case;
if ($expected == $got) {
continue;
}
echo "Test for $test failed.\n";
$expected = var_export($expected, true);
$got = var_export($got, true);
echo "Expected:\n$expected\n";
echo "Got:\n$got\n";
return false;
}
return true;
}

View File

@ -0,0 +1,5 @@
<?php
if (!extension_loaded('arma')) {
echo 'skip armadillo extension is not loaded.';
}