瀏覽代碼

[cs] fixed test for #6871

Alexander Kuzmenko 7 年之前
父節點
當前提交
6ddecfe9a4
共有 1 個文件被更改,包括 6 次插入2 次删除
  1. 6 2
      tests/unit/src/unit/issues/Issue6871.hx

+ 6 - 2
tests/unit/src/unit/issues/Issue6871.hx

@@ -9,18 +9,22 @@ class Issue6871 extends unit.Test {
 	static function set_field(v:Int):Int throw SETTER_ERROR;
 
 	function test() {
+		inline function exception(e:Dynamic) {
+			return #if cs e.InnerException.Message #else e #end;
+		}
+
 		try {
 			Reflect.getProperty(Issue6871, 'field');
 			t(false);
 		} catch(e:Dynamic) {
-			eq(GETTER_ERROR, e);
+			eq(GETTER_ERROR, exception(e));
 		}
 
 		try {
 			Reflect.setProperty(Issue6871, 'field', 123);
 			t(false);
 		} catch(e:Dynamic) {
-			eq(SETTER_ERROR, e);
+			eq(SETTER_ERROR, exception(e));
 		}
 	}
 }