Skip to content

Commit

Permalink
online-judge-tools#538: Add float compare test.
Browse files Browse the repository at this point in the history
  • Loading branch information
fukatani committed Oct 1, 2019
1 parent c53f1fc commit 87c6734
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions tests/command_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'],
Expand Down

0 comments on commit 87c6734

Please sign in to comment.