Skip to content

Commit d8f03a5

Browse files
committed
fix(tests): fix testing script bug and formatting
1 parent 3834433 commit d8f03a5

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

claptests/run_tests.py

+8-8
Original file line numberDiff line numberDiff line change
@@ -11,24 +11,24 @@
1111
'flag short: ': ['{} -f'.format(_bin), ['flag present 1 times',
1212
'option NOT present',
1313
'positional NOT present',
14-
'subcmd NOT present']],
14+
'subcmd NOT present']],
1515
'flags short: ': ['{} -ff'.format(_bin), ['flag present 2 times',
1616
'option NOT present',
1717
'positional NOT present',
18-
'subcmd NOT present']],
18+
'subcmd NOT present']],
1919
'flags short: ': ['{} -f -f'.format(_bin), ['flag present 2 times',
2020
'option NOT present',
2121
'positional NOT present',
22-
'subcmd NOT present']],
22+
'subcmd NOT present']],
2323
'flag long: ': ['{} --flag'.format(_bin), ['flag present 1 times',
2424
'option NOT present',
2525
'positional NOT present',
2626
'subcmd NOT present']],
27-
'flags long: ': ['{} --flag --flag'.format(_bin), ['flag present 2 times',
27+
'flags long: ': ['{} --flag --flag'.format(_bin), ['flag present 2 times',
2828
'option NOT present',
2929
'positional NOT present',
3030
'subcmd NOT present']],
31-
'flags both: ': ['{} -f --flag'.format(_bin), ['flag present 2 times',
31+
'flags both: ': ['{} -f --flag'.format(_bin), ['flag present 2 times',
3232
'option NOT present',
3333
'positional NOT present',
3434
'subcmd NOT present']],
@@ -68,7 +68,7 @@
6868
'An option: other',
6969
'positional NOT present',
7070
'subcmd NOT present']],
71-
'options 3:': ['{} --option=some --option=other -o opt'.format(_bin), ['flag NOT present',
71+
'options 3: ': ['{} --option=some --option=other -o opt'.format(_bin), ['flag NOT present',
7272
'option present 3 times with value: some',
7373
'An option: some',
7474
'An option: other',
@@ -89,16 +89,16 @@ def pass_fail(name, check, good):
8989
print('Pass')
9090
return
9191
failed = True
92-
print('Fail')
92+
print('Fail\n\tShould be: {}\n\tBut is: {}'.format(good, check))
9393
return
9494
_failed = False
9595
for i, line in enumerate(check):
9696
if line == good[i]:
9797
continue
9898
_failed = True
99+
print('Fail\n\tShould be: {}\n\tBut is: {}'.format(good[i], line))
99100
if _failed:
100101
failed = True
101-
print('Fail')
102102
return
103103
print('Pass')
104104

0 commit comments

Comments
 (0)