Skip to content

Commit cfb15ae

Browse files
LLiuZhengzjwu0522
andauthored
🐛 fix: tailing slash issue for find_legacy_name
Co-authored-by: Zijian Wu <50308536+zjwu0522@users.noreply.github.com>
1 parent aa73e5b commit cfb15ae

1 file changed

Lines changed: 10 additions & 7 deletions

File tree

  • tasks/github/missing-semester/find_legacy_name

tasks/github/missing-semester/find_legacy_name/verify.py

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,11 @@ def verify() -> bool:
5353
Programmatically verify that the legacy name finding task was completed correctly.
5454
Checks for ANSWER.md file in master branch with the correct content.
5555
"""
56-
# Expected answer content
57-
EXPECTED_CONTENT = "[Hacker Tools](https://hacker-tools.github.io)"
56+
# Expected answer content (accept both with and without trailing slash)
57+
EXPECTED_CONTENTS = {
58+
"[Hacker Tools](https://hacker-tools.github.io)",
59+
"[Hacker Tools](https://hacker-tools.github.io/)",
60+
}
5861

5962
# Load environment variables from .mcp_env
6063
load_dotenv(".mcp_env")
@@ -93,9 +96,9 @@ def verify() -> bool:
9396
print("2. Verifying ANSWER.md content...")
9497
answer_content = answer_content.strip()
9598

96-
if answer_content != EXPECTED_CONTENT:
97-
print(f"Error: ANSWER.md content does not match expected answer", file=sys.stderr)
98-
print(f"Expected: {EXPECTED_CONTENT}", file=sys.stderr)
99+
if answer_content not in EXPECTED_CONTENTS:
100+
print(f"Error: ANSWER.md content does not match expected answer(s)", file=sys.stderr)
101+
print(f"Expected one of: {sorted(EXPECTED_CONTENTS)}", file=sys.stderr)
99102
print(f"Found: {answer_content}", file=sys.stderr)
100103
return False
101104

@@ -104,11 +107,11 @@ def verify() -> bool:
104107
print("\n✅ All verification checks passed!")
105108
print("Legacy name finding task completed successfully:")
106109
print(f" - ANSWER.md created in master branch")
107-
print(f" - Content: {EXPECTED_CONTENT}")
110+
print(f" - Content accepted: {answer_content}")
108111

109112
return True
110113

111114

112115
if __name__ == "__main__":
113116
success = verify()
114-
sys.exit(0 if success else 1)
117+
sys.exit(0 if success else 1)

0 commit comments

Comments
 (0)