Xnhyacinth's picture
Upload HarnessMix codegen train and held-out eval data
01a492e verified
Raw
History Blame Contribute Delete
3.49 kB
import subprocess
import sys
from pathlib import Path
cases = [{'input': '1\n', 'output': '1\n1 '}, {'input': '4\n', 'output': '4\n1 1 1 1 '}, {'input': '27\n', 'output': '27\n1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 '}, {'input': '239\n', 'output': '239\n1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 '}, {'input': '191\n', 'output': '191\n1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1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 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 '}, {'input': '2\n', 'output': '2\n1 1 '}, {'input': '3\n', 'output': '3\n1 1 1 '}, {'input': '5\n', 'output': '5\n1 1 1 1 1 '}, {'input': '6\n', 'output': '6\n1 1 1 1 1 1 '}, {'input': '7\n', 'output': '7\n1 1 1 1 1 1 1 '}, {'input': '8\n', 'output': '8\n1 1 1 1 1 1 1 1 '}, {'input': '9\n', 'output': '9\n1 1 1 1 1 1 1 1 1 '}, {'input': '10\n', 'output': '10\n1 1 1 1 1 1 1 1 1 1 '}, {'input': '11\n', 'output': '11\n1 1 1 1 1 1 1 1 1 1 1 '}, {'input': '12\n', 'output': '12\n1 1 1 1 1 1 1 1 1 1 1 1 '}, {'input': '13\n', 'output': '13\n1 1 1 1 1 1 1 1 1 1 1 1 1 '}]
solution = Path(__file__).with_name("solution.py")
for index, case in enumerate(cases):
proc = subprocess.run(
[sys.executable, str(solution)],
input=case["input"],
text=True,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
timeout=10,
)
if proc.returncode != 0:
raise AssertionError(f"case {index} exited {proc.returncode}: {proc.stderr}")
got = proc.stdout.strip()
expected = case["output"].strip()
if got.split() != expected.split():
raise AssertionError(
f"case {index} output mismatch\nexpected={expected!r}\ngot={got!r}\nstderr={proc.stderr}"
)
print('deepcoder_primeintellect_io')