2
0
Эх сурвалжийг харах

report some name conflicts in the unit tester

Simon Krajewski 12 жил өмнө
parent
commit
9a84b4d65d

+ 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;
 			}