Browse Source

remove haxe.unit (#6600)

* [tests] use utest for sys tests and remove haxe.unit

* install utest

* fix python tests
Simon Krajewski 8 years ago
parent
commit
30e1e5e61b

+ 0 - 116
std/haxe/unit/TestCase.hx

@@ -1,116 +0,0 @@
-/*
- * Copyright (C)2005-2017 Haxe Foundation
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
-package haxe.unit;
-import haxe.PosInfos;
-
-/**
-	This unit test class should be extended to create test cases. Each test 
-	method created in this extended class should start with the name "test".
-
-	These test methods should call the assertion methods:
-
-	 * `assertTrue(a)`: Succeeds if `a` is `true`.
-	 * `assertFalse(a)`: Succeeds if `a` is `false`.
-	 * `assertEquals(expected, actual)`: Succeeds if `expected` and `actual`
-	   are equal.
-
-	```haxe
-	class MyTestCase extends haxe.unit.TestCase {
-		function testBasic() {
-			assertEquals("A", "A");
-		}
-	}
-	```
-
-	The TestCase can be tested using `TestRunner`. 
-
-	To run code before or after the test, override the functions `setup` 
-	and `tearDown`.
-
-	@see <https://haxe.org/manual/std-unit-testing.html>
-**/
-@:keepSub
-@:publicFields
-class TestCase {
-	/**
-		The current test status of the TestRunner.
-	**/
-	public var currentTest : TestStatus;
-
-	public function new( ) {
-	}
-
-	/**
-		Override this method to execute code before the test runs.
-	**/
-	public function setup() : Void {
-	}
-
-	/**
-		Override this method to execute code after the test ran.
-	**/
-	public function tearDown() : Void {
-	}
-
-	function print( v : Dynamic ) {
-		haxe.unit.TestRunner.print(v);
-	}
-
-	/**
-		Succeeds if `b` is `true`.
-	**/
-	function assertTrue( b:Bool, ?c : PosInfos ) : Void {
-		currentTest.done = true;
-		if (b != true){
-			currentTest.success = false;
-			currentTest.error   = "expected true but was false";
-			currentTest.posInfos = c;
-			throw currentTest;
-		}
-	}
-
-	/**
-		Succeeds if `b` is `false`.
-	**/
-	function assertFalse( b:Bool, ?c : PosInfos ) : Void {
-		currentTest.done = true;
-		if (b == true){
-			currentTest.success = false;
-			currentTest.error   = "expected false but was true";
-			currentTest.posInfos = c;
-			throw currentTest;
-		}
-	}
-
-	/**
-		Succeeds if `expected` and `actual` are equal.
-	**/
-	function assertEquals<T>( expected: T , actual: T,  ?c : PosInfos ) : Void {
-		currentTest.done = true;
-		if (actual != expected){
-			currentTest.success = false;
-			currentTest.error   = "expected '" + expected + "' but was '" + actual + "'";
-			currentTest.posInfos = c;
-			throw currentTest;
-		}
-	}
-}

+ 0 - 100
std/haxe/unit/TestResult.hx

@@ -1,100 +0,0 @@
-/*
- * Copyright (C)2005-2017 Haxe Foundation
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
- package haxe.unit;
-
-/**
-	TestResult contains the result of the executed unit tests.
-**/
-class TestResult {
-	var m_tests : List<TestStatus>;
-
-	/**
-		`true` if the unit test succesfully executed the test cases.
-	**/
-	public var success(default, null) : Bool;
-
-	public function new() {
-		m_tests = new List();
-		success = true;
-	}
-
-	public function add( t:TestStatus ) : Void {
-		m_tests.add(t);
-		if( !t.success )
-			success = false;
-	}
-
-	/**
-		String representation from the result of the unit test.
-	**/
-	public function toString() : String 	{
-		var buf = new StringBuf();
-		var failures = 0;
-		for ( test in m_tests ){
-			if (test.success == false){
-				buf.add("* ");
-				buf.add(test.classname);
-				buf.add("::");
-				buf.add(test.method);
-				buf.add("()");
-				buf.add("\n");
-
-				buf.add("ERR: ");
-				if( test.posInfos != null ){
-					buf.add(test.posInfos.fileName);
-					buf.add(":");
-					buf.add(test.posInfos.lineNumber);
-					buf.add("(");
-					buf.add(test.posInfos.className);
-					buf.add(".");
-					buf.add(test.posInfos.methodName);
-					buf.add(") - ");
-				}
-				buf.add(test.error);
-				buf.add("\n");
-
-				if (test.backtrace != null) {
-					buf.add(test.backtrace);
-					buf.add("\n");
-				}
-
-				buf.add("\n");
-				failures++;
-			}
-		}
-		buf.add("\n");
-		if (failures == 0)
-			buf.add("OK ");
-		else
-			buf.add("FAILED ");
-
-		buf.add(m_tests.length);
-		buf.add(" tests, ");
-		buf.add(failures);
-		buf.add(" failed, ");
-		buf.add( (m_tests.length - failures) );
-		buf.add(" success");
-		buf.add("\n");
-		return buf.toString();
-	}
-
-}

+ 0 - 186
std/haxe/unit/TestRunner.hx

@@ -1,186 +0,0 @@
-/*
- * Copyright (C)2005-2017 Haxe Foundation
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
-package haxe.unit;
-import Reflect;
-
-/**
-	This class runs unit test cases and prints the result.
-
-	```haxe
-	var r = new haxe.unit.TestRunner();
-	r.add(new MyTestCase());
-	// add other TestCases here
-
-	// finally, run the tests
-	r.run();
-	```
-
-	@see <https://haxe.org/manual/std-unit-testing.html>
-**/
-class TestRunner {
-	/**
-		The unit test results. Available after the `run()` is called.
-	**/
-	public var result(default, null) : TestResult;
-
-	var cases  : List<TestCase>;
-
-#if flash
-	static var tf : flash.text.TextField = null;
-#end
-
-	/**
-		Prints the given object/value.
-
-		 * Flash outputs the result in a new `TextField` on stage.
-		 * JavaScript outputs the result using `console.log`.
-		 * Other targets use native `print` to output the result.
-
-		This function is `dynamic` so it can be overriden in custom setups.
-	**/
-	public static dynamic function print( v : Dynamic ) untyped {
-		#if flash
-			if( tf == null ) {
-				tf = new flash.text.TextField();
-				tf.selectable = false;
-				tf.width = flash.Lib.current.stage.stageWidth;
-				tf.autoSize = flash.text.TextFieldAutoSize.LEFT;
-				flash.Lib.current.addChild(tf);
-			}
-			tf.appendText(v);
-		#elseif neko
-			__dollar__print(v);
-		#elseif php
-			php.Lib.print(v);
-		#elseif cpp
-			cpp.Lib.print(v);
-		#elseif js
-			var msg = js.Boot.__string_rec(v,"");
-			var d;
-			if( __js__("typeof")(document) != "undefined"
-				&& (d = document.getElementById("haxe:trace")) != null ) {
-				msg = StringTools.htmlEscape(msg).split("\n").join("<br/>");
-				d.innerHTML += msg+"<br/>";
-			}
-			else if (  __js__("typeof process") != "undefined"
-					&& __js__("process").stdout != null
-					&& __js__("process").stdout.write != null)
-				__js__("process").stdout.write(msg); // node
-			else if (  __js__("typeof console") != "undefined"
-					&& __js__("console").log != null )
-				__js__("console").log(msg); // document-less js (which may include a line break)
-
-		#elseif cs
-			cs.system.Console.Write(v);
-		#elseif java
-			var str:String = v;
-			untyped __java__("java.lang.System.out.print(str)");
-		#elseif python
-			python.Lib.print(v);
-		#elseif (hl || lua || eval)
-			Sys.print(Std.string(v));
-		#end
-	}
-
-	private static function customTrace( v, ?p : haxe.PosInfos ) {
-		print(p.fileName+":"+p.lineNumber+": "+Std.string(v)+"\n");
-	}
-
-	public function new() {
-		result = new TestResult();
-		cases = new List();
-	}
-
-	/**
-		Add TestCase instances to the unit test.
-	**/
-	public function add( c:TestCase ) : Void{
-		cases.add(c);
-	}
-
-	/**
-		Runs the unit tests and prints the results.
-
-		@return `true` if the unit test succesfully executed the test cases.
-	**/
-	public function run() : Bool {
-		result = new TestResult();
-		for ( c in cases ){
-			runCase(c);
-		}
-		print(result.toString());
-		return result.success;
-	}
-
-	function runCase( t:TestCase ) : Void 	{
-		var old = haxe.Log.trace;
-		haxe.Log.trace = customTrace;
-
-		var cl = Type.getClass(t);
-		var fields = Type.getInstanceFields(cl);
-
-		print( "Class: "+Type.getClassName(cl)+" ");
-		for ( f in fields ){
-			var fname = f;
-			var field = Reflect.field(t, f);
-			if ( StringTools.startsWith(fname,"test") && Reflect.isFunction(field) ){
-				t.currentTest = new TestStatus();
-				t.currentTest.classname = Type.getClassName(cl);
-				t.currentTest.method = fname;
-				t.setup();
-
-				try {
-					Reflect.callMethod(t, field, new Array());
-
-					if( t.currentTest.done ){
-						t.currentTest.success = true;
-						print(".");
-					}else{
-						t.currentTest.success = false;
-						t.currentTest.error = "(warning) no assert";
-						print("W");
-					}
-				}catch ( e : TestStatus ){
-					print("F");
-					t.currentTest.backtrace = haxe.CallStack.toString(haxe.CallStack.exceptionStack());
-				}catch ( e : Dynamic ){
-					print("E");
-					#if js
-					if( e.message != null ){
-						t.currentTest.error = "exception thrown : "+e+" ["+e.message+"]";
-					}else{
-						t.currentTest.error = "exception thrown : "+e;
-					}
-					#else
-					t.currentTest.error = "exception thrown : "+e;
-					#end
-					t.currentTest.backtrace = haxe.CallStack.toString(haxe.CallStack.exceptionStack());
-				}
-				result.add(t.currentTest);
-				t.tearDown();
-			}
-		}
-
-		print("\n");
-		haxe.Log.trace = old;
-	}
-}

+ 0 - 72
std/haxe/unit/TestStatus.hx

@@ -1,72 +0,0 @@
-/*
- * Copyright (C)2005-2017 Haxe Foundation
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
-package haxe.unit;
-import haxe.CallStack;
-
-import haxe.PosInfos;
-
-/**
-	The status information of a unit test case method.
-
-	@see <https://haxe.org/manual/std-unit-testing.html>
-**/
-class TestStatus {
-	/**
-		`true` when the unit test is executed.
-	**/
-	public var done : Bool;
-
-	/**
-		`true` when succesfully unit tested.
-	**/
-	public var success : Bool;
-
-	/**
-		The error message of the unit test method.
-	**/
-	public var error : String;
-
-	/**
-		The method name of the unit test.
-	**/
-	public var method : String;
-
-	/**
-		The class name of the unit test.
-	**/
-	public var classname : String;
-
-	/**
-		The position information of the unit test.
-	**/
-	public var posInfos : PosInfos;
-
-	/**
-		The representation of the stack exception.
-	**/
-	public var backtrace : String;
-
-	public function new() 	{
-		done = false;
-		success = false;
-	}
-}

+ 9 - 0
tests/RunCi.hx

@@ -861,6 +861,7 @@ class RunCi {
 						runCommand("haxe", ["compile.hxml"]);
 						runCommand("haxe", ["compile.hxml"]);
 
 
 						changeDirectory(sysDir);
 						changeDirectory(sysDir);
+						haxelibInstall("utest");
 						runCommand("haxe", ["compile-macro.hxml"]);
 						runCommand("haxe", ["compile-macro.hxml"]);
 						runCommand("haxe", ["compile-each.hxml", "--run", "Main"]);
 						runCommand("haxe", ["compile-each.hxml", "--run", "Main"]);
 					case Neko:
 					case Neko:
@@ -868,6 +869,7 @@ class RunCi {
 						runCommand("neko", ["bin/unit.n"]);
 						runCommand("neko", ["bin/unit.n"]);
 
 
 						changeDirectory(sysDir);
 						changeDirectory(sysDir);
+						haxelibInstall("utest");
 						runCommand("haxe", ["compile-neko.hxml"]);
 						runCommand("haxe", ["compile-neko.hxml"]);
 						runCommand("neko", ["bin/neko/sys.n"]);
 						runCommand("neko", ["bin/neko/sys.n"]);
 					case Php7:
 					case Php7:
@@ -877,6 +879,7 @@ class RunCi {
 							runCommand("php", ["bin/php7/index.php"]);
 							runCommand("php", ["bin/php7/index.php"]);
 
 
 							changeDirectory(sysDir);
 							changeDirectory(sysDir);
+							haxelibInstall("utest");
 							runCommand("haxe", ["compile-php7.hxml"]);
 							runCommand("haxe", ["compile-php7.hxml"]);
 							runCommand("php", ["bin/php7/Main/index.php"]);
 							runCommand("php", ["bin/php7/Main/index.php"]);
 						}
 						}
@@ -886,6 +889,7 @@ class RunCi {
 							runCommand("php", ["bin/php/index.php"]);
 							runCommand("php", ["bin/php/index.php"]);
 
 
 							changeDirectory(sysDir);
 							changeDirectory(sysDir);
+							haxelibInstall("utest");
 							runCommand("haxe", ["compile-php.hxml"]);
 							runCommand("haxe", ["compile-php.hxml"]);
 							runCommand("php", ["bin/php/Main/index.php"]);
 							runCommand("php", ["bin/php/Main/index.php"]);
 					case Python:
 					case Python:
@@ -897,6 +901,7 @@ class RunCi {
 						}
 						}
 
 
 						changeDirectory(sysDir);
 						changeDirectory(sysDir);
+						haxelibInstall("utest");
 						runCommand("haxe", ["compile-python.hxml"]);
 						runCommand("haxe", ["compile-python.hxml"]);
 						for (py in pys) {
 						for (py in pys) {
 							runCommand(py, ["bin/python/sys.py"]);
 							runCommand(py, ["bin/python/sys.py"]);
@@ -926,6 +931,7 @@ class RunCi {
 							runCommand("lua", ["bin/unit.lua"]);
 							runCommand("lua", ["bin/unit.lua"]);
 
 
 							changeDirectory(sysDir);
 							changeDirectory(sysDir);
+							haxelibInstall("utest");
 							runCommand("haxe", ["compile-lua.hxml"].concat(args));
 							runCommand("haxe", ["compile-lua.hxml"].concat(args));
 							runCommand("lua", ["bin/lua/sys.lua"]);
 							runCommand("lua", ["bin/lua/sys.lua"]);
 
 
@@ -955,6 +961,7 @@ class RunCi {
 						}
 						}
 
 
 						changeDirectory(sysDir);
 						changeDirectory(sysDir);
+						haxelibInstall("utest");
 						runCommand("haxe", ["compile-cpp.hxml"]);
 						runCommand("haxe", ["compile-cpp.hxml"]);
 						runCpp("bin/cpp/Main-debug", []);
 						runCpp("bin/cpp/Main-debug", []);
 
 
@@ -1041,6 +1048,7 @@ class RunCi {
 						runCommand("java", ["-jar", "bin/java/TestMain-Debug.jar"]);
 						runCommand("java", ["-jar", "bin/java/TestMain-Debug.jar"]);
 
 
 						changeDirectory(sysDir);
 						changeDirectory(sysDir);
+						haxelibInstall("utest");
 						runCommand("haxe", ["compile-java.hxml"]);
 						runCommand("haxe", ["compile-java.hxml"]);
 						runCommand("java", ["-jar", "bin/java/Main-Debug.jar"]);
 						runCommand("java", ["-jar", "bin/java/Main-Debug.jar"]);
 
 
@@ -1085,6 +1093,7 @@ class RunCi {
 						runCs("bin/cs/bin/TestMain-Debug.exe");
 						runCs("bin/cs/bin/TestMain-Debug.exe");
 
 
 						changeDirectory(sysDir);
 						changeDirectory(sysDir);
+						haxelibInstall("utest");
 						runCommand("haxe", ["compile-cs.hxml",'-D','fast_cast']);
 						runCommand("haxe", ["compile-cs.hxml",'-D','fast_cast']);
 						runCs("bin/cs/bin/Main-Debug.exe", []);
 						runCs("bin/cs/bin/Main-Debug.exe", []);
 
 

+ 12 - 8
tests/misc/pythonImport/Main.hx

@@ -1,3 +1,5 @@
+import utest.Assert;
+
 @:pythonImport("native_python.sample", "A")
 @:pythonImport("native_python.sample", "A")
 extern class ExternClass {
 extern class ExternClass {
     function new();
     function new();
@@ -24,18 +26,20 @@ extern class InexistantExtern2 {}
 @:pythonImport("inexistant", ignoreError=true)
 @:pythonImport("inexistant", ignoreError=true)
 extern class InexistantExtern3 {}
 extern class InexistantExtern3 {}
 
 
-class Main extends haxe.unit.TestCase {
+class Main {
+
+	function new() { }
 
 
     function testExtern() {
     function testExtern() {
-        assertEquals(new ExternClass().f(1), 2);
-        assertEquals(new ExternNestedClass().f(1), 3);
-        assertEquals(ExternModule.f(1), 4);
+        Assert.equals(new ExternClass().f(1), 2);
+        Assert.equals(new ExternNestedClass().f(1), 3);
+        Assert.equals(ExternModule.f(1), 4);
     }
     }
 
 
     static function main() {
     static function main() {
-        var runner = new haxe.unit.TestRunner();
-        runner.add(new Main());
-        var code = runner.run() ? 0 : 1;
-        Sys.exit(code);
+        var runner = new utest.Runner();
+        runner.addCase(new Main());
+		utest.ui.Report.create(runner);
+		runner.run();
     }
     }
 }
 }

+ 1 - 0
tests/misc/pythonImport/compile.hxml

@@ -1,2 +1,3 @@
 -main Main
 -main Main
 -python test.py
 -python test.py
+-lib utest

+ 2 - 0
tests/sys/compile-each.hxml

@@ -1,9 +1,11 @@
 -cp src
 -cp src
 -main ExitCode
 -main ExitCode
 -neko bin/neko/ExitCode.n
 -neko bin/neko/ExitCode.n
+-lib utest
 -cmd nekotools boot bin/neko/ExitCode.n
 -cmd nekotools boot bin/neko/ExitCode.n
 
 
 --next
 --next
 -D source-header=''
 -D source-header=''
 -debug
 -debug
+-lib utest
 -cp src
 -cp src

+ 11 - 8
tests/sys/src/Main.hx

@@ -1,12 +1,15 @@
+import utest.Runner;
+import utest.ui.Report;
+
 class Main {
 class Main {
 	static public function main() {
 	static public function main() {
-		var runner = new haxe.unit.TestRunner();
-		runner.add(new TestSys());
-		runner.add(new TestFileSystem());
-		runner.add(new io.TestFile());
-		runner.add(new io.TestFileInput());
-		runner.add(new io.TestProcess());
-		var code = runner.run() ? 0 : 1;
-		Sys.exit(code);
+		var runner = new Runner();
+		runner.addCase(new TestSys());
+		runner.addCase(new TestFileSystem());
+		runner.addCase(new io.TestFile());
+		runner.addCase(new io.TestFileInput());
+		runner.addCase(new io.TestProcess());
+		Report.create(runner);
+		runner.run();
 	}
 	}
 }
 }

+ 12 - 16
tests/sys/src/TestArguments.hx

@@ -1,8 +1,11 @@
+import utest.Assert;
+import utest.Runner;
+import utest.ui.Report;
+
 /**
 /**
 	This test is intented to be used by TestSys and io.TestProcess.
 	This test is intented to be used by TestSys and io.TestProcess.
-	It will write the result to "temp/TestArguments.txt" (for debugging).
 */
 */
-class TestArguments extends haxe.unit.TestCase {
+class TestArguments {
 	// We may compare and update the test cases of other popular langs/libs: https://gist.github.com/andyli/d55ae9ea1327bbbf749d
 	// We may compare and update the test cases of other popular langs/libs: https://gist.github.com/andyli/d55ae9ea1327bbbf749d
 	static public var expectedArgs(default, never):Array<String> = [
 	static public var expectedArgs(default, never):Array<String> = [
 		"foo",
 		"foo",
@@ -100,27 +103,20 @@ class TestArguments extends haxe.unit.TestCase {
 		null;
 		null;
 	#end
 	#end
 
 
-	static public var log = "temp/TestArguments.txt";
+	function new() { }
 
 
 	function testArgs() {
 	function testArgs() {
 		var args = Sys.args();
 		var args = Sys.args();
 		for (i in 0...expectedArgs.length) {
 		for (i in 0...expectedArgs.length) {
-			assertEquals(expectedArgs[i], args[i]);
+			Assert.equals(expectedArgs[i], args[i]);
 		}
 		}
-		assertEquals(expectedArgs.length, args.length);
+		Assert.equals(expectedArgs.length, args.length);
 	}
 	}
 
 
 	static function main():Void {
 	static function main():Void {
-		var log = sys.io.File.write(log);
-		log.writeString(haxe.Json.stringify(Sys.args()) + "\n");
-		haxe.unit.TestRunner.print = function(v){
-			log.writeString(v);
-		};
-		var runner = new haxe.unit.TestRunner();
-		runner.add(new TestArguments());
-		var code = runner.run() ? 0 : 1;
-		log.flush();
-		log.close();
-		Sys.exit(code);
+		var runner = new Runner();
+		Report.create(runner);
+		runner.addCase(new TestArguments());
+		runner.run();
 	}
 	}
 }
 }

+ 12 - 12
tests/sys/src/TestCommandBase.hx

@@ -1,8 +1,12 @@
 import sys.*;
 import sys.*;
 import haxe.io.*;
 import haxe.io.*;
+import utest.Assert;
 
 
-class TestCommandBase extends haxe.unit.TestCase {
+class TestCommandBase {
 	var runInfo:{out:String, err:String} = null;
 	var runInfo:{out:String, err:String} = null;
+
+	public function new() { }
+
 	function run(cmd:String, ?args:Array<String>):Int {
 	function run(cmd:String, ?args:Array<String>):Int {
 		throw "should be overridden";
 		throw "should be overridden";
 	}
 	}
@@ -13,9 +17,7 @@ class TestCommandBase extends haxe.unit.TestCase {
 
 
 		#if !cs
 		#if !cs
 		var exitCode = run("haxe", ["compile-each.hxml", "--run", "TestArguments"].concat(args));
 		var exitCode = run("haxe", ["compile-each.hxml", "--run", "TestArguments"].concat(args));
-		if (exitCode != 0)
-			trace(sys.io.File.getContent(TestArguments.log));
-		assertEquals(0, exitCode);
+		Assert.equals(0, exitCode);
 		#end
 		#end
 
 
 		var exitCode =
 		var exitCode =
@@ -45,9 +47,7 @@ class TestCommandBase extends haxe.unit.TestCase {
 			#else
 			#else
 				-1;
 				-1;
 			#end
 			#end
-		if (exitCode != 0)
-			trace(sys.io.File.getContent(TestArguments.log));
-		assertEquals(0, exitCode);
+		Assert.equals(0, exitCode);
 	}
 	}
 
 
 	function testCommandName() {
 	function testCommandName() {
@@ -66,7 +66,7 @@ class TestCommandBase extends haxe.unit.TestCase {
 						sys.io.File.copy(ExitCode.getNative(), path);
 						sys.io.File.copy(ExitCode.getNative(), path);
 					case "Mac", "Linux", _:
 					case "Mac", "Linux", _:
 						var exitCode = run("cp", [ExitCode.getNative(), path]);
 						var exitCode = run("cp", [ExitCode.getNative(), path]);
-						assertEquals(0, exitCode);
+						Assert.equals(0, exitCode);
 				}
 				}
 
 
 				Sys.sleep(0.1);
 				Sys.sleep(0.1);
@@ -81,7 +81,7 @@ class TestCommandBase extends haxe.unit.TestCase {
 				}
 				}
 				if (exitCode != random)
 				if (exitCode != random)
 					trace(name);
 					trace(name);
-				assertEquals(random, exitCode);
+				Assert.equals(random, exitCode);
 				FileSystem.deleteFile(path);
 				FileSystem.deleteFile(path);
 			}
 			}
 		}
 		}
@@ -97,7 +97,7 @@ class TestCommandBase extends haxe.unit.TestCase {
 		for (code in codes) {
 		for (code in codes) {
 			var args = [Std.string(code)];
 			var args = [Std.string(code)];
 			var exitCode = run(ExitCode.getNative(), args);
 			var exitCode = run(ExitCode.getNative(), args);
-			assertEquals(code, exitCode);
+			Assert.equals(code, exitCode);
 		}
 		}
 
 
 		for (code in codes) {
 		for (code in codes) {
@@ -132,7 +132,7 @@ class TestCommandBase extends haxe.unit.TestCase {
 			if ((code != exitCode) && (runInfo != null)) {
 			if ((code != exitCode) && (runInfo != null)) {
 				trace(runInfo);
 				trace(runInfo);
 			}
 			}
-			assertEquals(code, exitCode);
+			Assert.equals(code, exitCode);
 		}
 		}
 	}
 	}
 
 
@@ -140,6 +140,6 @@ class TestCommandBase extends haxe.unit.TestCase {
 		var bin = sys.FileSystem.absolutePath(ExitCode.bin);
 		var bin = sys.FileSystem.absolutePath(ExitCode.bin);
 		var native = sys.FileSystem.absolutePath(ExitCode.getNative());
 		var native = sys.FileSystem.absolutePath(ExitCode.getNative());
 		var exitCode = run('$native 1 || $native 0');
 		var exitCode = run('$native 1 || $native 0');
-		assertEquals(0, exitCode);
+		Assert.equals(0, exitCode);
 	}
 	}
 }
 }

+ 25 - 22
tests/sys/src/TestFileSystem.hx

@@ -1,6 +1,7 @@
 import sys.FileSystem;
 import sys.FileSystem;
+import utest.Assert;
 
 
-class TestFileSystem extends haxe.unit.TestCase {
+class TestFileSystem {
 	/**
 	/**
 		Recursively remove a given directory.
 		Recursively remove a given directory.
 	*/
 	*/
@@ -24,53 +25,55 @@ class TestFileSystem extends haxe.unit.TestCase {
 		case _: ["", "/"];
 		case _: ["", "/"];
 	}
 	}
 
 
-	override public function setup() {
+	public function new() { }
+
+	public function setup() {
 		removeDir(dir);
 		removeDir(dir);
 		FileSystem.createDirectory(dir);
 		FileSystem.createDirectory(dir);
 	}
 	}
 
 
-	override public function tearDown() {
+	public function tearDown() {
 		removeDir(dir);
 		removeDir(dir);
 	}
 	}
 
 
 	function testReadDirectory():Void {
 	function testReadDirectory():Void {
 		for (tailingSlash in tailingSlashes) {
 		for (tailingSlash in tailingSlashes) {
-			assertEquals(0, FileSystem.readDirectory(dir).length);
+			Assert.equals(0, FileSystem.readDirectory(dir).length);
 			for (name in FileNames.names) {
 			for (name in FileNames.names) {
 				var path = dir + name + tailingSlash;
 				var path = dir + name + tailingSlash;
 				FileSystem.createDirectory(path);
 				FileSystem.createDirectory(path);
 				var files = FileSystem.readDirectory(path);
 				var files = FileSystem.readDirectory(path);
-				assertEquals(0, files.length);
+				Assert.equals(0, files.length);
 			}
 			}
 			var files = FileSystem.readDirectory(dir);
 			var files = FileSystem.readDirectory(dir);
 			for (name in FileNames.names) {
 			for (name in FileNames.names) {
-				assertTrue(files.indexOf(name) > -1);
+				Assert.isTrue(files.indexOf(name) > -1);
 			}
 			}
-			assertEquals(FileNames.names.length, files.length);
+			Assert.equals(FileNames.names.length, files.length);
 			for (name in FileNames.names) {
 			for (name in FileNames.names) {
 				FileSystem.deleteDirectory(dir + name);
 				FileSystem.deleteDirectory(dir + name);
 			}
 			}
 
 
 			//read current directory
 			//read current directory
-			assertTrue(FileSystem.readDirectory("." + tailingSlash).indexOf("compile.hxml") > -1);
+			Assert.isTrue(FileSystem.readDirectory("." + tailingSlash).indexOf("compile.hxml") > -1);
 			//read parent directory
 			//read parent directory
-			assertTrue(FileSystem.readDirectory(".." + tailingSlash).indexOf("sys") > -1);
+			Assert.isTrue(FileSystem.readDirectory(".." + tailingSlash).indexOf("sys") > -1);
 			//read directory with complex path
 			//read directory with complex path
-			assertTrue(FileSystem.readDirectory("../sys/./.." + tailingSlash).indexOf("sys") > -1);
+			Assert.isTrue(FileSystem.readDirectory("../sys/./.." + tailingSlash).indexOf("sys") > -1);
 		}
 		}
 	}
 	}
 
 
 	function testCreateDirectory():Void {
 	function testCreateDirectory():Void {
 		for (tailingSlash in tailingSlashes) {
 		for (tailingSlash in tailingSlashes) {
-			assertEquals(0, FileSystem.readDirectory(dir).length);
+			Assert.equals(0, FileSystem.readDirectory(dir).length);
 			for (name in FileNames.names) {
 			for (name in FileNames.names) {
 				FileSystem.createDirectory(dir + name + tailingSlash);
 				FileSystem.createDirectory(dir + name + tailingSlash);
 			}
 			}
 			var files = FileSystem.readDirectory(dir);
 			var files = FileSystem.readDirectory(dir);
 			for (name in FileNames.names) {
 			for (name in FileNames.names) {
-				assertTrue(files.indexOf(name) > -1);
+				Assert.isTrue(files.indexOf(name) > -1);
 			}
 			}
-			assertEquals(FileNames.names.length, files.length);
+			Assert.equals(FileNames.names.length, files.length);
 			for (name in FileNames.names) {
 			for (name in FileNames.names) {
 				FileSystem.deleteDirectory(dir + name);
 				FileSystem.deleteDirectory(dir + name);
 			}
 			}
@@ -78,12 +81,12 @@ class TestFileSystem extends haxe.unit.TestCase {
 			//create deep directory
 			//create deep directory
 			var path = dir + "1/2/3" + tailingSlash;
 			var path = dir + "1/2/3" + tailingSlash;
 			FileSystem.createDirectory(path);
 			FileSystem.createDirectory(path);
-			assertTrue(FileSystem.isDirectory(path));
+			Assert.isTrue(FileSystem.isDirectory(path));
 
 
 			//create directory in complex path
 			//create directory in complex path
 			var path = dir + "1/../1/./../complex" + tailingSlash;
 			var path = dir + "1/../1/./../complex" + tailingSlash;
 			FileSystem.createDirectory(path);
 			FileSystem.createDirectory(path);
-			assertTrue(FileSystem.readDirectory(dir).indexOf("complex") > -1);
+			Assert.isTrue(FileSystem.readDirectory(dir).indexOf("complex") > -1);
 
 
 			FileSystem.deleteDirectory(dir + "1/2/3");
 			FileSystem.deleteDirectory(dir + "1/2/3");
 			FileSystem.deleteDirectory(dir + "1/2");
 			FileSystem.deleteDirectory(dir + "1/2");
@@ -94,7 +97,7 @@ class TestFileSystem extends haxe.unit.TestCase {
 
 
 	function testWindowsSpecialCases() {
 	function testWindowsSpecialCases() {
 		if (Sys.systemName() != "Windows" #if python || true #end) {
 		if (Sys.systemName() != "Windows" #if python || true #end) {
-			assertTrue(true);
+			Assert.isTrue(true);
 			return;
 			return;
 		}
 		}
 		var withSlash = "C:/";
 		var withSlash = "C:/";
@@ -102,22 +105,22 @@ class TestFileSystem extends haxe.unit.TestCase {
 		var without = "C:";
 		var without = "C:";
 
 
 		for (path in [withSlash, withBackslash, without]) {
 		for (path in [withSlash, withBackslash, without]) {
-			assertTrue(FileSystem.exists(path));
-			assertTrue(FileSystem.isDirectory(path));
-			assertTrue(FileSystem.stat(path) != null);
-			assertTrue(FileSystem.readDirectory(path) != null);
+			Assert.isTrue(FileSystem.exists(path));
+			Assert.isTrue(FileSystem.isDirectory(path));
+			Assert.isTrue(FileSystem.stat(path) != null);
+			Assert.isTrue(FileSystem.readDirectory(path) != null);
 		}
 		}
 	}
 	}
 
 
 	function testStatDirectory() {
 	function testStatDirectory() {
 		var stat = FileSystem.stat(dir);
 		var stat = FileSystem.stat(dir);
-		assertTrue(stat != null);
+		Assert.isTrue(stat != null);
 	}
 	}
 
 
 	function testCreateExistingDirectory() {
 	function testCreateExistingDirectory() {
 		var testDir = dir + "exists";
 		var testDir = dir + "exists";
 		FileSystem.createDirectory(testDir);
 		FileSystem.createDirectory(testDir);
 		FileSystem.createDirectory(testDir); // shouldn't throw
 		FileSystem.createDirectory(testDir); // shouldn't throw
-		assertTrue(FileSystem.isDirectory(testDir));
+		Assert.isTrue(FileSystem.isDirectory(testDir));
 	}
 	}
 }
 }

+ 17 - 15
tests/sys/src/TestSys.hx

@@ -1,3 +1,5 @@
+import utest.Assert;
+
 class TestSys extends TestCommandBase {
 class TestSys extends TestCommandBase {
 	override function run(cmd:String, ?args:Array<String>):Int {
 	override function run(cmd:String, ?args:Array<String>):Int {
 		return Sys.command(cmd, args);
 		return Sys.command(cmd, args);
@@ -6,43 +8,43 @@ class TestSys extends TestCommandBase {
 	function testEnv() {
 	function testEnv() {
 		#if !(java || php || lua)
 		#if !(java || php || lua)
 		Sys.putEnv("foo", "value");
 		Sys.putEnv("foo", "value");
-		assertEquals("value", Sys.getEnv("foo"));
+		Assert.equals("value", Sys.getEnv("foo"));
 		#end
 		#end
-		assertEquals(null, Sys.getEnv("doesn't exist"));
+		Assert.equals(null, Sys.getEnv("doesn't exist"));
 
 
 		#if !(java || php || lua)
 		#if !(java || php || lua)
 		var env = Sys.environment();
 		var env = Sys.environment();
-		assertEquals("value", env.get("foo"));
+		Assert.equals("value", env.get("foo"));
 		#end
 		#end
 	}
 	}
 
 
 	function testProgramPath() {
 	function testProgramPath() {
 		var p = Sys.programPath();
 		var p = Sys.programPath();
 
 
-		assertTrue(haxe.io.Path.isAbsolute(p));
-		assertTrue(sys.FileSystem.exists(p));
+		Assert.isTrue(haxe.io.Path.isAbsolute(p));
+		Assert.isTrue(sys.FileSystem.exists(p));
 
 
 		#if interp
 		#if interp
-			assertTrue(StringTools.endsWith(p, "Main.hx"));
+			Assert.isTrue(StringTools.endsWith(p, "Main.hx"));
 		#elseif neko
 		#elseif neko
-			assertTrue(StringTools.endsWith(p, "sys.n"));
+			Assert.isTrue(StringTools.endsWith(p, "sys.n"));
 		#elseif cpp
 		#elseif cpp
 			switch (Sys.systemName()) {
 			switch (Sys.systemName()) {
 				case "Windows":
 				case "Windows":
-					assertTrue(StringTools.endsWith(p, "Main-debug.exe"));
+					Assert.isTrue(StringTools.endsWith(p, "Main-debug.exe"));
 				case _:
 				case _:
-					assertTrue(StringTools.endsWith(p, "Main-debug"));
+					Assert.isTrue(StringTools.endsWith(p, "Main-debug"));
 			}
 			}
 		#elseif cs
 		#elseif cs
-			assertTrue(StringTools.endsWith(p, "Main-Debug.exe"));
+			Assert.isTrue(StringTools.endsWith(p, "Main-Debug.exe"));
 		#elseif java
 		#elseif java
-			assertTrue(StringTools.endsWith(p, "Main-Debug.jar"));
+			Assert.isTrue(StringTools.endsWith(p, "Main-Debug.jar"));
 		#elseif python
 		#elseif python
-			assertTrue(StringTools.endsWith(p, "sys.py"));
+			Assert.isTrue(StringTools.endsWith(p, "sys.py"));
 		#elseif php
 		#elseif php
-			assertTrue(StringTools.endsWith(p, "index.php"));
+			Assert.isTrue(StringTools.endsWith(p, "index.php"));
 		#elseif lua
 		#elseif lua
-			assertTrue(StringTools.endsWith(p, "sys.lua"));
+			Assert.isTrue(StringTools.endsWith(p, "sys.lua"));
 		#end
 		#end
 	}
 	}
 
 
@@ -54,7 +56,7 @@ class TestSys extends TestCommandBase {
 		function normalize(path) {
 		function normalize(path) {
 			return haxe.io.Path.addTrailingSlash(haxe.io.Path.normalize(path));
 			return haxe.io.Path.addTrailingSlash(haxe.io.Path.normalize(path));
 		}
 		}
-		assertEquals(normalize(newCwd), normalize(Sys.getCwd()));
+		Assert.equals(normalize(newCwd), normalize(Sys.getCwd()));
 		Sys.setCwd(cur);
 		Sys.setCwd(cur);
 	}
 	}
 	#end
 	#end

+ 6 - 3
tests/sys/src/io/TestFile.hx

@@ -1,18 +1,21 @@
 package io;
 package io;
 
 
+import utest.Assert;
 import sys.io.File;
 import sys.io.File;
 import sys.FileSystem;
 import sys.FileSystem;
 
 
-class TestFile extends haxe.unit.TestCase {
+class TestFile {
+	public function new() { }
+
 	public function testCopyOverwrite() {
 	public function testCopyOverwrite() {
 		var fileA = "temp/a.txt";
 		var fileA = "temp/a.txt";
 		var fileB = "temp/b.txt";
 		var fileB = "temp/b.txt";
 		File.saveContent(fileA, "a");
 		File.saveContent(fileA, "a");
 		File.saveContent(fileB, "b");
 		File.saveContent(fileB, "b");
 
 
-		assertEquals("b", File.getContent(fileB));
+		Assert.equals("b", File.getContent(fileB));
 		File.copy(fileA, fileB);
 		File.copy(fileA, fileB);
-		assertEquals("a", File.getContent(fileB));
+		Assert.equals("a", File.getContent(fileB));
 
 
 		// cleanup
 		// cleanup
 		FileSystem.deleteFile(fileA);
 		FileSystem.deleteFile(fileA);

+ 101 - 98
tests/sys/src/io/TestFileInput.hx

@@ -1,5 +1,6 @@
 package io;
 package io;
 
 
+import utest.Assert;
 import haxe.io.Bytes;
 import haxe.io.Bytes;
 import sys.io.FileInput;
 import sys.io.FileInput;
 import sys.FileSystem;
 import sys.FileSystem;
@@ -11,29 +12,31 @@ import sys.io.FileSeek;
  *
  *
  * @author        Maximilian Ruta <[email protected]>
  * @author        Maximilian Ruta <[email protected]>
  */
  */
-class TestFileInput extends haxe.unit.TestCase {
+class TestFileInput {
 
 
 	private var path = 'temp/testcase-test-file.txt';
 	private var path = 'temp/testcase-test-file.txt';
 
 
-	override public function setup() {
+	public function new() { }
+
+	public function setup() {
 		File.saveContent(path, "test\n1234");
 		File.saveContent(path, "test\n1234");
 	}
 	}
 
 
-	override public function tearDown() {
+	public function tearDown() {
 		FileSystem.deleteFile(path);
 		FileSystem.deleteFile(path);
 	}
 	}
 
 
 	public function testRead() {
 	public function testRead() {
 		var file : FileInput = File.read(path);
 		var file : FileInput = File.read(path);
-		assertEquals(0, file.tell());
-		assertEquals(116, file.readByte());
-		assertEquals(1, file.tell());
-		assertEquals(101, file.readByte());
-		assertEquals(2, file.tell());
-		assertEquals(115, file.readByte());
-		assertEquals(3, file.tell());
-		assertEquals(116, file.readByte());
-		assertEquals(4, file.tell());
+		Assert.equals(0, file.tell());
+		Assert.equals(116, file.readByte());
+		Assert.equals(1, file.tell());
+		Assert.equals(101, file.readByte());
+		Assert.equals(2, file.tell());
+		Assert.equals(115, file.readByte());
+		Assert.equals(3, file.tell());
+		Assert.equals(116, file.readByte());
+		Assert.equals(4, file.tell());
 		file.close();
 		file.close();
 	}
 	}
 
 
@@ -41,180 +44,180 @@ class TestFileInput extends haxe.unit.TestCase {
 		var file : FileInput = File.read(path);
 		var file : FileInput = File.read(path);
 		var bytes : Bytes = Bytes.alloc (9);
 		var bytes : Bytes = Bytes.alloc (9);
 		var count = file.readBytes(bytes, 0, 9);
 		var count = file.readBytes(bytes, 0, 9);
-		assertEquals(9, count);
-		assertEquals(116, bytes.get(0));
+		Assert.equals(9, count);
+		Assert.equals(116, bytes.get(0));
 		file.close();
 		file.close();
 	}
 	}
 
 
 	public function testSeekBeginCur() {
 	public function testSeekBeginCur() {
 		var file : FileInput = File.read(path);
 		var file : FileInput = File.read(path);
-		assertEquals(116, file.readByte());
-		assertEquals(101, file.readByte());
-		assertEquals(115, file.readByte());
-		assertEquals(116, file.readByte());
+		Assert.equals(116, file.readByte());
+		Assert.equals(101, file.readByte());
+		Assert.equals(115, file.readByte());
+		Assert.equals(116, file.readByte());
 
 
 		file.seek(-4, FileSeek.SeekCur);
 		file.seek(-4, FileSeek.SeekCur);
-		assertEquals(0, file.tell());
-		assertEquals(116, file.readByte());
-		assertEquals(1, file.tell());
+		Assert.equals(0, file.tell());
+		Assert.equals(116, file.readByte());
+		Assert.equals(1, file.tell());
 		file.close();
 		file.close();
 	}
 	}
 
 
 	public function testSeekBeginEnd() {
 	public function testSeekBeginEnd() {
 		var file : FileInput = File.read(path);
 		var file : FileInput = File.read(path);
-		assertEquals(116, file.readByte());
-		assertEquals(101, file.readByte());
-		assertEquals(115, file.readByte());
-		assertEquals(116, file.readByte());
+		Assert.equals(116, file.readByte());
+		Assert.equals(101, file.readByte());
+		Assert.equals(115, file.readByte());
+		Assert.equals(116, file.readByte());
 
 
 		file.seek(-9, FileSeek.SeekEnd);
 		file.seek(-9, FileSeek.SeekEnd);
-		assertEquals(0, file.tell());
-		assertEquals(116, file.readByte());
-		assertEquals(1, file.tell());
+		Assert.equals(0, file.tell());
+		Assert.equals(116, file.readByte());
+		Assert.equals(1, file.tell());
 		file.close();
 		file.close();
 	}
 	}
 
 
 	public function testSeekBegin() {
 	public function testSeekBegin() {
 		var file : FileInput = File.read(path);
 		var file : FileInput = File.read(path);
-		assertEquals(116, file.readByte());
-		assertEquals(101, file.readByte());
-		assertEquals(115, file.readByte());
-		assertEquals(116, file.readByte());
+		Assert.equals(116, file.readByte());
+		Assert.equals(101, file.readByte());
+		Assert.equals(115, file.readByte());
+		Assert.equals(116, file.readByte());
 
 
 		file.seek(0, FileSeek.SeekBegin);
 		file.seek(0, FileSeek.SeekBegin);
-		assertEquals(0, file.tell());
-		assertEquals(116, file.readByte());
-		assertEquals(1, file.tell());
+		Assert.equals(0, file.tell());
+		Assert.equals(116, file.readByte());
+		Assert.equals(1, file.tell());
 		file.close();
 		file.close();
 	}
 	}
 
 
 	public function testSeekPosBegin() {
 	public function testSeekPosBegin() {
 		var file : FileInput = File.read(path);
 		var file : FileInput = File.read(path);
-		assertEquals(116, file.readByte());
-		assertEquals(101, file.readByte());
-		assertEquals(115, file.readByte());
-		assertEquals(116, file.readByte());
+		Assert.equals(116, file.readByte());
+		Assert.equals(101, file.readByte());
+		Assert.equals(115, file.readByte());
+		Assert.equals(116, file.readByte());
 
 
 		file.seek(1, FileSeek.SeekBegin);
 		file.seek(1, FileSeek.SeekBegin);
-		assertEquals(1, file.tell());
-		assertEquals(101, file.readByte());
-		assertEquals(2, file.tell());
+		Assert.equals(1, file.tell());
+		Assert.equals(101, file.readByte());
+		Assert.equals(2, file.tell());
 		file.close();
 		file.close();
 	}
 	}
 
 
 	public function testSeekPosBeginMulti() {
 	public function testSeekPosBeginMulti() {
 		var file : FileInput = File.read(path);
 		var file : FileInput = File.read(path);
-		assertEquals(116, file.readByte());
-		assertEquals(101, file.readByte());
-		assertEquals(115, file.readByte());
-		assertEquals(116, file.readByte());
+		Assert.equals(116, file.readByte());
+		Assert.equals(101, file.readByte());
+		Assert.equals(115, file.readByte());
+		Assert.equals(116, file.readByte());
 
 
 		file.seek(1, FileSeek.SeekBegin);
 		file.seek(1, FileSeek.SeekBegin);
-		assertEquals(1, file.tell());
-		assertEquals(101, file.readByte());
-		assertEquals(2, file.tell());
+		Assert.equals(1, file.tell());
+		Assert.equals(101, file.readByte());
+		Assert.equals(2, file.tell());
 		file.seek(3, FileSeek.SeekBegin);
 		file.seek(3, FileSeek.SeekBegin);
-		assertEquals(3, file.tell());
-		assertEquals(116, file.readByte());
-		assertEquals(4, file.tell());
+		Assert.equals(3, file.tell());
+		Assert.equals(116, file.readByte());
+		Assert.equals(4, file.tell());
 		file.close();
 		file.close();
 	}
 	}
 
 
 	public function testSeekEnd() {
 	public function testSeekEnd() {
 		var file : FileInput = File.read(path);
 		var file : FileInput = File.read(path);
-		assertEquals(116, file.readByte());
-		assertEquals(101, file.readByte());
-		assertEquals(115, file.readByte());
-		assertEquals(116, file.readByte());
+		Assert.equals(116, file.readByte());
+		Assert.equals(101, file.readByte());
+		Assert.equals(115, file.readByte());
+		Assert.equals(116, file.readByte());
 
 
 		file.seek(-1, FileSeek.SeekEnd);
 		file.seek(-1, FileSeek.SeekEnd);
-		assertEquals(8, file.tell());
-		assertEquals(52, file.readByte());
-		assertEquals(9, file.tell());
+		Assert.equals(8, file.tell());
+		Assert.equals(52, file.readByte());
+		Assert.equals(9, file.tell());
 		file.close();
 		file.close();
 	}
 	}
 
 
 	public function testSeekEofLast() {
 	public function testSeekEofLast() {
 		var file : FileInput = File.read(path);
 		var file : FileInput = File.read(path);
-		assertEquals(116, file.readByte());
-		assertEquals(101, file.readByte());
-		assertEquals(115, file.readByte());
-		assertEquals(116, file.readByte());
+		Assert.equals(116, file.readByte());
+		Assert.equals(101, file.readByte());
+		Assert.equals(115, file.readByte());
+		Assert.equals(116, file.readByte());
 
 
 		file.seek(0, FileSeek.SeekEnd);
 		file.seek(0, FileSeek.SeekEnd);
-		assertEquals(9, file.tell());
-		assertFalse(file.eof());
+		Assert.equals(9, file.tell());
+		Assert.isFalse(file.eof());
 		try {
 		try {
 			file.readByte();
 			file.readByte();
-			assertTrue(false);
+			Assert.isTrue(false);
 		} catch(e : haxe.io.Eof) {
 		} catch(e : haxe.io.Eof) {
-			assertTrue(true);
+			Assert.isTrue(true);
 		}
 		}
-		assertTrue(file.eof());
+		Assert.isTrue(file.eof());
 		file.close();
 		file.close();
 	}
 	}
 
 
 	public function testSeekEof() {
 	public function testSeekEof() {
 		var file : FileInput = File.read(path);
 		var file : FileInput = File.read(path);
-		assertEquals(116, file.readByte());
-		assertEquals(101, file.readByte());
-		assertEquals(115, file.readByte());
-		assertEquals(116, file.readByte());
+		Assert.equals(116, file.readByte());
+		Assert.equals(101, file.readByte());
+		Assert.equals(115, file.readByte());
+		Assert.equals(116, file.readByte());
 
 
 		file.seek(0, FileSeek.SeekEnd);
 		file.seek(0, FileSeek.SeekEnd);
-		assertEquals(9, file.tell());
-		assertFalse(file.eof());
+		Assert.equals(9, file.tell());
+		Assert.isFalse(file.eof());
 		try {
 		try {
 			file.readByte();
 			file.readByte();
-			assertTrue(false);
+			Assert.isTrue(false);
 		} catch(e : haxe.io.Eof) {
 		} catch(e : haxe.io.Eof) {
-			assertTrue(true);
+			Assert.isTrue(true);
 		}
 		}
-		assertTrue(file.eof());
-		assertEquals(9, file.tell());
+		Assert.isTrue(file.eof());
+		Assert.equals(9, file.tell());
 		file.seek(-1, FileSeek.SeekCur);
 		file.seek(-1, FileSeek.SeekCur);
-		assertEquals(8, file.tell());
-		assertEquals(52, file.readByte());
-		assertEquals(9, file.tell());
-		assertFalse(file.eof());
+		Assert.equals(8, file.tell());
+		Assert.equals(52, file.readByte());
+		Assert.equals(9, file.tell());
+		Assert.isFalse(file.eof());
 		try {
 		try {
 			file.readByte();
 			file.readByte();
-			assertTrue(false);
+			Assert.isTrue(false);
 		} catch(e : haxe.io.Eof) {
 		} catch(e : haxe.io.Eof) {
-			assertTrue(true);
+			Assert.isTrue(true);
 		}
 		}
-		assertTrue(file.eof());
-		assertEquals(9, file.tell());
+		Assert.isTrue(file.eof());
+		Assert.equals(9, file.tell());
 		try {
 		try {
 			file.readByte();
 			file.readByte();
-			assertTrue(false);
+			Assert.isTrue(false);
 		} catch(e : haxe.io.Eof) {
 		} catch(e : haxe.io.Eof) {
-			assertTrue(true);
+			Assert.isTrue(true);
 		}
 		}
 
 
 		file.seek(5, FileSeek.SeekEnd);
 		file.seek(5, FileSeek.SeekEnd);
-		assertFalse(file.eof());
+		Assert.isFalse(file.eof());
 		try {
 		try {
 			file.readByte();
 			file.readByte();
-			assertTrue(false);
+			Assert.isTrue(false);
 		} catch(e : haxe.io.Eof) {
 		} catch(e : haxe.io.Eof) {
-			assertTrue(true);
+			Assert.isTrue(true);
 		}
 		}
-		assertTrue(file.eof());
+		Assert.isTrue(file.eof());
 		file.seek(1, FileSeek.SeekEnd);
 		file.seek(1, FileSeek.SeekEnd);
-		assertFalse(file.eof());
+		Assert.isFalse(file.eof());
 		try {
 		try {
 			file.readByte();
 			file.readByte();
-			assertTrue(false);
+			Assert.isTrue(false);
 		} catch(e : haxe.io.Eof) {
 		} catch(e : haxe.io.Eof) {
-			assertTrue(true);
+			Assert.isTrue(true);
 		}
 		}
-		assertTrue(file.eof());
+		Assert.isTrue(file.eof());
 		try {
 		try {
 			file.readByte();
 			file.readByte();
-			assertTrue(false);
+			Assert.isTrue(false);
 		} catch(e : haxe.io.Eof) {
 		} catch(e : haxe.io.Eof) {
-			assertTrue(true);
+			Assert.isTrue(true);
 		}
 		}
 		file.close();
 		file.close();
 	}
 	}