Added new text formatting system for future updates [like vanilla PC]

This commit is contained in:
Shoghi Cervantes
2013-09-04 19:49:19 +02:00
parent 56d829eec6
commit 809076b7d7
9 changed files with 170 additions and 33 deletions

View File

@@ -4,9 +4,9 @@
function testCase($name, $output, $expected){
global $testErrors;
if($output === $expected){
console("[TEST] $name: \x1b[32mOk.");
console("[TEST] $name: ".FORMAT_GREEN."Ok.");
}else{
console("[TEST] $name: \x1b[31mError.");
console("[TEST] $name: ".FORMAT_RED."Error.");
console("Expected ".print_r($expected, true).", got ".print_r($output, true));
++$testErrors;
}
@@ -17,15 +17,15 @@
require_once(dirname(__FILE__)."/../dependencies.php");
require_once(FILE_PATH."/src/functions.php");
require_once(FILE_PATH."/src/dependencies.php");
console("\x1b[36m[TEST] Starting tests");
console(FORMAT_GREEN . "[TEST] Starting tests");
testCase("dummy", dummy(), null);
$t = new ServerSuiteTest;
echo PHP_EOL;
if($testErrors === 0){
console("\x1b[32m[TEST] No errors. Test complete.");
console(FORMAT_GREEN . "[TEST] No errors. Test complete.");
exit(0);
}else{
console("\x1b[31m[TEST] Errors found.");
console(FORMAT_RED . "[TEST] Errors found.");
exit(1);
}
}