Skip to content

Commit e0d9c67

Browse files
committed
Do not allow an unnumbered test case to be named 'test_group'
This is also mentioned in https://icpc.io/problem-package-format/spec/2023-07-draft.html#test-data
1 parent a1f5264 commit e0d9c67

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

bin/generate.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1678,7 +1678,13 @@ def parse(key: str, name_gen: Callable[[], str], yaml: dict, parent: AnyDirector
16781678

16791679
if is_testcase(yaml):
16801680
if isinstance(parent, RootDirectory):
1681-
raise ParseException("Testcase must be inside Directory", name)
1681+
raise ParseException("Test case must be inside a Directory.", name)
1682+
1683+
if not parent.numbered and key == "test_group":
1684+
raise ParseException(
1685+
"Test case must not be named 'test_group', this clashes with the group-level 'test_group.yaml'.",
1686+
parent.path / name,
1687+
)
16821688

16831689
count = parse_count(yaml, parent.path / name)
16841690

0 commit comments

Comments
 (0)