소스 검색

add test (closes #2856)

Simon Krajewski 11 년 전
부모
커밋
ceb60ee71e
1개의 변경된 파일23개의 추가작업 그리고 0개의 파일을 삭제
  1. 23 0
      tests/unit/issues/Issue2856.hx

+ 23 - 0
tests/unit/issues/Issue2856.hx

@@ -0,0 +1,23 @@
+package unit.issues;
+
+class Issue2856 extends Test {
+	#if python
+	function test() {
+		function x (args:python.KwArgs) {
+			var dict = args.toDict();
+			var acc = [];
+			for (key in dict.keys()) {
+				acc.push(key + "=" +dict.get(key, null));
+			}
+			return acc.join(";");
+		}
+
+		var a = python.Lib.anonToDict({ "a" : 1, "b" : 2});
+		var res = x( a );
+		eq("a=1;b=2", res);
+
+		var res = x( python.Lib.anonToDict({ "a" : 1, "b" : 2}) );
+		eq("a=1;b=2", res);
+	}
+	#end
+}