Skip to content

Commit

Permalink
Merge pull request #540 from fukatani/issue/438/float
Browse files Browse the repository at this point in the history
#538: Add float compare test.
  • Loading branch information
kmyk authored Oct 1, 2019
2 parents e24028c + 87c6734 commit 567e89c
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 567e89c

Please sign in to comment.