diff options
| author | Jan Sucan <jan@jansucan.com> | 2022-06-18 08:50:45 +0200 |
|---|---|---|
| committer | Jan Sucan <jan@jansucan.com> | 2022-06-18 08:50:54 +0200 |
| commit | 948a65cf39c8ce31c5adc0f24979e0cb55bc33c3 (patch) | |
| tree | ae923f4594fef0abb777f63291d62530c345b229 /tests/300-incorrect_reference_file.sh | |
| parent | e1d10bea5d9fc94ba800ade1de430c7f3c0ccacd (diff) | |
Refactor the command line interface
Select operation by its name instead of by number of the arguments.
Diffstat (limited to 'tests/300-incorrect_reference_file.sh')
| -rw-r--r-- | tests/300-incorrect_reference_file.sh | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/tests/300-incorrect_reference_file.sh b/tests/300-incorrect_reference_file.sh index b3de8c0..5e03c72 100644 --- a/tests/300-incorrect_reference_file.sh +++ b/tests/300-incorrect_reference_file.sh @@ -6,11 +6,11 @@ PROGRAM_EXEC="$1" rm -f ref out touch ref out -assert_error "reference file is empty" $PROGRAM_EXEC ref out +assert "" "input file is empty" 1 $PROGRAM_EXEC restore ref out dd if=/dev/zero of=ref bs=513 count=1 1>/dev/null 2>&1 -assert_error "reference file has size that cannot contain valid diff data" \ - $PROGRAM_EXEC -s 512 ref out +assert "" "input file has size that cannot contain valid diff data" \ + 1 $PROGRAM_EXEC restore -s 512 ref out rm -f ref out dd if=/dev/zero of=out bs=512 count=2 1>/dev/null 2>&1 @@ -20,8 +20,8 @@ dd if=/dev/zero of=ref bs=$(( 512 + 8 )) count=2 1>/dev/null 2>&1 printf '\x02' | dd of=ref bs=1 count=1 seek=0 conv=notrunc 1>/dev/null 2>&1 # The second offset will be 1 printf '\x01' | dd of=ref bs=1 count=1 seek=520 conv=notrunc 1>/dev/null 2>&1 -assert_error "a sector offset points behind the previous offset" \ - $PROGRAM_EXEC -s 512 ref out +assert "" "a sector offset points behind the previous offset" \ + 1 $PROGRAM_EXEC restore -s 512 ref out rm -f ref out dd if=/dev/zero of=out bs=512 count=1 1>/dev/null 2>&1 @@ -29,8 +29,8 @@ dd if=/dev/zero of=out bs=512 count=1 1>/dev/null 2>&1 dd if=/dev/zero of=ref bs=$(( 512 + 8 )) count=2 1>/dev/null 2>&1 # The first offset will be 1 printf '\x01' | dd of=ref bs=1 count=1 seek=0 conv=notrunc 1>/dev/null 2>&1 -assert_error "a sector offset points past the end of the output file" \ - $PROGRAM_EXEC -s 512 ref out +assert "" "a sector offset points past the end of the output file" \ + 1 $PROGRAM_EXEC restore -s 512 ref out rm -f ref out |
