From 87c6734547221feef02fc43276218e2241aafa19 Mon Sep 17 00:00:00 2001 From: fukatani Date: Tue, 1 Oct 2019 23:15:02 +0900 Subject: [PATCH] #538: Add float compare test. --- tests/command_test.py | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/tests/command_test.py b/tests/command_test.py index db3eb9ba..6328f207 100644 --- a/tests/command_test.py +++ b/tests/command_test.py @@ -68,6 +68,48 @@ def test_call_test_simple(self): }], ) + def test_call_test_float(self): + self.snippet_call_test( + args=['-c', cat(), '-e', '0.1'], + files=[ + { + 'path': 'test/sample-1.in', + 'data': '1.0\n' + }, + { + 'path': 'test/sample-1.out', + 'data': '1.0001\n' + }, + { + 'path': 'test/sample-2.in', + 'data': '1.0\n' + }, + { + 'path': 'test/sample-2.out', + 'data': '1.2\n' + }, + ], + expected=[{ + 'status': 'AC', + 'testcase': { + 'name': 'sample-1', + 'input': '%s/test/sample-1.in', + 'output': '%s/test/sample-1.out', + }, + 'output': '1.0\n', + 'exitcode': 0, + }, { + 'status': 'WA', + 'testcase': { + 'name': 'sample-2', + 'input': '%s/test/sample-2.in', + 'output': '%s/test/sample-2.out', + }, + 'output': '1.0\n', + 'exitcode': 0, + }], + ) + def test_call_test_select(self): self.snippet_call_test( args=['-c', cat(), 'test/sample-2.in', 'test/sample-3.in', 'test/sample-3.out'],