Blame tests/backref

Packit 709fb3
#! /bin/sh
Packit 709fb3
# Test for backreferences and other things.
Packit 709fb3
#
Packit 709fb3
# Copyright (C) 2001, 2006, 2009-2017 Free Software Foundation, Inc.
Packit 709fb3
#
Packit 709fb3
# Copying and distribution of this file, with or without modification,
Packit 709fb3
# are permitted in any medium without royalty provided the copyright
Packit 709fb3
# notice and this notice are preserved.
Packit 709fb3
Packit 709fb3
. "${srcdir=.}/init.sh"; path_prepend_ ../src
Packit 709fb3
Packit 709fb3
failures=0
Packit 709fb3
Packit 709fb3
# checking for a palindrome
Packit 709fb3
echo "radar" | grep -e '\(.\)\(.\).\2\1' > /dev/null 2>&1
Packit 709fb3
if test $? -ne 0 ; then
Packit 709fb3
        echo "Backref: palindrome, test #1 failed"
Packit 709fb3
        failures=1
Packit 709fb3
fi
Packit 709fb3
Packit 709fb3
# hit hard with the 'Bond' tests
Packit 709fb3
# For now, remove the '?' in the last parentheses, so that new glibc can do it.
Packit 709fb3
# --Stepan
Packit 709fb3
echo "civic" \
Packit 709fb3
  | grep -E -e '^(.?)(.?)(.?)(.?)(.?)(.?)(.?)(.?)(.).?\9\8\7\6\5\4\3\2\1$' \
Packit 709fb3
         > /dev/null 2>&1
Packit 709fb3
if test $? -ne 0 ; then
Packit 709fb3
        echo "Options: Bond, test #2 failed"
Packit 709fb3
        failures=1
Packit 709fb3
fi
Packit 709fb3
Packit 709fb3
# backref are local should be error
Packit 709fb3
echo "123" | grep -e 'a\(.\)' -e 'b\1' > /dev/null 2>&1
Packit 709fb3
if test $? -ne 2 ; then
Packit 709fb3
        echo "Backref: Backref not local, test #3 failed"
Packit 709fb3
        failures=1
Packit 709fb3
fi
Packit 709fb3
Packit 709fb3
# Pattern should fail
Packit 709fb3
echo "123" | grep -e '[' -e ']' > /dev/null 2>&1
Packit 709fb3
if test $? -ne 2 ; then
Packit 709fb3
        echo "Backref: Compiled not local, test #4 failed"
Packit 709fb3
        failures=1
Packit 709fb3
fi
Packit 709fb3
Packit 709fb3
Exit $failures