Ignore:
Timestamp:
Feb 25, 2011, 9:26:54 PM (13 years ago)
Author:
Bruno Cornec
Message:
  • Update mindi-busybox to 1.18.3 to avoid problems with the tar command which is now failing on recent versions with busybox 1.7.3
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.2.9/mindi-busybox/testsuite/grep.tests

    r1765 r2725  
    11#!/bin/sh
    22
    3 # grep tests.
    43# Copyright 2005 by Rob Landley <rob@landley.net>
    5 # Licensed under GPL v2, see file LICENSE for details.
     4# Licensed under GPLv2, see file LICENSE in this source tree.
    65
    76# AUDIT:
    87
    9 . testing.sh
     8. ./testing.sh
    109
    1110# testing "test name" "options" "expected result" "file input" "stdin"
     
    2827    "one\ntwo\nthree\nthree\nthree\n" ""
    2928
    30 testing "grep (no newline at EOL)" "grep bug" "bug" "bug" ""
     29# GNU grep 2.5.3 outputs a new line character after the located string
     30# even if there is no new line character in the input
     31testing "grep (no newline at EOL)" "grep bug input" "bug\n" "bug" ""
    3132
    32 # Note that this assumes actual is empty.
    33 testing "grep input actual (two files)" "grep two input actual 2> /dev/null" \
     33>empty
     34testing "grep two files" "grep two input empty 2>/dev/null" \
    3435    "input:two\n" "one\ntwo\nthree\nthree\nthree\n" ""
     36rm empty
    3537
    3638testing "grep - infile (specify stdin and file)" "grep two - input" \
     
    6163    "(standard input):domatch\n2\n" "" "nomatch\ndomatch\nend\n"
    6264
    63 # This doesn't match GNU behaviour (Binary file input matches)
    64 # acts like GNU grep -a
    65 testing "grep handles binary files" "grep foo input" "foo\n" "\0foo\n\n" ""
    66 # This doesn't match GNU behaviour (Binary file (standard input) matches)
    67 # acts like GNU grep -a
    68 testing "grep handles binary stdin" "grep foo" "foo\n" "" "\0foo\n\n"
     65optional EXTRA_COMPAT
     66testing "grep handles NUL in files" "grep -a foo input" "\0foo\n" "\0foo\n\n" ""
     67testing "grep handles NUL on stdin" "grep -a foo" "\0foo\n" "" "\0foo\n\n"
    6968
    7069testing "grep matches NUL" "grep . input > /dev/null 2>&1 ; echo \$?" \
    7170    "0\n" "\0\n" ""
     71SKIP=
    7272
    7373# -e regex
    7474testing "grep handles multiple regexps" "grep -e one -e two input ; echo \$?" \
    7575    "one\ntwo\n0\n" "one\ntwo\n" ""
     76testing "grep -F handles multiple expessions" "grep -F -e one -e two input ; echo \$?" \
     77    "one\ntwo\n0\n" "one\ntwo\n" ""
     78testing "grep -F handles -i" "grep -F -i foo input ; echo \$?" \
     79    "FOO\n0\n" "FOO\n" ""
     80
     81# -f file/-
     82testing "grep can read regexps from stdin" "grep -f - input ; echo \$?" \
     83    "two\nthree\n0\n" "tw\ntwo\nthree\n" "tw.\nthr\n"
    7684
    7785optional FEATURE_GREP_EGREP_ALIAS
     
    8189testing "egrep is not case insensitive" \
    8290    "egrep foo ; [ \$? -ne 0 ] && echo yes" "yes\n" "" "FOO\n"
     91testing "grep -E -o prints all matches" \
     92    "grep -E -o '([[:xdigit:]]{2}[:-]){5}[[:xdigit:]]{2}'" \
     93    "00:19:3E:00:AA:5E\n00:1D:60:3D:3A:FB\n00:22:43:49:FB:AA\n" \
     94    "" "00:19:3E:00:AA:5E 00:1D:60:3D:3A:FB 00:22:43:49:FB:AA\n"
     95SKIP=
     96
     97testing "grep -o does not loop forever" \
     98    'grep -o "[^/]*$"' \
     99    "test\n" \
     100    "" "/var/test\n"
     101testing "grep -o does not loop forever on zero-length match" \
     102    'grep -o "" | head -n1' \
     103    "" \
     104    "" "test\n"
    83105
    84106exit $FAILCOUNT
Note: See TracChangeset for help on using the changeset viewer.