diff options
Diffstat (limited to 'test/tests')
| -rw-r--r-- | test/tests/TestServer.hx | 6 | ||||
| -rw-r--r-- | test/tests/TestTimer.hx | 8 |
2 files changed, 13 insertions, 1 deletions
diff --git a/test/tests/TestServer.hx b/test/tests/TestServer.hx index e5cee58..83031f1 100644 --- a/test/tests/TestServer.hx +++ b/test/tests/TestServer.hx @@ -12,6 +12,8 @@ import utest.Assert; import utest.Async; import utest.Test; +using StringTools; + @:access(server) class TestServer extends Test { @:timeout(500) @@ -29,7 +31,9 @@ class TestServer extends Test { Assert.equals("File %D0%AB%%D1%8B%00%D1%8B! not found.", data); }); request('$url/video/skins/default.php?dir_inc=/etc/passwd%00', data -> { - Assert.equals("File video/skins/default.php?dir_inc=/etc/passwd not found.", data); + var line = "File video/skins/default.php?dir_inc=/etc/passwd not found."; + if (Sys.systemName() == "Windows") line = line.replace("/", "\\"); + Assert.equals(line, data); }); request('$url/%20', data -> { Assert.equals("File not found.", data); diff --git a/test/tests/TestTimer.hx b/test/tests/TestTimer.hx index 337da3e..8a22cc9 100644 --- a/test/tests/TestTimer.hx +++ b/test/tests/TestTimer.hx @@ -165,6 +165,14 @@ class TestTimer extends Test { } function almostEq(a:Float, b:Float, ?p:PosInfos):Void { + if (isMacCI()) { + Assert.isTrue(Math.abs(a - b) < 0.5); + return; + } Assert.equals(Math.round(a * 10) / 10, Math.round(b * 10) / 10, p); } + + function isMacCI():Bool { + return Sys.systemName() == "Mac" && Sys.environment()["CI"] == "true"; + } } |
