Last change
on this file was 2595, checked in by bird, 13 years ago |
gnu grep version 2.12 (grep-2.12.tar.xz, md5sum=8d2f0346d08b13c18afb81f0e8aa1e2f)
|
File size:
1.2 KB
|
Line | |
---|
1 | #! /bin/sh
|
---|
2 | # Test for backreferences and other things.
|
---|
3 | #
|
---|
4 | # Copyright (C) 2001, 2006, 2009-2012 Free Software Foundation, Inc.
|
---|
5 | #
|
---|
6 | # Copying and distribution of this file, with or without modification,
|
---|
7 | # are permitted in any medium without royalty provided the copyright
|
---|
8 | # notice and this notice are preserved.
|
---|
9 |
|
---|
10 | . "${srcdir=.}/init.sh"; path_prepend_ ../src
|
---|
11 |
|
---|
12 | failures=0
|
---|
13 |
|
---|
14 | # checking for a palindrome
|
---|
15 | echo "radar" | grep -e '\(.\)\(.\).\2\1' > /dev/null 2>&1
|
---|
16 | if test $? -ne 0 ; then
|
---|
17 | echo "Backref: palindrome, test #1 failed"
|
---|
18 | failures=1
|
---|
19 | fi
|
---|
20 |
|
---|
21 | # hit hard with the `Bond' tests
|
---|
22 | # For now, remove the `?' in the last parentheses, so that new glibc can do it. --Stepan
|
---|
23 | echo "civic" | grep -E -e '^(.?)(.?)(.?)(.?)(.?)(.?)(.?)(.?)(.).?\9\8\7\6\5\4\3\2\1$' > /dev/null 2>&1
|
---|
24 | if test $? -ne 0 ; then
|
---|
25 | echo "Options: Bond, test #2 failed"
|
---|
26 | failures=1
|
---|
27 | fi
|
---|
28 |
|
---|
29 | # backref are local should be error
|
---|
30 | echo "123" | grep -e 'a\(.\)' -e 'b\1' > /dev/null 2>&1
|
---|
31 | if test $? -ne 2 ; then
|
---|
32 | echo "Backref: Backref not local, test #3 failed"
|
---|
33 | failures=1
|
---|
34 | fi
|
---|
35 |
|
---|
36 | # Pattern should fail
|
---|
37 | echo "123" | grep -e '[' -e ']' > /dev/null 2>&1
|
---|
38 | if test $? -ne 2 ; then
|
---|
39 | echo "Backref: Compiled not local, test #4 failed"
|
---|
40 | failures=1
|
---|
41 | fi
|
---|
42 |
|
---|
43 | Exit $failures
|
---|
Note:
See
TracBrowser
for help on using the repository browser.