mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-20 11:39:43 +00:00
Added new text formatting system for future updates [like vanilla PC]
This commit is contained in:
parent
56d829eec6
commit
809076b7d7
9 changed files with 170 additions and 33 deletions
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue