Browse Source

Test for issue 4579 (StringMap toString)

haxiomic 10 years ago
parent
commit
88efad6c3b
1 changed files with 20 additions and 0 deletions
  1. 20 0
      tests/unit/src/unit/issues/Issue4579.hx

+ 20 - 0
tests/unit/src/unit/issues/Issue4579.hx

@@ -0,0 +1,20 @@
+package unit.issues;
+
+class Issue4579 extends Test {
+	#if js
+	function test() {
+		var stringMap1:Map<String, Dynamic> = [
+	        'string-key-1'=> 42
+	    ];
+
+		var stringMap2:Map<String, Dynamic> = [
+            'string-key-1'=> 42,
+            'string-key-2'=> {a:1}
+        ];
+        
+        //count commas in toString()
+        eq(stringMap1.toString().split(',').length - 1, 0);
+        eq(stringMap2.toString().split(',').length - 1, 1);
+	}
+	#end
+}