Magellan Linux

Diff of /trunk/mkinitrd-magellan/busybox/testsuite/sort.tests

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 983 by niro, Fri Apr 24 18:33:46 2009 UTC revision 984 by niro, Sun May 30 11:32:42 2010 UTC
# Line 1  Line 1 
1  #!/bin/bash  #!/bin/sh
2    
3  # SUSv3 compliant sort tests.  # SUSv3 compliant sort tests.
4  # Copyright 2005 by Rob Landley <rob@landley.net>  # Copyright 2005 by Rob Landley <rob@landley.net>
5  # Licensed under GPL v2, see file LICENSE for details.  # Licensed under GPL v2, see file LICENSE for details.
6    
7  . testing.sh  . ./testing.sh
8    
9  # The basic tests.  These should work even with the small busybox.  # The basic tests.  These should work even with the small busybox.
10    
# Line 27  egg 1 2 papyrus Line 27  egg 1 2 papyrus
27  999 3 0 algebra  999 3 0 algebra
28  "  "
29    
30    # testing "description" "command(s)" "result" "infile" "stdin"
31    
32  # Sorting with keys  # Sorting with keys
33    
34  testing "sort one key" "sort -k4,4 input" \  testing "sort one key" "sort -k4,4 input" \
# Line 45  egg 1 2 papyrus Line 47  egg 1 2 papyrus
47  999 3 0 algebra  999 3 0 algebra
48  " "$data" ""  " "$data" ""
49    
50  # Busybox is definitely doing this one wrong just now.  FIXME  test x"$SKIP_KNOWN_BUGS" = x"" && {
51    # Busybox is definitely doing these wrong.  FIXME
52  testing "sort key range with numeric option and global reverse" \  testing "sort key range with numeric option and global reverse" \
53  "sort -k2,3n -r input" \  "sort -k2,3n -r input" \
54  "egg 1 2 papyrus  "egg 1 2 papyrus
# Line 56  testing "sort key range with numeric opt Line 58  testing "sort key range with numeric opt
58  7 3 42 soup  7 3 42 soup
59  " "$data" ""  " "$data" ""
60    
 #  
   
61  testing "sort key range with multiple options" "sort -k2,3rn input" \  testing "sort key range with multiple options" "sort -k2,3rn input" \
62  "7 3 42 soup  "7 3 42 soup
63  999 3 0 algebra  999 3 0 algebra
# Line 65  testing "sort key range with multiple op Line 65  testing "sort key range with multiple op
65  42 1 3 woot  42 1 3 woot
66  egg 1 2 papyrus  egg 1 2 papyrus
67  " "$data" ""  " "$data" ""
68    }
69    
70  testing "sort key range with two -k options" "sort -k 2,2n -k 1,1r input" "\  testing "sort key range with two -k options" "sort -k 2,2n -k 1,1r input" "\
71  d 2  d 2
# Line 116  one\0two\0three\0\ Line 117  one\0two\0three\0\
117  testing "sort key doesn't strip leading blanks, disables fallback global sort" \  testing "sort key doesn't strip leading blanks, disables fallback global sort" \
118  "sort -n -k2 -t ' '" " a \n 1 \n 2 \n" "" " 2 \n 1 \n a \n"  "sort -n -k2 -t ' '" " a \n 1 \n 2 \n" "" " 2 \n 1 \n a \n"
119    
120    testing "sort file in place" \
121    "strace -oZZZ sort -o input input && cat input" "\
122    111
123    222
124    " "\
125    222
126    111
127    " ""
128    
129    # testing "description" "command(s)" "result" "infile" "stdin"
130    
131  exit $FAILCOUNT  exit $FAILCOUNT

Legend:
Removed from v.983  
changed lines
  Added in v.984