-
Notifications
You must be signed in to change notification settings - Fork 24
Open
Description
eoj3/polygon/package/adapter.py
Lines 117 to 133 in dbb66a0
| test_id = 0 | |
| tests, samples = [], [] | |
| for test_node in testset_node.find('tests').findall('test'): | |
| test_id += 1 | |
| with open(os.path.join(self.directory, input_pattern % test_id), 'rb') as test_input: | |
| # process CRLF | |
| input_text = test_input.read().replace(b"\r\n", b"\n") | |
| with open(os.path.join(self.directory, answer_pattern % test_id), 'rb') as test_answer: | |
| answer_text = test_answer.read().replace(b"\r\n", b"\n") | |
| hash_str = case_hash(self.problem.id, input_text, answer_text) | |
| input_path, answer_path = get_input_path(hash_str), get_output_path(hash_str) | |
| with open(input_path, "wb") as test_input, open(answer_path, "wb") as test_answer: | |
| test_input.write(input_text) | |
| test_answer.write(answer_text) | |
| if 'sample' in test_node.attrib and test_node.attrib["sample"] == "true": | |
| samples.append(hash_str) | |
| tests.append(hash_str) |
样例应该从 statements 里面来读取的样子(
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels