From 55ed2c0d5cc0d7c8785004484f2f9c33547a86cf Mon Sep 17 00:00:00 2001 From: Andy Li Date: Sat, 1 Oct 2016 15:14:58 +0800 Subject: [PATCH] Avoid using Array#sort in test. There is some problem with the php target. Let's workaround it for now. --- Test.hx | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Test.hx b/Test.hx index b443d06..de82e9a 100644 --- a/Test.hx +++ b/Test.hx @@ -124,15 +124,16 @@ class Test extends TestCase { assertEquals('A', vars.objMap[key]); } } - - #if (!php || (haxe_ver >= 3.3)) + assertScript(' var keys = []; for (key in stringMap.keys()) keys.push(key); - keys.sort(function(s1, s2) return s1 > s2 ? 1 : (s2 > s1 ? -1 : 0)); keys.join("_"); - ', 'a_bar_foo', vars); - #end + ', { + var keys = []; + for (key in vars.stringMap.keys()) keys.push(key); + keys.join("_"); + }, vars); assertScript('stringMap.remove("foo"); stringMap.exists("foo");', false, vars); assertScript('stringMap["foo"] = "a"; stringMap["foo"] += "b"', 'ab', vars); assertEquals('ab', vars.stringMap['foo']);