소스 검색

report some name conflicts in the unit tester

Simon Krajewski 12 년 전
부모
커밋
9a84b4d65d
1개의 변경된 파일5개의 추가작업 그리고 0개의 파일을 삭제
  1. 5 0
      tests/unit/UnitBuilder.hx

+ 5 - 0
tests/unit/UnitBuilder.hx

@@ -143,6 +143,11 @@ class UnitBuilder {
 					for (e in el)
 						el2.push(macro $e1 == $e);
 					collapseToOrExpr(el2);
+				case EVars(vl):
+					for (v in vl)
+						if (v.name == "t" || v.name == "f" || v.name == "eq" || v.name == "neq")
+							Context.error('${v.name} is reserved for unit testing', e.pos);
+						e;
 				case _:
 					e;
 			}