source: zzuf/trunk/test/check-zzuf-A-autoinc @ 4272

Last change on this file since 4272 was 4272, checked in by Sam Hocevar, 11 years ago

Rename check-flag-# tests to check-zzuf-#-#### with the option's long name,
to avoid problems with case-insensitive filesystems.

  • Property svn:executable set to *
File size: 1.2 KB
Line 
1#!/bin/sh
2#
3#  check-zzuf-A-autoinc - test "zzuf -A" flag (auto-increment)
4#  Copyright (c) 2008-2010 Sam Hocevar <sam@hocevar.net>
5#                All Rights Reserved
6#
7#  This program is free software. It comes without any warranty, to
8#  the extent permitted by applicable law. You can redistribute it
9#  and/or modify it under the terms of the Do What The Fuck You Want
10#  To Public License, Version 2, as published by Sam Hocevar. See
11#  http://sam.zoy.org/wtfpl/COPYING for more details.
12#
13
14. "$(dirname "$0")/functions.inc"
15
16start_test "zzuf -A test"
17
18# Check -A with no fuzzing: output must match
19new_test "zzuf -A -r0 zzcat file-random file-random"
20m1=$($ZZUF -m -r0 $ZZCAT "$DIR/file-random" "$DIR/file-random" | cut -f2 -d' ')
21m2=$($ZZUF -m -A -r0 $ZZCAT "$DIR/file-random" "$DIR/file-random" | cut -f2 -d' ')
22if [ "$m1" = "$m2" ]; then
23    pass_test "ok"
24else
25    fail_test "$m1 != $m2"
26fi
27
28# Check -A with fuzzing: output must be different
29new_test "zzuf -A -r0.1 zzcat file-random file-random"
30m1=$($ZZUF -m -r0.1 $ZZCAT "$DIR/file-random" "$DIR/file-random" | cut -f2 -d' ')
31m2=$($ZZUF -m -A -r0.1 $ZZCAT "$DIR/file-random" "$DIR/file-random" | cut -f2 -d' ')
32if [ "$m1" != "$m2" ]; then
33    pass_test "ok"
34else
35    fail_test "$m1 = $m2"
36fi
37
38stop_test
39
Note: See TracBrowser for help on using the repository browser.