Browse Source

report some name conflicts in the unit tester

Simon Krajewski 12 năm trước cách đây
mục cha
commit
9a84b4d65d
1 tập tin đã thay đổi với 5 bổ sung0 xóa
  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;
 			}