summaryrefslogtreecommitdiff
path: root/tests/agrep
diff options
context:
space:
mode:
Diffstat (limited to 'tests/agrep')
-rw-r--r--tests/agrep/Makefile441
-rw-r--r--tests/agrep/Makefile.am16
-rw-r--r--tests/agrep/Makefile.in441
-rw-r--r--tests/agrep/basic.args6
-rw-r--r--tests/agrep/basic.input8
-rw-r--r--tests/agrep/basic.ok496
-rw-r--r--tests/agrep/delimiters.args9
-rw-r--r--tests/agrep/delimiters.input5
-rw-r--r--tests/agrep/delimiters.ok528
-rw-r--r--tests/agrep/exitstatus.args10
-rw-r--r--tests/agrep/exitstatus.input3
-rw-r--r--tests/agrep/exitstatus.ok705
-rw-r--r--tests/agrep/records.args9
-rw-r--r--tests/agrep/records.input23
-rw-r--r--tests/agrep/records.ok812
-rwxr-xr-xtests/agrep/run-tests.sh96
16 files changed, 3608 insertions, 0 deletions
diff --git a/tests/agrep/Makefile b/tests/agrep/Makefile
new file mode 100644
index 000000000000..14553e6c2b9e
--- /dev/null
+++ b/tests/agrep/Makefile
@@ -0,0 +1,441 @@
+# Makefile.in generated by automake 1.10.1 from Makefile.am.
+# tests/agrep/Makefile. Generated from Makefile.in by configure.
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+
+
+pkgdatadir = $(datadir)/tre
+pkglibdir = $(libdir)/tre
+pkgincludedir = $(includedir)/tre
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = x86_64-unknown-freebsd8.0
+host_triplet = x86_64-unknown-freebsd8.0
+target_triplet = x86_64-unknown-freebsd8.0
+subdir = tests/agrep
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/ac_libtool_tags.m4 \
+ $(top_srcdir)/m4/ax_check_funcs_comp.m4 \
+ $(top_srcdir)/m4/ax_check_sign.m4 \
+ $(top_srcdir)/m4/ax_decl_wchar_max.m4 \
+ $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/iconv.m4 \
+ $(top_srcdir)/m4/intlmacosx.m4 $(top_srcdir)/m4/lib-ld.m4 \
+ $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \
+ $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.m4 \
+ $(top_srcdir)/m4/progtest.m4 \
+ $(top_srcdir)/m4/vl_prog_cc_warnings.m4 \
+ $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(SHELL) $(top_srcdir)/utils/mkinstalldirs
+CONFIG_HEADER = $(top_builddir)/config.h \
+ $(top_builddir)/lib/tre-config.h
+CONFIG_CLEAN_FILES =
+SOURCES =
+DIST_SOURCES =
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = ${SHELL} /home/gabor/wrk/tre/tre-0.8.0/utils/missing --run aclocal-1.10
+ALLOCA =
+AMTAR = ${SHELL} /home/gabor/wrk/tre/tre-0.8.0/utils/missing --run tar
+AR = ar
+AS = as
+AUTOCONF = ${SHELL} /home/gabor/wrk/tre/tre-0.8.0/utils/missing --run autoconf
+AUTOHEADER = ${SHELL} /home/gabor/wrk/tre/tre-0.8.0/utils/missing --run autoheader
+AUTOMAKE = ${SHELL} /home/gabor/wrk/tre/tre-0.8.0/utils/missing --run automake-1.10
+AWK = nawk
+CC = gcc
+CCDEPMODE = depmode=gcc3
+CFLAGS = -g -O2 -Wall
+CPP = gcc -E
+CPPFLAGS =
+CYGPATH_W = echo
+DEFS = -DHAVE_CONFIG_H
+DEPDIR = .deps
+DLLTOOL = dlltool
+DSYMUTIL =
+ECHO = echo
+ECHO_C =
+ECHO_N = -n
+ECHO_T =
+EGREP = /usr/bin/grep -E
+EXEEXT =
+GETTEXT_MACRO_VERSION = 0.17
+GMSGFMT = /usr/local/bin/msgfmt
+GMSGFMT_015 = /usr/local/bin/msgfmt
+GREP = /usr/bin/grep
+INSTALL = /usr/bin/install -c
+INSTALL_DATA = ${INSTALL} -m 644
+INSTALL_PROGRAM = ${INSTALL}
+INSTALL_SCRIPT = ${INSTALL}
+INSTALL_STRIP_PROGRAM = $(install_sh) -c -s
+INTLLIBS =
+INTL_MACOSX_LIBS =
+LDFLAGS =
+LIBICONV = /usr/local/lib/libiconv.so -Wl,-rpath -Wl,/usr/local/lib
+LIBINTL =
+LIBOBJS =
+LIBS =
+LIBTOOL = $(SHELL) $(top_builddir)/libtool
+LN_S = ln -s
+LTLIBICONV = -L/usr/local/lib -liconv -R/usr/local/lib
+LTLIBINTL =
+LTLIBOBJS =
+MAKEINFO = ${SHELL} /home/gabor/wrk/tre/tre-0.8.0/utils/missing --run makeinfo
+MKDIR_P = ../../utils/install-sh -c -d
+MSGFMT = /usr/local/bin/msgfmt
+MSGFMT_015 = /usr/local/bin/msgfmt
+MSGMERGE = /usr/local/bin/msgmerge
+NMEDIT =
+OBJDUMP = objdump
+OBJEXT = o
+PACKAGE = tre
+PACKAGE_BUGREPORT = tre-general@lists.laurikari.net
+PACKAGE_NAME = TRE
+PACKAGE_STRING = TRE 0.8.0
+PACKAGE_TARNAME = tre
+PACKAGE_VERSION = 0.8.0
+PATH_SEPARATOR = :
+POSUB =
+RANLIB = ranlib
+SED = /usr/local/bin/gsed
+SET_MAKE =
+SHELL = /bin/sh
+STRIP = strip
+TRE_VERSION = 0.8.0
+USE_NLS = no
+VERSION = 0.8.0
+XGETTEXT = /usr/local/bin/xgettext
+XGETTEXT_015 = /usr/local/bin/xgettext
+XGETTEXT_EXTRA_OPTIONS =
+abs_builddir = /home/gabor/wrk/tre/tre-0.8.0/tests/agrep
+abs_srcdir = /home/gabor/wrk/tre/tre-0.8.0/tests/agrep
+abs_top_builddir = /home/gabor/wrk/tre/tre-0.8.0
+abs_top_srcdir = /home/gabor/wrk/tre/tre-0.8.0
+ac_ct_CC = gcc
+am__include = include
+am__leading_dot = .
+am__quote =
+am__tar = ${AMTAR} chof - "$$tardir"
+am__untar = ${AMTAR} xf -
+bindir = ${exec_prefix}/bin
+build = x86_64-unknown-freebsd8.0
+build_alias =
+build_cpu = x86_64
+build_os = freebsd8.0
+build_vendor = unknown
+builddir = .
+datadir = ${datarootdir}
+datarootdir = ${prefix}/share
+docdir = ${datarootdir}/doc/${PACKAGE_TARNAME}
+dvidir = ${docdir}
+exec_prefix = ${prefix}
+host = x86_64-unknown-freebsd8.0
+host_alias =
+host_cpu = x86_64
+host_os = freebsd8.0
+host_vendor = unknown
+htmldir = ${docdir}
+includedir = ${prefix}/include
+infodir = ${datarootdir}/info
+install_sh = $(SHELL) /home/gabor/wrk/tre/tre-0.8.0/utils/install-sh
+libdir = ${exec_prefix}/lib
+libexecdir = ${exec_prefix}/libexec
+localedir = ${datarootdir}/locale
+localstatedir = ${prefix}/var
+mandir = ${datarootdir}/man
+mkdir_p = $(top_builddir)/utils/install-sh -c -d
+oldincludedir = /usr/include
+pdfdir = ${docdir}
+prefix = /usr/local
+program_transform_name = s,x,x,
+psdir = ${docdir}
+sbindir = ${exec_prefix}/sbin
+sharedstatedir = ${prefix}/com
+srcdir = .
+sysconfdir = ${prefix}/etc
+target = x86_64-unknown-freebsd8.0
+target_alias =
+target_cpu = x86_64
+target_os = freebsd8.0
+target_vendor = unknown
+top_builddir = ../..
+top_srcdir = ../..
+TESTS = run-tests.sh
+TESTS_ENVIRONMENT = \
+ top_builddir=$(top_builddir) \
+ host_triplet=$(host_triplet)
+
+EXTRA_DIST = run-tests.sh
+CLEANFILES = *.out
+all: all-am
+
+.SUFFIXES:
+$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+ && exit 0; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign tests/agrep/Makefile'; \
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --foreign tests/agrep/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+tags: TAGS
+TAGS:
+
+ctags: CTAGS
+CTAGS:
+
+
+check-TESTS: $(TESTS)
+ @failed=0; all=0; xfail=0; xpass=0; skip=0; ws='[ ]'; \
+ srcdir=$(srcdir); export srcdir; \
+ list=' $(TESTS) '; \
+ if test -n "$$list"; then \
+ for tst in $$list; do \
+ if test -f ./$$tst; then dir=./; \
+ elif test -f $$tst; then dir=; \
+ else dir="$(srcdir)/"; fi; \
+ if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \
+ all=`expr $$all + 1`; \
+ case " $(XFAIL_TESTS) " in \
+ *$$ws$$tst$$ws*) \
+ xpass=`expr $$xpass + 1`; \
+ failed=`expr $$failed + 1`; \
+ echo "XPASS: $$tst"; \
+ ;; \
+ *) \
+ echo "PASS: $$tst"; \
+ ;; \
+ esac; \
+ elif test $$? -ne 77; then \
+ all=`expr $$all + 1`; \
+ case " $(XFAIL_TESTS) " in \
+ *$$ws$$tst$$ws*) \
+ xfail=`expr $$xfail + 1`; \
+ echo "XFAIL: $$tst"; \
+ ;; \
+ *) \
+ failed=`expr $$failed + 1`; \
+ echo "FAIL: $$tst"; \
+ ;; \
+ esac; \
+ else \
+ skip=`expr $$skip + 1`; \
+ echo "SKIP: $$tst"; \
+ fi; \
+ done; \
+ if test "$$failed" -eq 0; then \
+ if test "$$xfail" -eq 0; then \
+ banner="All $$all tests passed"; \
+ else \
+ banner="All $$all tests behaved as expected ($$xfail expected failures)"; \
+ fi; \
+ else \
+ if test "$$xpass" -eq 0; then \
+ banner="$$failed of $$all tests failed"; \
+ else \
+ banner="$$failed of $$all tests did not behave as expected ($$xpass unexpected passes)"; \
+ fi; \
+ fi; \
+ dashes="$$banner"; \
+ skipped=""; \
+ if test "$$skip" -ne 0; then \
+ skipped="($$skip tests were not run)"; \
+ test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \
+ dashes="$$skipped"; \
+ fi; \
+ report=""; \
+ if test "$$failed" -ne 0 && test -n "$(PACKAGE_BUGREPORT)"; then \
+ report="Please report to $(PACKAGE_BUGREPORT)"; \
+ test `echo "$$report" | wc -c` -le `echo "$$banner" | wc -c` || \
+ dashes="$$report"; \
+ fi; \
+ dashes=`echo "$$dashes" | sed s/./=/g`; \
+ echo "$$dashes"; \
+ echo "$$banner"; \
+ test -z "$$skipped" || echo "$$skipped"; \
+ test -z "$$report" || echo "$$report"; \
+ echo "$$dashes"; \
+ test "$$failed" -eq 0; \
+ else :; fi
+
+distdir: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ if test -d $$d/$$file; then \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+ fi; \
+ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+ else \
+ test -f $(distdir)/$$file \
+ || cp -p $$d/$$file $(distdir)/$$file \
+ || exit 1; \
+ fi; \
+ done
+ $(MAKE) $(AM_MAKEFLAGS) \
+ top_distdir="$(top_distdir)" distdir="$(distdir)" \
+ dist-hook
+check-am: all-am
+ $(MAKE) $(AM_MAKEFLAGS) check-TESTS
+check: check-am
+all-am: Makefile
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+ -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-am
+ -rm -f Makefile
+distclean-am: clean-am distclean-generic
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-exec-am:
+
+install-html: install-html-am
+
+install-info: install-info-am
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-ps: install-ps-am
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am:
+
+.MAKE: install-am install-strip
+
+.PHONY: all all-am check check-TESTS check-am clean clean-generic \
+ clean-libtool dist-hook distclean distclean-generic \
+ distclean-libtool distdir dvi dvi-am html html-am info info-am \
+ install install-am install-data install-data-am install-dvi \
+ install-dvi-am install-exec install-exec-am install-html \
+ install-html-am install-info install-info-am install-man \
+ install-pdf install-pdf-am install-ps install-ps-am \
+ install-strip installcheck installcheck-am installdirs \
+ maintainer-clean maintainer-clean-generic mostlyclean \
+ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+ uninstall uninstall-am
+
+
+dist-hook:
+ cp -p $(srcdir)/*.args $(srcdir)/*.ok $(srcdir)/*.input $(distdir)
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/tests/agrep/Makefile.am b/tests/agrep/Makefile.am
new file mode 100644
index 000000000000..44c547c643ea
--- /dev/null
+++ b/tests/agrep/Makefile.am
@@ -0,0 +1,16 @@
+
+if !TRE_DEBUG
+if TRE_AGREP
+TESTS = run-tests.sh
+endif TRE_AGREP
+endif !TRE_DEBUG
+
+TESTS_ENVIRONMENT = \
+ top_builddir=$(top_builddir) \
+ host_triplet=$(host_triplet)
+EXTRA_DIST = run-tests.sh
+
+dist-hook:
+ cp -p $(srcdir)/*.args $(srcdir)/*.ok $(srcdir)/*.input $(distdir)
+
+CLEANFILES = *.out
diff --git a/tests/agrep/Makefile.in b/tests/agrep/Makefile.in
new file mode 100644
index 000000000000..2a2d2befd506
--- /dev/null
+++ b/tests/agrep/Makefile.in
@@ -0,0 +1,441 @@
+# Makefile.in generated by automake 1.10.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = tests/agrep
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/ac_libtool_tags.m4 \
+ $(top_srcdir)/m4/ax_check_funcs_comp.m4 \
+ $(top_srcdir)/m4/ax_check_sign.m4 \
+ $(top_srcdir)/m4/ax_decl_wchar_max.m4 \
+ $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/iconv.m4 \
+ $(top_srcdir)/m4/intlmacosx.m4 $(top_srcdir)/m4/lib-ld.m4 \
+ $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \
+ $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.m4 \
+ $(top_srcdir)/m4/progtest.m4 \
+ $(top_srcdir)/m4/vl_prog_cc_warnings.m4 \
+ $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(SHELL) $(top_srcdir)/utils/mkinstalldirs
+CONFIG_HEADER = $(top_builddir)/config.h \
+ $(top_builddir)/lib/tre-config.h
+CONFIG_CLEAN_FILES =
+SOURCES =
+DIST_SOURCES =
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+ALLOCA = @ALLOCA@
+AMTAR = @AMTAR@
+AR = @AR@
+AS = @AS@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
+GMSGFMT = @GMSGFMT@
+GMSGFMT_015 = @GMSGFMT_015@
+GREP = @GREP@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+INTLLIBS = @INTLLIBS@
+INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
+LDFLAGS = @LDFLAGS@
+LIBICONV = @LIBICONV@
+LIBINTL = @LIBINTL@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBICONV = @LTLIBICONV@
+LTLIBINTL = @LTLIBINTL@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MKDIR_P = @MKDIR_P@
+MSGFMT = @MSGFMT@
+MSGFMT_015 = @MSGFMT_015@
+MSGMERGE = @MSGMERGE@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+POSUB = @POSUB@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+TRE_VERSION = @TRE_VERSION@
+USE_NLS = @USE_NLS@
+VERSION = @VERSION@
+XGETTEXT = @XGETTEXT@
+XGETTEXT_015 = @XGETTEXT_015@
+XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_CC = @ac_ct_CC@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+@TRE_AGREP_TRUE@@TRE_DEBUG_FALSE@TESTS = run-tests.sh
+TESTS_ENVIRONMENT = \
+ top_builddir=$(top_builddir) \
+ host_triplet=$(host_triplet)
+
+EXTRA_DIST = run-tests.sh
+CLEANFILES = *.out
+all: all-am
+
+.SUFFIXES:
+$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+ && exit 0; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign tests/agrep/Makefile'; \
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --foreign tests/agrep/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+tags: TAGS
+TAGS:
+
+ctags: CTAGS
+CTAGS:
+
+
+check-TESTS: $(TESTS)
+ @failed=0; all=0; xfail=0; xpass=0; skip=0; ws='[ ]'; \
+ srcdir=$(srcdir); export srcdir; \
+ list=' $(TESTS) '; \
+ if test -n "$$list"; then \
+ for tst in $$list; do \
+ if test -f ./$$tst; then dir=./; \
+ elif test -f $$tst; then dir=; \
+ else dir="$(srcdir)/"; fi; \
+ if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \
+ all=`expr $$all + 1`; \
+ case " $(XFAIL_TESTS) " in \
+ *$$ws$$tst$$ws*) \
+ xpass=`expr $$xpass + 1`; \
+ failed=`expr $$failed + 1`; \
+ echo "XPASS: $$tst"; \
+ ;; \
+ *) \
+ echo "PASS: $$tst"; \
+ ;; \
+ esac; \
+ elif test $$? -ne 77; then \
+ all=`expr $$all + 1`; \
+ case " $(XFAIL_TESTS) " in \
+ *$$ws$$tst$$ws*) \
+ xfail=`expr $$xfail + 1`; \
+ echo "XFAIL: $$tst"; \
+ ;; \
+ *) \
+ failed=`expr $$failed + 1`; \
+ echo "FAIL: $$tst"; \
+ ;; \
+ esac; \
+ else \
+ skip=`expr $$skip + 1`; \
+ echo "SKIP: $$tst"; \
+ fi; \
+ done; \
+ if test "$$failed" -eq 0; then \
+ if test "$$xfail" -eq 0; then \
+ banner="All $$all tests passed"; \
+ else \
+ banner="All $$all tests behaved as expected ($$xfail expected failures)"; \
+ fi; \
+ else \
+ if test "$$xpass" -eq 0; then \
+ banner="$$failed of $$all tests failed"; \
+ else \
+ banner="$$failed of $$all tests did not behave as expected ($$xpass unexpected passes)"; \
+ fi; \
+ fi; \
+ dashes="$$banner"; \
+ skipped=""; \
+ if test "$$skip" -ne 0; then \
+ skipped="($$skip tests were not run)"; \
+ test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \
+ dashes="$$skipped"; \
+ fi; \
+ report=""; \
+ if test "$$failed" -ne 0 && test -n "$(PACKAGE_BUGREPORT)"; then \
+ report="Please report to $(PACKAGE_BUGREPORT)"; \
+ test `echo "$$report" | wc -c` -le `echo "$$banner" | wc -c` || \
+ dashes="$$report"; \
+ fi; \
+ dashes=`echo "$$dashes" | sed s/./=/g`; \
+ echo "$$dashes"; \
+ echo "$$banner"; \
+ test -z "$$skipped" || echo "$$skipped"; \
+ test -z "$$report" || echo "$$report"; \
+ echo "$$dashes"; \
+ test "$$failed" -eq 0; \
+ else :; fi
+
+distdir: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ if test -d $$d/$$file; then \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+ fi; \
+ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+ else \
+ test -f $(distdir)/$$file \
+ || cp -p $$d/$$file $(distdir)/$$file \
+ || exit 1; \
+ fi; \
+ done
+ $(MAKE) $(AM_MAKEFLAGS) \
+ top_distdir="$(top_distdir)" distdir="$(distdir)" \
+ dist-hook
+check-am: all-am
+ $(MAKE) $(AM_MAKEFLAGS) check-TESTS
+check: check-am
+all-am: Makefile
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+ -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-am
+ -rm -f Makefile
+distclean-am: clean-am distclean-generic
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-exec-am:
+
+install-html: install-html-am
+
+install-info: install-info-am
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-ps: install-ps-am
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am:
+
+.MAKE: install-am install-strip
+
+.PHONY: all all-am check check-TESTS check-am clean clean-generic \
+ clean-libtool dist-hook distclean distclean-generic \
+ distclean-libtool distdir dvi dvi-am html html-am info info-am \
+ install install-am install-data install-data-am install-dvi \
+ install-dvi-am install-exec install-exec-am install-html \
+ install-html-am install-info install-info-am install-man \
+ install-pdf install-pdf-am install-ps install-ps-am \
+ install-strip installcheck installcheck-am installdirs \
+ maintainer-clean maintainer-clean-generic mostlyclean \
+ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+ uninstall uninstall-am
+
+
+dist-hook:
+ cp -p $(srcdir)/*.args $(srcdir)/*.ok $(srcdir)/*.input $(distdir)
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/tests/agrep/basic.args b/tests/agrep/basic.args
new file mode 100644
index 000000000000..97d5ab90f918
--- /dev/null
+++ b/tests/agrep/basic.args
@@ -0,0 +1,6 @@
+# Very basic tests with simple string searches.
+random
+-v random
+-i extra
+-e -ding
+-w micro
diff --git a/tests/agrep/basic.input b/tests/agrep/basic.input
new file mode 100644
index 000000000000..54893594570f
--- /dev/null
+++ b/tests/agrep/basic.input
@@ -0,0 +1,8 @@
+Some random text here.
+Foo bar quux.
+Let's hear an example of correct microphone placing.
+I suppose for something like that one would use a very large number of microphones.
+Extraordinary.
+Take California.
+A-ding-ing-ng-WROOOOM-ding-ding-boing!
+They are micro, mega, mini, mono, and multi.
diff --git a/tests/agrep/basic.ok b/tests/agrep/basic.ok
new file mode 100644
index 000000000000..58a7fd2c4454
--- /dev/null
+++ b/tests/agrep/basic.ok
@@ -0,0 +1,496 @@
+#### TEST: agrep random basic.in
+Some random text here.
+
+Exit status 0.
+#### TEST: agrep random < basic.in
+Some random text here.
+
+Exit status 0.
+#### TEST: agrep -c random basic.in
+1
+
+Exit status 0.
+#### TEST: agrep -c random < basic.in
+1
+
+Exit status 0.
+#### TEST: agrep -H random basic.in
+basic.in:Some random text here.
+
+Exit status 0.
+#### TEST: agrep -H random < basic.in
+(standard input):Some random text here.
+
+Exit status 0.
+#### TEST: agrep -l random basic.in
+basic.in
+
+Exit status 0.
+#### TEST: agrep -l random < basic.in
+(standard input)
+
+Exit status 0.
+#### TEST: agrep -n random basic.in
+1:Some random text here.
+
+Exit status 0.
+#### TEST: agrep -n random < basic.in
+1:Some random text here.
+
+Exit status 0.
+#### TEST: agrep -s random basic.in
+0:Some random text here.
+
+Exit status 0.
+#### TEST: agrep -s random < basic.in
+0:Some random text here.
+
+Exit status 0.
+#### TEST: agrep -M random basic.in
+Some random text here.
+
+Exit status 0.
+#### TEST: agrep -M random < basic.in
+Some random text here.
+
+Exit status 0.
+#### TEST: agrep --show-position random basic.in
+5-11:Some random text here.
+
+Exit status 0.
+#### TEST: agrep --show-position random < basic.in
+5-11:Some random text here.
+
+Exit status 0.
+#### TEST: agrep --color random basic.in
+Some random text here.
+
+Exit status 0.
+#### TEST: agrep --color random < basic.in
+Some random text here.
+
+Exit status 0.
+#### TEST: agrep -H -n -s --color --show-position random basic.in
+basic.in:1:0:5-11:Some random text here.
+
+Exit status 0.
+#### TEST: agrep -H -n -s --color --show-position random < basic.in
+(standard input):1:0:5-11:Some random text here.
+
+Exit status 0.
+#### TEST: agrep -v random basic.in
+Foo bar quux.
+Let's hear an example of correct microphone placing.
+I suppose for something like that one would use a very large number of microphones.
+Extraordinary.
+Take California.
+A-ding-ing-ng-WROOOOM-ding-ding-boing!
+They are micro, mega, mini, mono, and multi.
+
+Exit status 0.
+#### TEST: agrep -v random < basic.in
+Foo bar quux.
+Let's hear an example of correct microphone placing.
+I suppose for something like that one would use a very large number of microphones.
+Extraordinary.
+Take California.
+A-ding-ing-ng-WROOOOM-ding-ding-boing!
+They are micro, mega, mini, mono, and multi.
+
+Exit status 0.
+#### TEST: agrep -c -v random basic.in
+7
+
+Exit status 0.
+#### TEST: agrep -c -v random < basic.in
+7
+
+Exit status 0.
+#### TEST: agrep -H -v random basic.in
+basic.in:Foo bar quux.
+basic.in:Let's hear an example of correct microphone placing.
+basic.in:I suppose for something like that one would use a very large number of microphones.
+basic.in:Extraordinary.
+basic.in:Take California.
+basic.in:A-ding-ing-ng-WROOOOM-ding-ding-boing!
+basic.in:They are micro, mega, mini, mono, and multi.
+
+Exit status 0.
+#### TEST: agrep -H -v random < basic.in
+(standard input):Foo bar quux.
+(standard input):Let's hear an example of correct microphone placing.
+(standard input):I suppose for something like that one would use a very large number of microphones.
+(standard input):Extraordinary.
+(standard input):Take California.
+(standard input):A-ding-ing-ng-WROOOOM-ding-ding-boing!
+(standard input):They are micro, mega, mini, mono, and multi.
+
+Exit status 0.
+#### TEST: agrep -l -v random basic.in
+basic.in
+
+Exit status 0.
+#### TEST: agrep -l -v random < basic.in
+(standard input)
+
+Exit status 0.
+#### TEST: agrep -n -v random basic.in
+2:Foo bar quux.
+3:Let's hear an example of correct microphone placing.
+4:I suppose for something like that one would use a very large number of microphones.
+5:Extraordinary.
+6:Take California.
+7:A-ding-ing-ng-WROOOOM-ding-ding-boing!
+8:They are micro, mega, mini, mono, and multi.
+
+Exit status 0.
+#### TEST: agrep -n -v random < basic.in
+2:Foo bar quux.
+3:Let's hear an example of correct microphone placing.
+4:I suppose for something like that one would use a very large number of microphones.
+5:Extraordinary.
+6:Take California.
+7:A-ding-ing-ng-WROOOOM-ding-ding-boing!
+8:They are micro, mega, mini, mono, and multi.
+
+Exit status 0.
+#### TEST: agrep -s -v random basic.in
+0:Foo bar quux.
+0:Let's hear an example of correct microphone placing.
+0:I suppose for something like that one would use a very large number of microphones.
+0:Extraordinary.
+0:Take California.
+0:A-ding-ing-ng-WROOOOM-ding-ding-boing!
+0:They are micro, mega, mini, mono, and multi.
+
+Exit status 0.
+#### TEST: agrep -s -v random < basic.in
+0:Foo bar quux.
+0:Let's hear an example of correct microphone placing.
+0:I suppose for something like that one would use a very large number of microphones.
+0:Extraordinary.
+0:Take California.
+0:A-ding-ing-ng-WROOOOM-ding-ding-boing!
+0:They are micro, mega, mini, mono, and multi.
+
+Exit status 0.
+#### TEST: agrep -M -v random basic.in
+Foo bar quux.
+Let's hear an example of correct microphone placing.
+I suppose for something like that one would use a very large number of microphones.
+Extraordinary.
+Take California.
+A-ding-ing-ng-WROOOOM-ding-ding-boing!
+They are micro, mega, mini, mono, and multi.
+
+Exit status 0.
+#### TEST: agrep -M -v random < basic.in
+Foo bar quux.
+Let's hear an example of correct microphone placing.
+I suppose for something like that one would use a very large number of microphones.
+Extraordinary.
+Take California.
+A-ding-ing-ng-WROOOOM-ding-ding-boing!
+They are micro, mega, mini, mono, and multi.
+
+Exit status 0.
+#### TEST: agrep --show-position -v random basic.in
+0-13:Foo bar quux.
+0-52:Let's hear an example of correct microphone placing.
+0-83:I suppose for something like that one would use a very large number of microphones.
+0-14:Extraordinary.
+0-16:Take California.
+0-38:A-ding-ing-ng-WROOOOM-ding-ding-boing!
+0-44:They are micro, mega, mini, mono, and multi.
+
+Exit status 0.
+#### TEST: agrep --show-position -v random < basic.in
+0-13:Foo bar quux.
+0-52:Let's hear an example of correct microphone placing.
+0-83:I suppose for something like that one would use a very large number of microphones.
+0-14:Extraordinary.
+0-16:Take California.
+0-38:A-ding-ing-ng-WROOOOM-ding-ding-boing!
+0-44:They are micro, mega, mini, mono, and multi.
+
+Exit status 0.
+#### TEST: agrep --color -v random basic.in
+Foo bar quux.
+Let's hear an example of correct microphone placing.
+I suppose for something like that one would use a very large number of microphones.
+Extraordinary.
+Take California.
+A-ding-ing-ng-WROOOOM-ding-ding-boing!
+They are micro, mega, mini, mono, and multi.
+
+Exit status 0.
+#### TEST: agrep --color -v random < basic.in
+Foo bar quux.
+Let's hear an example of correct microphone placing.
+I suppose for something like that one would use a very large number of microphones.
+Extraordinary.
+Take California.
+A-ding-ing-ng-WROOOOM-ding-ding-boing!
+They are micro, mega, mini, mono, and multi.
+
+Exit status 0.
+#### TEST: agrep -H -n -s --color --show-position -v random basic.in
+basic.in:2:0:0-13:Foo bar quux.
+basic.in:3:0:0-52:Let's hear an example of correct microphone placing.
+basic.in:4:0:0-83:I suppose for something like that one would use a very large number of microphones.
+basic.in:5:0:0-14:Extraordinary.
+basic.in:6:0:0-16:Take California.
+basic.in:7:0:0-38:A-ding-ing-ng-WROOOOM-ding-ding-boing!
+basic.in:8:0:0-44:They are micro, mega, mini, mono, and multi.
+
+Exit status 0.
+#### TEST: agrep -H -n -s --color --show-position -v random < basic.in
+(standard input):2:0:0-13:Foo bar quux.
+(standard input):3:0:0-52:Let's hear an example of correct microphone placing.
+(standard input):4:0:0-83:I suppose for something like that one would use a very large number of microphones.
+(standard input):5:0:0-14:Extraordinary.
+(standard input):6:0:0-16:Take California.
+(standard input):7:0:0-38:A-ding-ing-ng-WROOOOM-ding-ding-boing!
+(standard input):8:0:0-44:They are micro, mega, mini, mono, and multi.
+
+Exit status 0.
+#### TEST: agrep -i extra basic.in
+Extraordinary.
+
+Exit status 0.
+#### TEST: agrep -i extra < basic.in
+Extraordinary.
+
+Exit status 0.
+#### TEST: agrep -c -i extra basic.in
+1
+
+Exit status 0.
+#### TEST: agrep -c -i extra < basic.in
+1
+
+Exit status 0.
+#### TEST: agrep -H -i extra basic.in
+basic.in:Extraordinary.
+
+Exit status 0.
+#### TEST: agrep -H -i extra < basic.in
+(standard input):Extraordinary.
+
+Exit status 0.
+#### TEST: agrep -l -i extra basic.in
+basic.in
+
+Exit status 0.
+#### TEST: agrep -l -i extra < basic.in
+(standard input)
+
+Exit status 0.
+#### TEST: agrep -n -i extra basic.in
+5:Extraordinary.
+
+Exit status 0.
+#### TEST: agrep -n -i extra < basic.in
+5:Extraordinary.
+
+Exit status 0.
+#### TEST: agrep -s -i extra basic.in
+0:Extraordinary.
+
+Exit status 0.
+#### TEST: agrep -s -i extra < basic.in
+0:Extraordinary.
+
+Exit status 0.
+#### TEST: agrep -M -i extra basic.in
+Extraordinary.
+
+Exit status 0.
+#### TEST: agrep -M -i extra < basic.in
+Extraordinary.
+
+Exit status 0.
+#### TEST: agrep --show-position -i extra basic.in
+0-5:Extraordinary.
+
+Exit status 0.
+#### TEST: agrep --show-position -i extra < basic.in
+0-5:Extraordinary.
+
+Exit status 0.
+#### TEST: agrep --color -i extra basic.in
+Extraordinary.
+
+Exit status 0.
+#### TEST: agrep --color -i extra < basic.in
+Extraordinary.
+
+Exit status 0.
+#### TEST: agrep -H -n -s --color --show-position -i extra basic.in
+basic.in:5:0:0-5:Extraordinary.
+
+Exit status 0.
+#### TEST: agrep -H -n -s --color --show-position -i extra < basic.in
+(standard input):5:0:0-5:Extraordinary.
+
+Exit status 0.
+#### TEST: agrep -e -ding basic.in
+A-ding-ing-ng-WROOOOM-ding-ding-boing!
+
+Exit status 0.
+#### TEST: agrep -e -ding < basic.in
+A-ding-ing-ng-WROOOOM-ding-ding-boing!
+
+Exit status 0.
+#### TEST: agrep -c -e -ding basic.in
+1
+
+Exit status 0.
+#### TEST: agrep -c -e -ding < basic.in
+1
+
+Exit status 0.
+#### TEST: agrep -H -e -ding basic.in
+basic.in:A-ding-ing-ng-WROOOOM-ding-ding-boing!
+
+Exit status 0.
+#### TEST: agrep -H -e -ding < basic.in
+(standard input):A-ding-ing-ng-WROOOOM-ding-ding-boing!
+
+Exit status 0.
+#### TEST: agrep -l -e -ding basic.in
+basic.in
+
+Exit status 0.
+#### TEST: agrep -l -e -ding < basic.in
+(standard input)
+
+Exit status 0.
+#### TEST: agrep -n -e -ding basic.in
+7:A-ding-ing-ng-WROOOOM-ding-ding-boing!
+
+Exit status 0.
+#### TEST: agrep -n -e -ding < basic.in
+7:A-ding-ing-ng-WROOOOM-ding-ding-boing!
+
+Exit status 0.
+#### TEST: agrep -s -e -ding basic.in
+0:A-ding-ing-ng-WROOOOM-ding-ding-boing!
+
+Exit status 0.
+#### TEST: agrep -s -e -ding < basic.in
+0:A-ding-ing-ng-WROOOOM-ding-ding-boing!
+
+Exit status 0.
+#### TEST: agrep -M -e -ding basic.in
+A-ding-ing-ng-WROOOOM-ding-ding-boing!
+
+Exit status 0.
+#### TEST: agrep -M -e -ding < basic.in
+A-ding-ing-ng-WROOOOM-ding-ding-boing!
+
+Exit status 0.
+#### TEST: agrep --show-position -e -ding basic.in
+1-6:A-ding-ing-ng-WROOOOM-ding-ding-boing!
+
+Exit status 0.
+#### TEST: agrep --show-position -e -ding < basic.in
+1-6:A-ding-ing-ng-WROOOOM-ding-ding-boing!
+
+Exit status 0.
+#### TEST: agrep --color -e -ding basic.in
+A-ding-ing-ng-WROOOOM-ding-ding-boing!
+
+Exit status 0.
+#### TEST: agrep --color -e -ding < basic.in
+A-ding-ing-ng-WROOOOM-ding-ding-boing!
+
+Exit status 0.
+#### TEST: agrep -H -n -s --color --show-position -e -ding basic.in
+basic.in:7:0:1-6:A-ding-ing-ng-WROOOOM-ding-ding-boing!
+
+Exit status 0.
+#### TEST: agrep -H -n -s --color --show-position -e -ding < basic.in
+(standard input):7:0:1-6:A-ding-ing-ng-WROOOOM-ding-ding-boing!
+
+Exit status 0.
+#### TEST: agrep -w micro basic.in
+They are micro, mega, mini, mono, and multi.
+
+Exit status 0.
+#### TEST: agrep -w micro < basic.in
+They are micro, mega, mini, mono, and multi.
+
+Exit status 0.
+#### TEST: agrep -c -w micro basic.in
+1
+
+Exit status 0.
+#### TEST: agrep -c -w micro < basic.in
+1
+
+Exit status 0.
+#### TEST: agrep -H -w micro basic.in
+basic.in:They are micro, mega, mini, mono, and multi.
+
+Exit status 0.
+#### TEST: agrep -H -w micro < basic.in
+(standard input):They are micro, mega, mini, mono, and multi.
+
+Exit status 0.
+#### TEST: agrep -l -w micro basic.in
+basic.in
+
+Exit status 0.
+#### TEST: agrep -l -w micro < basic.in
+(standard input)
+
+Exit status 0.
+#### TEST: agrep -n -w micro basic.in
+8:They are micro, mega, mini, mono, and multi.
+
+Exit status 0.
+#### TEST: agrep -n -w micro < basic.in
+8:They are micro, mega, mini, mono, and multi.
+
+Exit status 0.
+#### TEST: agrep -s -w micro basic.in
+0:They are micro, mega, mini, mono, and multi.
+
+Exit status 0.
+#### TEST: agrep -s -w micro < basic.in
+0:They are micro, mega, mini, mono, and multi.
+
+Exit status 0.
+#### TEST: agrep -M -w micro basic.in
+They are micro, mega, mini, mono, and multi.
+
+Exit status 0.
+#### TEST: agrep -M -w micro < basic.in
+They are micro, mega, mini, mono, and multi.
+
+Exit status 0.
+#### TEST: agrep --show-position -w micro basic.in
+9-14:They are micro, mega, mini, mono, and multi.
+
+Exit status 0.
+#### TEST: agrep --show-position -w micro < basic.in
+9-14:They are micro, mega, mini, mono, and multi.
+
+Exit status 0.
+#### TEST: agrep --color -w micro basic.in
+They are micro, mega, mini, mono, and multi.
+
+Exit status 0.
+#### TEST: agrep --color -w micro < basic.in
+They are micro, mega, mini, mono, and multi.
+
+Exit status 0.
+#### TEST: agrep -H -n -s --color --show-position -w micro basic.in
+basic.in:8:0:9-14:They are micro, mega, mini, mono, and multi.
+
+Exit status 0.
+#### TEST: agrep -H -n -s --color --show-position -w micro < basic.in
+(standard input):8:0:9-14:They are micro, mega, mini, mono, and multi.
+
+Exit status 0.
diff --git a/tests/agrep/delimiters.args b/tests/agrep/delimiters.args
new file mode 100644
index 000000000000..949a3fa9deba
--- /dev/null
+++ b/tests/agrep/delimiters.args
@@ -0,0 +1,9 @@
+# There used to be a bug in agrep where the record delimiter was
+# considered to be part of the record, causing '$' at the end of the
+# regexp to work in an unexpected way.
+^foobar$
+foobar$
+^foobar
+foobar
+-d X ^xyzzy$
+-d X -M ^xyzzy$
diff --git a/tests/agrep/delimiters.input b/tests/agrep/delimiters.input
new file mode 100644
index 000000000000..c128d4d19afe
--- /dev/null
+++ b/tests/agrep/delimiters.input
@@ -0,0 +1,5 @@
+xfoobarx
+xfoobar
+foobarx
+foobar
+XtadaaXxyzzyXX
diff --git a/tests/agrep/delimiters.ok b/tests/agrep/delimiters.ok
new file mode 100644
index 000000000000..c7ae82c5924e
--- /dev/null
+++ b/tests/agrep/delimiters.ok
@@ -0,0 +1,528 @@
+#### TEST: agrep ^foobar$ delimiters.in
+foobar
+
+Exit status 0.
+#### TEST: agrep ^foobar$ < delimiters.in
+foobar
+
+Exit status 0.
+#### TEST: agrep -c ^foobar$ delimiters.in
+1
+
+Exit status 0.
+#### TEST: agrep -c ^foobar$ < delimiters.in
+1
+
+Exit status 0.
+#### TEST: agrep -H ^foobar$ delimiters.in
+delimiters.in:foobar
+
+Exit status 0.
+#### TEST: agrep -H ^foobar$ < delimiters.in
+(standard input):foobar
+
+Exit status 0.
+#### TEST: agrep -l ^foobar$ delimiters.in
+delimiters.in
+
+Exit status 0.
+#### TEST: agrep -l ^foobar$ < delimiters.in
+(standard input)
+
+Exit status 0.
+#### TEST: agrep -n ^foobar$ delimiters.in
+4:foobar
+
+Exit status 0.
+#### TEST: agrep -n ^foobar$ < delimiters.in
+4:foobar
+
+Exit status 0.
+#### TEST: agrep -s ^foobar$ delimiters.in
+0:foobar
+
+Exit status 0.
+#### TEST: agrep -s ^foobar$ < delimiters.in
+0:foobar
+
+Exit status 0.
+#### TEST: agrep -M ^foobar$ delimiters.in
+foobar
+
+Exit status 0.
+#### TEST: agrep -M ^foobar$ < delimiters.in
+foobar
+
+Exit status 0.
+#### TEST: agrep --show-position ^foobar$ delimiters.in
+0-6:foobar
+
+Exit status 0.
+#### TEST: agrep --show-position ^foobar$ < delimiters.in
+0-6:foobar
+
+Exit status 0.
+#### TEST: agrep --color ^foobar$ delimiters.in
+foobar
+
+Exit status 0.
+#### TEST: agrep --color ^foobar$ < delimiters.in
+foobar
+
+Exit status 0.
+#### TEST: agrep -H -n -s --color --show-position ^foobar$ delimiters.in
+delimiters.in:4:0:0-6:foobar
+
+Exit status 0.
+#### TEST: agrep -H -n -s --color --show-position ^foobar$ < delimiters.in
+(standard input):4:0:0-6:foobar
+
+Exit status 0.
+#### TEST: agrep foobar$ delimiters.in
+xfoobar
+foobar
+
+Exit status 0.
+#### TEST: agrep foobar$ < delimiters.in
+xfoobar
+foobar
+
+Exit status 0.
+#### TEST: agrep -c foobar$ delimiters.in
+2
+
+Exit status 0.
+#### TEST: agrep -c foobar$ < delimiters.in
+2
+
+Exit status 0.
+#### TEST: agrep -H foobar$ delimiters.in
+delimiters.in:xfoobar
+delimiters.in:foobar
+
+Exit status 0.
+#### TEST: agrep -H foobar$ < delimiters.in
+(standard input):xfoobar
+(standard input):foobar
+
+Exit status 0.
+#### TEST: agrep -l foobar$ delimiters.in
+delimiters.in
+
+Exit status 0.
+#### TEST: agrep -l foobar$ < delimiters.in
+(standard input)
+
+Exit status 0.
+#### TEST: agrep -n foobar$ delimiters.in
+2:xfoobar
+4:foobar
+
+Exit status 0.
+#### TEST: agrep -n foobar$ < delimiters.in
+2:xfoobar
+4:foobar
+
+Exit status 0.
+#### TEST: agrep -s foobar$ delimiters.in
+0:xfoobar
+0:foobar
+
+Exit status 0.
+#### TEST: agrep -s foobar$ < delimiters.in
+0:xfoobar
+0:foobar
+
+Exit status 0.
+#### TEST: agrep -M foobar$ delimiters.in
+xfoobar
+foobar
+
+Exit status 0.
+#### TEST: agrep -M foobar$ < delimiters.in
+xfoobar
+foobar
+
+Exit status 0.
+#### TEST: agrep --show-position foobar$ delimiters.in
+1-7:xfoobar
+0-6:foobar
+
+Exit status 0.
+#### TEST: agrep --show-position foobar$ < delimiters.in
+1-7:xfoobar
+0-6:foobar
+
+Exit status 0.
+#### TEST: agrep --color foobar$ delimiters.in
+xfoobar
+foobar
+
+Exit status 0.
+#### TEST: agrep --color foobar$ < delimiters.in
+xfoobar
+foobar
+
+Exit status 0.
+#### TEST: agrep -H -n -s --color --show-position foobar$ delimiters.in
+delimiters.in:2:0:1-7:xfoobar
+delimiters.in:4:0:0-6:foobar
+
+Exit status 0.
+#### TEST: agrep -H -n -s --color --show-position foobar$ < delimiters.in
+(standard input):2:0:1-7:xfoobar
+(standard input):4:0:0-6:foobar
+
+Exit status 0.
+#### TEST: agrep ^foobar delimiters.in
+foobarx
+foobar
+
+Exit status 0.
+#### TEST: agrep ^foobar < delimiters.in
+foobarx
+foobar
+
+Exit status 0.
+#### TEST: agrep -c ^foobar delimiters.in
+2
+
+Exit status 0.
+#### TEST: agrep -c ^foobar < delimiters.in
+2
+
+Exit status 0.
+#### TEST: agrep -H ^foobar delimiters.in
+delimiters.in:foobarx
+delimiters.in:foobar
+
+Exit status 0.
+#### TEST: agrep -H ^foobar < delimiters.in
+(standard input):foobarx
+(standard input):foobar
+
+Exit status 0.
+#### TEST: agrep -l ^foobar delimiters.in
+delimiters.in
+
+Exit status 0.
+#### TEST: agrep -l ^foobar < delimiters.in
+(standard input)
+
+Exit status 0.
+#### TEST: agrep -n ^foobar delimiters.in
+3:foobarx
+4:foobar
+
+Exit status 0.
+#### TEST: agrep -n ^foobar < delimiters.in
+3:foobarx
+4:foobar
+
+Exit status 0.
+#### TEST: agrep -s ^foobar delimiters.in
+0:foobarx
+0:foobar
+
+Exit status 0.
+#### TEST: agrep -s ^foobar < delimiters.in
+0:foobarx
+0:foobar
+
+Exit status 0.
+#### TEST: agrep -M ^foobar delimiters.in
+foobarx
+foobar
+
+Exit status 0.
+#### TEST: agrep -M ^foobar < delimiters.in
+foobarx
+foobar
+
+Exit status 0.
+#### TEST: agrep --show-position ^foobar delimiters.in
+0-6:foobarx
+0-6:foobar
+
+Exit status 0.
+#### TEST: agrep --show-position ^foobar < delimiters.in
+0-6:foobarx
+0-6:foobar
+
+Exit status 0.
+#### TEST: agrep --color ^foobar delimiters.in
+foobarx
+foobar
+
+Exit status 0.
+#### TEST: agrep --color ^foobar < delimiters.in
+foobarx
+foobar
+
+Exit status 0.
+#### TEST: agrep -H -n -s --color --show-position ^foobar delimiters.in
+delimiters.in:3:0:0-6:foobarx
+delimiters.in:4:0:0-6:foobar
+
+Exit status 0.
+#### TEST: agrep -H -n -s --color --show-position ^foobar < delimiters.in
+(standard input):3:0:0-6:foobarx
+(standard input):4:0:0-6:foobar
+
+Exit status 0.
+#### TEST: agrep foobar delimiters.in
+xfoobarx
+xfoobar
+foobarx
+foobar
+
+Exit status 0.
+#### TEST: agrep foobar < delimiters.in
+xfoobarx
+xfoobar
+foobarx
+foobar
+
+Exit status 0.
+#### TEST: agrep -c foobar delimiters.in
+4
+
+Exit status 0.
+#### TEST: agrep -c foobar < delimiters.in
+4
+
+Exit status 0.
+#### TEST: agrep -H foobar delimiters.in
+delimiters.in:xfoobarx
+delimiters.in:xfoobar
+delimiters.in:foobarx
+delimiters.in:foobar
+
+Exit status 0.
+#### TEST: agrep -H foobar < delimiters.in
+(standard input):xfoobarx
+(standard input):xfoobar
+(standard input):foobarx
+(standard input):foobar
+
+Exit status 0.
+#### TEST: agrep -l foobar delimiters.in
+delimiters.in
+
+Exit status 0.
+#### TEST: agrep -l foobar < delimiters.in
+(standard input)
+
+Exit status 0.
+#### TEST: agrep -n foobar delimiters.in
+1:xfoobarx
+2:xfoobar
+3:foobarx
+4:foobar
+
+Exit status 0.
+#### TEST: agrep -n foobar < delimiters.in
+1:xfoobarx
+2:xfoobar
+3:foobarx
+4:foobar
+
+Exit status 0.
+#### TEST: agrep -s foobar delimiters.in
+0:xfoobarx
+0:xfoobar
+0:foobarx
+0:foobar
+
+Exit status 0.
+#### TEST: agrep -s foobar < delimiters.in
+0:xfoobarx
+0:xfoobar
+0:foobarx
+0:foobar
+
+Exit status 0.
+#### TEST: agrep -M foobar delimiters.in
+xfoobarx
+xfoobar
+foobarx
+foobar
+
+Exit status 0.
+#### TEST: agrep -M foobar < delimiters.in
+xfoobarx
+xfoobar
+foobarx
+foobar
+
+Exit status 0.
+#### TEST: agrep --show-position foobar delimiters.in
+1-7:xfoobarx
+1-7:xfoobar
+0-6:foobarx
+0-6:foobar
+
+Exit status 0.
+#### TEST: agrep --show-position foobar < delimiters.in
+1-7:xfoobarx
+1-7:xfoobar
+0-6:foobarx
+0-6:foobar
+
+Exit status 0.
+#### TEST: agrep --color foobar delimiters.in
+xfoobarx
+xfoobar
+foobarx
+foobar
+
+Exit status 0.
+#### TEST: agrep --color foobar < delimiters.in
+xfoobarx
+xfoobar
+foobarx
+foobar
+
+Exit status 0.
+#### TEST: agrep -H -n -s --color --show-position foobar delimiters.in
+delimiters.in:1:0:1-7:xfoobarx
+delimiters.in:2:0:1-7:xfoobar
+delimiters.in:3:0:0-6:foobarx
+delimiters.in:4:0:0-6:foobar
+
+Exit status 0.
+#### TEST: agrep -H -n -s --color --show-position foobar < delimiters.in
+(standard input):1:0:1-7:xfoobarx
+(standard input):2:0:1-7:xfoobar
+(standard input):3:0:0-6:foobarx
+(standard input):4:0:0-6:foobar
+
+Exit status 0.
+#### TEST: agrep -d X ^xyzzy$ delimiters.in
+Xxyzzy
+Exit status 0.
+#### TEST: agrep -d X ^xyzzy$ < delimiters.in
+Xxyzzy
+Exit status 0.
+#### TEST: agrep -c -d X ^xyzzy$ delimiters.in
+1
+
+Exit status 0.
+#### TEST: agrep -c -d X ^xyzzy$ < delimiters.in
+1
+
+Exit status 0.
+#### TEST: agrep -H -d X ^xyzzy$ delimiters.in
+delimiters.in:Xxyzzy
+Exit status 0.
+#### TEST: agrep -H -d X ^xyzzy$ < delimiters.in
+(standard input):Xxyzzy
+Exit status 0.
+#### TEST: agrep -l -d X ^xyzzy$ delimiters.in
+delimiters.in
+
+Exit status 0.
+#### TEST: agrep -l -d X ^xyzzy$ < delimiters.in
+(standard input)
+
+Exit status 0.
+#### TEST: agrep -n -d X ^xyzzy$ delimiters.in
+3:Xxyzzy
+Exit status 0.
+#### TEST: agrep -n -d X ^xyzzy$ < delimiters.in
+3:Xxyzzy
+Exit status 0.
+#### TEST: agrep -s -d X ^xyzzy$ delimiters.in
+0:Xxyzzy
+Exit status 0.
+#### TEST: agrep -s -d X ^xyzzy$ < delimiters.in
+0:Xxyzzy
+Exit status 0.
+#### TEST: agrep -M -d X ^xyzzy$ delimiters.in
+xyzzyX
+Exit status 0.
+#### TEST: agrep -M -d X ^xyzzy$ < delimiters.in
+xyzzyX
+Exit status 0.
+#### TEST: agrep --show-position -d X ^xyzzy$ delimiters.in
+0-5:Xxyzzy
+Exit status 0.
+#### TEST: agrep --show-position -d X ^xyzzy$ < delimiters.in
+0-5:Xxyzzy
+Exit status 0.
+#### TEST: agrep --color -d X ^xyzzy$ delimiters.in
+Xxyzzy
+Exit status 0.
+#### TEST: agrep --color -d X ^xyzzy$ < delimiters.in
+Xxyzzy
+Exit status 0.
+#### TEST: agrep -H -n -s --color --show-position -d X ^xyzzy$ delimiters.in
+delimiters.in:3:0:0-5:Xxyzzy
+Exit status 0.
+#### TEST: agrep -H -n -s --color --show-position -d X ^xyzzy$ < delimiters.in
+(standard input):3:0:0-5:Xxyzzy
+Exit status 0.
+#### TEST: agrep -d X -M ^xyzzy$ delimiters.in
+xyzzyX
+Exit status 0.
+#### TEST: agrep -d X -M ^xyzzy$ < delimiters.in
+xyzzyX
+Exit status 0.
+#### TEST: agrep -c -d X -M ^xyzzy$ delimiters.in
+1
+
+Exit status 0.
+#### TEST: agrep -c -d X -M ^xyzzy$ < delimiters.in
+1
+
+Exit status 0.
+#### TEST: agrep -H -d X -M ^xyzzy$ delimiters.in
+delimiters.in:xyzzyX
+Exit status 0.
+#### TEST: agrep -H -d X -M ^xyzzy$ < delimiters.in
+(standard input):xyzzyX
+Exit status 0.
+#### TEST: agrep -l -d X -M ^xyzzy$ delimiters.in
+delimiters.in
+
+Exit status 0.
+#### TEST: agrep -l -d X -M ^xyzzy$ < delimiters.in
+(standard input)
+
+Exit status 0.
+#### TEST: agrep -n -d X -M ^xyzzy$ delimiters.in
+3:xyzzyX
+Exit status 0.
+#### TEST: agrep -n -d X -M ^xyzzy$ < delimiters.in
+3:xyzzyX
+Exit status 0.
+#### TEST: agrep -s -d X -M ^xyzzy$ delimiters.in
+0:xyzzyX
+Exit status 0.
+#### TEST: agrep -s -d X -M ^xyzzy$ < delimiters.in
+0:xyzzyX
+Exit status 0.
+#### TEST: agrep -M -d X -M ^xyzzy$ delimiters.in
+xyzzyX
+Exit status 0.
+#### TEST: agrep -M -d X -M ^xyzzy$ < delimiters.in
+xyzzyX
+Exit status 0.
+#### TEST: agrep --show-position -d X -M ^xyzzy$ delimiters.in
+0-5:xyzzyX
+Exit status 0.
+#### TEST: agrep --show-position -d X -M ^xyzzy$ < delimiters.in
+0-5:xyzzyX
+Exit status 0.
+#### TEST: agrep --color -d X -M ^xyzzy$ delimiters.in
+xyzzyX
+Exit status 0.
+#### TEST: agrep --color -d X -M ^xyzzy$ < delimiters.in
+xyzzyX
+Exit status 0.
+#### TEST: agrep -H -n -s --color --show-position -d X -M ^xyzzy$ delimiters.in
+delimiters.in:3:0:0-5:xyzzyX
+Exit status 0.
+#### TEST: agrep -H -n -s --color --show-position -d X -M ^xyzzy$ < delimiters.in
+(standard input):3:0:0-5:xyzzyX
+Exit status 0.
diff --git a/tests/agrep/exitstatus.args b/tests/agrep/exitstatus.args
new file mode 100644
index 000000000000..808ae7756125
--- /dev/null
+++ b/tests/agrep/exitstatus.args
@@ -0,0 +1,10 @@
+this-will-be-found
+-v this-will-be-found
+this-wont-be-found
+-v this-wont-be-found
+.
+-v .
+# Some errors which should give exit status 2.
+-d .* dummy
+-d {1 dummy
+\
diff --git a/tests/agrep/exitstatus.input b/tests/agrep/exitstatus.input
new file mode 100644
index 000000000000..c70a3febfcb1
--- /dev/null
+++ b/tests/agrep/exitstatus.input
@@ -0,0 +1,3 @@
+this-will-be-found
+so will this
+just some stuff
diff --git a/tests/agrep/exitstatus.ok b/tests/agrep/exitstatus.ok
new file mode 100644
index 000000000000..28427bbba6c3
--- /dev/null
+++ b/tests/agrep/exitstatus.ok
@@ -0,0 +1,705 @@
+#### TEST: agrep this-will-be-found exitstatus.in
+this-will-be-found
+
+Exit status 0.
+#### TEST: agrep this-will-be-found < exitstatus.in
+this-will-be-found
+
+Exit status 0.
+#### TEST: agrep -c this-will-be-found exitstatus.in
+1
+
+Exit status 0.
+#### TEST: agrep -c this-will-be-found < exitstatus.in
+1
+
+Exit status 0.
+#### TEST: agrep -H this-will-be-found exitstatus.in
+exitstatus.in:this-will-be-found
+
+Exit status 0.
+#### TEST: agrep -H this-will-be-found < exitstatus.in
+(standard input):this-will-be-found
+
+Exit status 0.
+#### TEST: agrep -l this-will-be-found exitstatus.in
+exitstatus.in
+
+Exit status 0.
+#### TEST: agrep -l this-will-be-found < exitstatus.in
+(standard input)
+
+Exit status 0.
+#### TEST: agrep -n this-will-be-found exitstatus.in
+1:this-will-be-found
+
+Exit status 0.
+#### TEST: agrep -n this-will-be-found < exitstatus.in
+1:this-will-be-found
+
+Exit status 0.
+#### TEST: agrep -s this-will-be-found exitstatus.in
+0:this-will-be-found
+
+Exit status 0.
+#### TEST: agrep -s this-will-be-found < exitstatus.in
+0:this-will-be-found
+
+Exit status 0.
+#### TEST: agrep -M this-will-be-found exitstatus.in
+this-will-be-found
+
+Exit status 0.
+#### TEST: agrep -M this-will-be-found < exitstatus.in
+this-will-be-found
+
+Exit status 0.
+#### TEST: agrep --show-position this-will-be-found exitstatus.in
+0-18:this-will-be-found
+
+Exit status 0.
+#### TEST: agrep --show-position this-will-be-found < exitstatus.in
+0-18:this-will-be-found
+
+Exit status 0.
+#### TEST: agrep --color this-will-be-found exitstatus.in
+this-will-be-found
+
+Exit status 0.
+#### TEST: agrep --color this-will-be-found < exitstatus.in
+this-will-be-found
+
+Exit status 0.
+#### TEST: agrep -H -n -s --color --show-position this-will-be-found exitstatus.in
+exitstatus.in:1:0:0-18:this-will-be-found
+
+Exit status 0.
+#### TEST: agrep -H -n -s --color --show-position this-will-be-found < exitstatus.in
+(standard input):1:0:0-18:this-will-be-found
+
+Exit status 0.
+#### TEST: agrep -v this-will-be-found exitstatus.in
+so will this
+just some stuff
+
+Exit status 0.
+#### TEST: agrep -v this-will-be-found < exitstatus.in
+so will this
+just some stuff
+
+Exit status 0.
+#### TEST: agrep -c -v this-will-be-found exitstatus.in
+2
+
+Exit status 0.
+#### TEST: agrep -c -v this-will-be-found < exitstatus.in
+2
+
+Exit status 0.
+#### TEST: agrep -H -v this-will-be-found exitstatus.in
+exitstatus.in:so will this
+exitstatus.in:just some stuff
+
+Exit status 0.
+#### TEST: agrep -H -v this-will-be-found < exitstatus.in
+(standard input):so will this
+(standard input):just some stuff
+
+Exit status 0.
+#### TEST: agrep -l -v this-will-be-found exitstatus.in
+exitstatus.in
+
+Exit status 0.
+#### TEST: agrep -l -v this-will-be-found < exitstatus.in
+(standard input)
+
+Exit status 0.
+#### TEST: agrep -n -v this-will-be-found exitstatus.in
+2:so will this
+3:just some stuff
+
+Exit status 0.
+#### TEST: agrep -n -v this-will-be-found < exitstatus.in
+2:so will this
+3:just some stuff
+
+Exit status 0.
+#### TEST: agrep -s -v this-will-be-found exitstatus.in
+0:so will this
+0:just some stuff
+
+Exit status 0.
+#### TEST: agrep -s -v this-will-be-found < exitstatus.in
+0:so will this
+0:just some stuff
+
+Exit status 0.
+#### TEST: agrep -M -v this-will-be-found exitstatus.in
+so will this
+just some stuff
+
+Exit status 0.
+#### TEST: agrep -M -v this-will-be-found < exitstatus.in
+so will this
+just some stuff
+
+Exit status 0.
+#### TEST: agrep --show-position -v this-will-be-found exitstatus.in
+0-12:so will this
+0-15:just some stuff
+
+Exit status 0.
+#### TEST: agrep --show-position -v this-will-be-found < exitstatus.in
+0-12:so will this
+0-15:just some stuff
+
+Exit status 0.
+#### TEST: agrep --color -v this-will-be-found exitstatus.in
+so will this
+just some stuff
+
+Exit status 0.
+#### TEST: agrep --color -v this-will-be-found < exitstatus.in
+so will this
+just some stuff
+
+Exit status 0.
+#### TEST: agrep -H -n -s --color --show-position -v this-will-be-found exitstatus.in
+exitstatus.in:2:0:0-12:so will this
+exitstatus.in:3:0:0-15:just some stuff
+
+Exit status 0.
+#### TEST: agrep -H -n -s --color --show-position -v this-will-be-found < exitstatus.in
+(standard input):2:0:0-12:so will this
+(standard input):3:0:0-15:just some stuff
+
+Exit status 0.
+#### TEST: agrep this-wont-be-found exitstatus.in
+
+Exit status 1.
+#### TEST: agrep this-wont-be-found < exitstatus.in
+
+Exit status 1.
+#### TEST: agrep -c this-wont-be-found exitstatus.in
+0
+
+Exit status 1.
+#### TEST: agrep -c this-wont-be-found < exitstatus.in
+0
+
+Exit status 1.
+#### TEST: agrep -H this-wont-be-found exitstatus.in
+
+Exit status 1.
+#### TEST: agrep -H this-wont-be-found < exitstatus.in
+
+Exit status 1.
+#### TEST: agrep -l this-wont-be-found exitstatus.in
+
+Exit status 1.
+#### TEST: agrep -l this-wont-be-found < exitstatus.in
+
+Exit status 1.
+#### TEST: agrep -n this-wont-be-found exitstatus.in
+
+Exit status 1.
+#### TEST: agrep -n this-wont-be-found < exitstatus.in
+
+Exit status 1.
+#### TEST: agrep -s this-wont-be-found exitstatus.in
+
+Exit status 1.
+#### TEST: agrep -s this-wont-be-found < exitstatus.in
+
+Exit status 1.
+#### TEST: agrep -M this-wont-be-found exitstatus.in
+
+Exit status 1.
+#### TEST: agrep -M this-wont-be-found < exitstatus.in
+
+Exit status 1.
+#### TEST: agrep --show-position this-wont-be-found exitstatus.in
+
+Exit status 1.
+#### TEST: agrep --show-position this-wont-be-found < exitstatus.in
+
+Exit status 1.
+#### TEST: agrep --color this-wont-be-found exitstatus.in
+
+Exit status 1.
+#### TEST: agrep --color this-wont-be-found < exitstatus.in
+
+Exit status 1.
+#### TEST: agrep -H -n -s --color --show-position this-wont-be-found exitstatus.in
+
+Exit status 1.
+#### TEST: agrep -H -n -s --color --show-position this-wont-be-found < exitstatus.in
+
+Exit status 1.
+#### TEST: agrep -v this-wont-be-found exitstatus.in
+this-will-be-found
+so will this
+just some stuff
+
+Exit status 0.
+#### TEST: agrep -v this-wont-be-found < exitstatus.in
+this-will-be-found
+so will this
+just some stuff
+
+Exit status 0.
+#### TEST: agrep -c -v this-wont-be-found exitstatus.in
+3
+
+Exit status 0.
+#### TEST: agrep -c -v this-wont-be-found < exitstatus.in
+3
+
+Exit status 0.
+#### TEST: agrep -H -v this-wont-be-found exitstatus.in
+exitstatus.in:this-will-be-found
+exitstatus.in:so will this
+exitstatus.in:just some stuff
+
+Exit status 0.
+#### TEST: agrep -H -v this-wont-be-found < exitstatus.in
+(standard input):this-will-be-found
+(standard input):so will this
+(standard input):just some stuff
+
+Exit status 0.
+#### TEST: agrep -l -v this-wont-be-found exitstatus.in
+exitstatus.in
+
+Exit status 0.
+#### TEST: agrep -l -v this-wont-be-found < exitstatus.in
+(standard input)
+
+Exit status 0.
+#### TEST: agrep -n -v this-wont-be-found exitstatus.in
+1:this-will-be-found
+2:so will this
+3:just some stuff
+
+Exit status 0.
+#### TEST: agrep -n -v this-wont-be-found < exitstatus.in
+1:this-will-be-found
+2:so will this
+3:just some stuff
+
+Exit status 0.
+#### TEST: agrep -s -v this-wont-be-found exitstatus.in
+0:this-will-be-found
+0:so will this
+0:just some stuff
+
+Exit status 0.
+#### TEST: agrep -s -v this-wont-be-found < exitstatus.in
+0:this-will-be-found
+0:so will this
+0:just some stuff
+
+Exit status 0.
+#### TEST: agrep -M -v this-wont-be-found exitstatus.in
+this-will-be-found
+so will this
+just some stuff
+
+Exit status 0.
+#### TEST: agrep -M -v this-wont-be-found < exitstatus.in
+this-will-be-found
+so will this
+just some stuff
+
+Exit status 0.
+#### TEST: agrep --show-position -v this-wont-be-found exitstatus.in
+0-18:this-will-be-found
+0-12:so will this
+0-15:just some stuff
+
+Exit status 0.
+#### TEST: agrep --show-position -v this-wont-be-found < exitstatus.in
+0-18:this-will-be-found
+0-12:so will this
+0-15:just some stuff
+
+Exit status 0.
+#### TEST: agrep --color -v this-wont-be-found exitstatus.in
+this-will-be-found
+so will this
+just some stuff
+
+Exit status 0.
+#### TEST: agrep --color -v this-wont-be-found < exitstatus.in
+this-will-be-found
+so will this
+just some stuff
+
+Exit status 0.
+#### TEST: agrep -H -n -s --color --show-position -v this-wont-be-found exitstatus.in
+exitstatus.in:1:0:0-18:this-will-be-found
+exitstatus.in:2:0:0-12:so will this
+exitstatus.in:3:0:0-15:just some stuff
+
+Exit status 0.
+#### TEST: agrep -H -n -s --color --show-position -v this-wont-be-found < exitstatus.in
+(standard input):1:0:0-18:this-will-be-found
+(standard input):2:0:0-12:so will this
+(standard input):3:0:0-15:just some stuff
+
+Exit status 0.
+#### TEST: agrep . exitstatus.in
+this-will-be-found
+so will this
+just some stuff
+
+Exit status 0.
+#### TEST: agrep . < exitstatus.in
+this-will-be-found
+so will this
+just some stuff
+
+Exit status 0.
+#### TEST: agrep -c . exitstatus.in
+3
+
+Exit status 0.
+#### TEST: agrep -c . < exitstatus.in
+3
+
+Exit status 0.
+#### TEST: agrep -H . exitstatus.in
+exitstatus.in:this-will-be-found
+exitstatus.in:so will this
+exitstatus.in:just some stuff
+
+Exit status 0.
+#### TEST: agrep -H . < exitstatus.in
+(standard input):this-will-be-found
+(standard input):so will this
+(standard input):just some stuff
+
+Exit status 0.
+#### TEST: agrep -l . exitstatus.in
+exitstatus.in
+
+Exit status 0.
+#### TEST: agrep -l . < exitstatus.in
+(standard input)
+
+Exit status 0.
+#### TEST: agrep -n . exitstatus.in
+1:this-will-be-found
+2:so will this
+3:just some stuff
+
+Exit status 0.
+#### TEST: agrep -n . < exitstatus.in
+1:this-will-be-found
+2:so will this
+3:just some stuff
+
+Exit status 0.
+#### TEST: agrep -s . exitstatus.in
+0:this-will-be-found
+0:so will this
+0:just some stuff
+
+Exit status 0.
+#### TEST: agrep -s . < exitstatus.in
+0:this-will-be-found
+0:so will this
+0:just some stuff
+
+Exit status 0.
+#### TEST: agrep -M . exitstatus.in
+this-will-be-found
+so will this
+just some stuff
+
+Exit status 0.
+#### TEST: agrep -M . < exitstatus.in
+this-will-be-found
+so will this
+just some stuff
+
+Exit status 0.
+#### TEST: agrep --show-position . exitstatus.in
+0-1:this-will-be-found
+0-1:so will this
+0-1:just some stuff
+
+Exit status 0.
+#### TEST: agrep --show-position . < exitstatus.in
+0-1:this-will-be-found
+0-1:so will this
+0-1:just some stuff
+
+Exit status 0.
+#### TEST: agrep --color . exitstatus.in
+this-will-be-found
+so will this
+just some stuff
+
+Exit status 0.
+#### TEST: agrep --color . < exitstatus.in
+this-will-be-found
+so will this
+just some stuff
+
+Exit status 0.
+#### TEST: agrep -H -n -s --color --show-position . exitstatus.in
+exitstatus.in:1:0:0-1:this-will-be-found
+exitstatus.in:2:0:0-1:so will this
+exitstatus.in:3:0:0-1:just some stuff
+
+Exit status 0.
+#### TEST: agrep -H -n -s --color --show-position . < exitstatus.in
+(standard input):1:0:0-1:this-will-be-found
+(standard input):2:0:0-1:so will this
+(standard input):3:0:0-1:just some stuff
+
+Exit status 0.
+#### TEST: agrep -v . exitstatus.in
+
+Exit status 1.
+#### TEST: agrep -v . < exitstatus.in
+
+Exit status 1.
+#### TEST: agrep -c -v . exitstatus.in
+0
+
+Exit status 1.
+#### TEST: agrep -c -v . < exitstatus.in
+0
+
+Exit status 1.
+#### TEST: agrep -H -v . exitstatus.in
+
+Exit status 1.
+#### TEST: agrep -H -v . < exitstatus.in
+
+Exit status 1.
+#### TEST: agrep -l -v . exitstatus.in
+
+Exit status 1.
+#### TEST: agrep -l -v . < exitstatus.in
+
+Exit status 1.
+#### TEST: agrep -n -v . exitstatus.in
+
+Exit status 1.
+#### TEST: agrep -n -v . < exitstatus.in
+
+Exit status 1.
+#### TEST: agrep -s -v . exitstatus.in
+
+Exit status 1.
+#### TEST: agrep -s -v . < exitstatus.in
+
+Exit status 1.
+#### TEST: agrep -M -v . exitstatus.in
+
+Exit status 1.
+#### TEST: agrep -M -v . < exitstatus.in
+
+Exit status 1.
+#### TEST: agrep --show-position -v . exitstatus.in
+
+Exit status 1.
+#### TEST: agrep --show-position -v . < exitstatus.in
+
+Exit status 1.
+#### TEST: agrep --color -v . exitstatus.in
+
+Exit status 1.
+#### TEST: agrep --color -v . < exitstatus.in
+
+Exit status 1.
+#### TEST: agrep -H -n -s --color --show-position -v . exitstatus.in
+
+Exit status 1.
+#### TEST: agrep -H -n -s --color --show-position -v . < exitstatus.in
+
+Exit status 1.
+#### TEST: agrep -d .* dummy exitstatus.in
+
+Exit status 1.
+#### TEST: agrep -d .* dummy < exitstatus.in
+
+Exit status 1.
+#### TEST: agrep -c -d .* dummy exitstatus.in
+exitstatus.in:0
+
+Exit status 1.
+#### TEST: agrep -c -d .* dummy < exitstatus.in
+
+Exit status 1.
+#### TEST: agrep -H -d .* dummy exitstatus.in
+
+Exit status 1.
+#### TEST: agrep -H -d .* dummy < exitstatus.in
+
+Exit status 1.
+#### TEST: agrep -l -d .* dummy exitstatus.in
+
+Exit status 1.
+#### TEST: agrep -l -d .* dummy < exitstatus.in
+
+Exit status 1.
+#### TEST: agrep -n -d .* dummy exitstatus.in
+
+Exit status 1.
+#### TEST: agrep -n -d .* dummy < exitstatus.in
+
+Exit status 1.
+#### TEST: agrep -s -d .* dummy exitstatus.in
+
+Exit status 1.
+#### TEST: agrep -s -d .* dummy < exitstatus.in
+
+Exit status 1.
+#### TEST: agrep -M -d .* dummy exitstatus.in
+
+Exit status 1.
+#### TEST: agrep -M -d .* dummy < exitstatus.in
+
+Exit status 1.
+#### TEST: agrep --show-position -d .* dummy exitstatus.in
+
+Exit status 1.
+#### TEST: agrep --show-position -d .* dummy < exitstatus.in
+
+Exit status 1.
+#### TEST: agrep --color -d .* dummy exitstatus.in
+
+Exit status 1.
+#### TEST: agrep --color -d .* dummy < exitstatus.in
+
+Exit status 1.
+#### TEST: agrep -H -n -s --color --show-position -d .* dummy exitstatus.in
+
+Exit status 1.
+#### TEST: agrep -H -n -s --color --show-position -d .* dummy < exitstatus.in
+
+Exit status 1.
+#### TEST: agrep -d {1 dummy exitstatus.in
+
+Exit status 2.
+#### TEST: agrep -d {1 dummy < exitstatus.in
+
+Exit status 2.
+#### TEST: agrep -c -d {1 dummy exitstatus.in
+
+Exit status 2.
+#### TEST: agrep -c -d {1 dummy < exitstatus.in
+
+Exit status 2.
+#### TEST: agrep -H -d {1 dummy exitstatus.in
+
+Exit status 2.
+#### TEST: agrep -H -d {1 dummy < exitstatus.in
+
+Exit status 2.
+#### TEST: agrep -l -d {1 dummy exitstatus.in
+
+Exit status 2.
+#### TEST: agrep -l -d {1 dummy < exitstatus.in
+
+Exit status 2.
+#### TEST: agrep -n -d {1 dummy exitstatus.in
+
+Exit status 2.
+#### TEST: agrep -n -d {1 dummy < exitstatus.in
+
+Exit status 2.
+#### TEST: agrep -s -d {1 dummy exitstatus.in
+
+Exit status 2.
+#### TEST: agrep -s -d {1 dummy < exitstatus.in
+
+Exit status 2.
+#### TEST: agrep -M -d {1 dummy exitstatus.in
+
+Exit status 2.
+#### TEST: agrep -M -d {1 dummy < exitstatus.in
+
+Exit status 2.
+#### TEST: agrep --show-position -d {1 dummy exitstatus.in
+
+Exit status 2.
+#### TEST: agrep --show-position -d {1 dummy < exitstatus.in
+
+Exit status 2.
+#### TEST: agrep --color -d {1 dummy exitstatus.in
+
+Exit status 2.
+#### TEST: agrep --color -d {1 dummy < exitstatus.in
+
+Exit status 2.
+#### TEST: agrep -H -n -s --color --show-position -d {1 dummy exitstatus.in
+
+Exit status 2.
+#### TEST: agrep -H -n -s --color --show-position -d {1 dummy < exitstatus.in
+
+Exit status 2.
+#### TEST: agrep \ exitstatus.in
+
+Exit status 2.
+#### TEST: agrep \ < exitstatus.in
+
+Exit status 2.
+#### TEST: agrep -c \ exitstatus.in
+
+Exit status 2.
+#### TEST: agrep -c \ < exitstatus.in
+
+Exit status 2.
+#### TEST: agrep -H \ exitstatus.in
+
+Exit status 2.
+#### TEST: agrep -H \ < exitstatus.in
+
+Exit status 2.
+#### TEST: agrep -l \ exitstatus.in
+
+Exit status 2.
+#### TEST: agrep -l \ < exitstatus.in
+
+Exit status 2.
+#### TEST: agrep -n \ exitstatus.in
+
+Exit status 2.
+#### TEST: agrep -n \ < exitstatus.in
+
+Exit status 2.
+#### TEST: agrep -s \ exitstatus.in
+
+Exit status 2.
+#### TEST: agrep -s \ < exitstatus.in
+
+Exit status 2.
+#### TEST: agrep -M \ exitstatus.in
+
+Exit status 2.
+#### TEST: agrep -M \ < exitstatus.in
+
+Exit status 2.
+#### TEST: agrep --show-position \ exitstatus.in
+
+Exit status 2.
+#### TEST: agrep --show-position \ < exitstatus.in
+
+Exit status 2.
+#### TEST: agrep --color \ exitstatus.in
+
+Exit status 2.
+#### TEST: agrep --color \ < exitstatus.in
+
+Exit status 2.
+#### TEST: agrep -H -n -s --color --show-position \ exitstatus.in
+
+Exit status 2.
+#### TEST: agrep -H -n -s --color --show-position \ < exitstatus.in
+
+Exit status 2.
diff --git a/tests/agrep/records.args b/tests/agrep/records.args
new file mode 100644
index 000000000000..b3c5e522c41c
--- /dev/null
+++ b/tests/agrep/records.args
@@ -0,0 +1,9 @@
+# Find words which contain the letter 'a'.
+-d \s+ a
+# Find words which contain a capital letter.
+-d \s+ [A-Z]
+# Find sentences which contain certain words.
+-d \.\s+ -M error
+-d \.\s+ -M default
+# Find paragraphs which contain "PATTERN".
+-d \n\n -M PATTERN
diff --git a/tests/agrep/records.input b/tests/agrep/records.input
new file mode 100644
index 000000000000..03c6b618b48f
--- /dev/null
+++ b/tests/agrep/records.input
@@ -0,0 +1,23 @@
+Force PATTERN to match only whole words. A "whole word" is a
+substring which either starts at the beginning or the record or is
+preceded by a non-word constituent character. Similarly, the
+substring must either end at the end of the record or be followed by a
+non-word constituent character. Word-constituent characters are
+alphanumerics (as defined by the current locale) and the underscore
+character. Note that the non-word constituent characters must
+surround the match; they cannot be counted as errors.
+
+Set cost of incorrect characters to NUM. Note that a deletion (a
+missing character) and an insertion (an extra character) together
+constitute a substituted character, but the cost will be the that of a
+deletion and an insertion added together. Thus, if the const of a
+substitution is set to be larger than the sum of the costs of deletion
+and insertion, direct substitutions will never be done.
+
+Set the record delimiter regular expression to PATTERN. The text
+between two delimiters, before the first delimiter, and after the last
+delimiter is considered to be a record. The default record delimiter
+is the regexp "\n", so by default a record is a line. PATTERN can be
+any regular expression that does not match the empty string. For
+example, using -d "^From " defines mail messages as records in a
+Mailbox format file.
diff --git a/tests/agrep/records.ok b/tests/agrep/records.ok
new file mode 100644
index 000000000000..9e05f9fe1f40
--- /dev/null
+++ b/tests/agrep/records.ok
@@ -0,0 +1,812 @@
+#### TEST: agrep -d \s+ a records.in
+ match a starts at a character. Similarly, at a character. characters are
+alphanumerics (as locale) and
+character. that characters match; cannot as characters that a (a character) and an (an extra character) a character, that a and an added a larger than
+and regular and after last a default default a a can
+any regular that match
+example, mail messages as a
+Mailbox format
+Exit status 0.
+#### TEST: agrep -d \s+ a < records.in
+ match a starts at a character. Similarly, at a character. characters are
+alphanumerics (as locale) and
+character. that characters match; cannot as characters that a (a character) and an (an extra character) a character, that a and an added a larger than
+and regular and after last a default default a a can
+any regular that match
+example, mail messages as a
+Mailbox format
+Exit status 0.
+#### TEST: agrep -c -d \s+ a records.in
+64
+
+Exit status 0.
+#### TEST: agrep -c -d \s+ a < records.in
+64
+
+Exit status 0.
+#### TEST: agrep -H -d \s+ a records.in
+records.in: matchrecords.in: arecords.in: startsrecords.in: atrecords.in: arecords.in: character.records.in: Similarly,records.in: atrecords.in: arecords.in: character.records.in: charactersrecords.in: arerecords.in:
+alphanumericsrecords.in: (asrecords.in: locale)records.in: andrecords.in:
+character.records.in: thatrecords.in: charactersrecords.in: match;records.in: cannotrecords.in: asrecords.in: charactersrecords.in: thatrecords.in: arecords.in: (arecords.in: character)records.in: andrecords.in: anrecords.in: (anrecords.in: extrarecords.in: character)records.in: arecords.in: character,records.in: thatrecords.in: arecords.in: andrecords.in: anrecords.in: addedrecords.in: arecords.in: largerrecords.in: thanrecords.in:
+andrecords.in: regularrecords.in: andrecords.in: afterrecords.in: lastrecords.in: arecords.in: defaultrecords.in: defaultrecords.in: arecords.in: arecords.in: canrecords.in:
+anyrecords.in: regularrecords.in: thatrecords.in: matchrecords.in:
+example,records.in: mailrecords.in: messagesrecords.in: asrecords.in: arecords.in:
+Mailboxrecords.in: format
+Exit status 0.
+#### TEST: agrep -H -d \s+ a < records.in
+(standard input): match(standard input): a(standard input): starts(standard input): at(standard input): a(standard input): character.(standard input): Similarly,(standard input): at(standard input): a(standard input): character.(standard input): characters(standard input): are(standard input):
+alphanumerics(standard input): (as(standard input): locale)(standard input): and(standard input):
+character.(standard input): that(standard input): characters(standard input): match;(standard input): cannot(standard input): as(standard input): characters(standard input): that(standard input): a(standard input): (a(standard input): character)(standard input): and(standard input): an(standard input): (an(standard input): extra(standard input): character)(standard input): a(standard input): character,(standard input): that(standard input): a(standard input): and(standard input): an(standard input): added(standard input): a(standard input): larger(standard input): than(standard input):
+and(standard input): regular(standard input): and(standard input): after(standard input): last(standard input): a(standard input): default(standard input): default(standard input): a(standard input): a(standard input): can(standard input):
+any(standard input): regular(standard input): that(standard input): match(standard input):
+example,(standard input): mail(standard input): messages(standard input): as(standard input): a(standard input):
+Mailbox(standard input): format
+Exit status 0.
+#### TEST: agrep -l -d \s+ a records.in
+records.in
+
+Exit status 0.
+#### TEST: agrep -l -d \s+ a < records.in
+(standard input)
+
+Exit status 0.
+#### TEST: agrep -n -d \s+ a records.in
+4: match12: a16: starts17: at27: a30: character.31: Similarly,37: at47: a50: character.52: characters53: are54:
+alphanumerics55: (as60: locale)61: and64:
+character.66: that70: characters74: match;76: cannot79: as85: characters89: that90: a92: (a94: character)95: and96: an98: (an99: extra100: character)103: a105: character,112: that114: a116: and117: an119: added126: a132: larger133: than141:
+and153: regular166: and167: after169: last175: a178: default187: default188: a191: a194: can196:
+any197: regular199: that202: match207:
+example,213: mail214: messages215: as218: a219:
+Mailbox220: format
+Exit status 0.
+#### TEST: agrep -n -d \s+ a < records.in
+4: match12: a16: starts17: at27: a30: character.31: Similarly,37: at47: a50: character.52: characters53: are54:
+alphanumerics55: (as60: locale)61: and64:
+character.66: that70: characters74: match;76: cannot79: as85: characters89: that90: a92: (a94: character)95: and96: an98: (an99: extra100: character)103: a105: character,112: that114: a116: and117: an119: added126: a132: larger133: than141:
+and153: regular166: and167: after169: last175: a178: default187: default188: a191: a194: can196:
+any197: regular199: that202: match207:
+example,213: mail214: messages215: as218: a219:
+Mailbox220: format
+Exit status 0.
+#### TEST: agrep -s -d \s+ a records.in
+0: match0: a0: starts0: at0: a0: character.0: Similarly,0: at0: a0: character.0: characters0: are0:
+alphanumerics0: (as0: locale)0: and0:
+character.0: that0: characters0: match;0: cannot0: as0: characters0: that0: a0: (a0: character)0: and0: an0: (an0: extra0: character)0: a0: character,0: that0: a0: and0: an0: added0: a0: larger0: than0:
+and0: regular0: and0: after0: last0: a0: default0: default0: a0: a0: can0:
+any0: regular0: that0: match0:
+example,0: mail0: messages0: as0: a0:
+Mailbox0: format
+Exit status 0.
+#### TEST: agrep -s -d \s+ a < records.in
+0: match0: a0: starts0: at0: a0: character.0: Similarly,0: at0: a0: character.0: characters0: are0:
+alphanumerics0: (as0: locale)0: and0:
+character.0: that0: characters0: match;0: cannot0: as0: characters0: that0: a0: (a0: character)0: and0: an0: (an0: extra0: character)0: a0: character,0: that0: a0: and0: an0: added0: a0: larger0: than0:
+and0: regular0: and0: after0: last0: a0: default0: default0: a0: a0: can0:
+any0: regular0: that0: match0:
+example,0: mail0: messages0: as0: a0:
+Mailbox0: format
+Exit status 0.
+#### TEST: agrep -M -d \s+ a records.in
+match a
+starts at a character. Similarly, at a
+character. characters are
+alphanumerics (as locale) and character. that characters match; cannot as characters that a (a
+character) and an (an extra character) a character, that a
+and an added a
+larger than and regular and after last
+a default default a a can any regular that match example, mail messages as a
+Mailbox format
+Exit status 0.
+#### TEST: agrep -M -d \s+ a < records.in
+match a
+starts at a character. Similarly, at a
+character. characters are
+alphanumerics (as locale) and character. that characters match; cannot as characters that a (a
+character) and an (an extra character) a character, that a
+and an added a
+larger than and regular and after last
+a default default a a can any regular that match example, mail messages as a
+Mailbox format
+Exit status 0.
+#### TEST: agrep --show-position -d \s+ a records.in
+1-2: match0-1: a2-3: starts0-1: at0-1: a2-3: character.5-6: Similarly,0-1: at0-1: a2-3: character.2-3: characters0-1: are0-1:
+alphanumerics1-2: (as3-4: locale)0-1: and2-3:
+character.2-3: that2-3: characters1-2: match;1-2: cannot0-1: as2-3: characters2-3: that0-1: a1-2: (a2-3: character)0-1: and0-1: an1-2: (an4-5: extra2-3: character)0-1: a2-3: character,2-3: that0-1: a0-1: and0-1: an0-1: added0-1: a1-2: larger2-3: than0-1:
+and5-6: regular0-1: and0-1: after1-2: last0-1: a3-4: default3-4: default0-1: a0-1: a1-2: can0-1:
+any5-6: regular2-3: that1-2: match2-3:
+example,1-2: mail4-5: messages0-1: as0-1: a1-2:
+Mailbox4-5: format
+Exit status 0.
+#### TEST: agrep --show-position -d \s+ a < records.in
+1-2: match0-1: a2-3: starts0-1: at0-1: a2-3: character.5-6: Similarly,0-1: at0-1: a2-3: character.2-3: characters0-1: are0-1:
+alphanumerics1-2: (as3-4: locale)0-1: and2-3:
+character.2-3: that2-3: characters1-2: match;1-2: cannot0-1: as2-3: characters2-3: that0-1: a1-2: (a2-3: character)0-1: and0-1: an1-2: (an4-5: extra2-3: character)0-1: a2-3: character,2-3: that0-1: a0-1: and0-1: an0-1: added0-1: a1-2: larger2-3: than0-1:
+and5-6: regular0-1: and0-1: after1-2: last0-1: a3-4: default3-4: default0-1: a0-1: a1-2: can0-1:
+any5-6: regular2-3: that1-2: match2-3:
+example,1-2: mail4-5: messages0-1: as0-1: a1-2:
+Mailbox4-5: format
+Exit status 0.
+#### TEST: agrep --color -d \s+ a records.in
+ match a starts at a character. Similarly, at a character. characters are
+alphanumerics (as locale) and
+character. that characters match; cannot as characters that a (a character) and an (an extra character) a character, that a and an added a larger than
+and regular and after last a default default a a can
+any regular that match
+example, mail messages as a
+Mailbox format
+Exit status 0.
+#### TEST: agrep --color -d \s+ a < records.in
+ match a starts at a character. Similarly, at a character. characters are
+alphanumerics (as locale) and
+character. that characters match; cannot as characters that a (a character) and an (an extra character) a character, that a and an added a larger than
+and regular and after last a default default a a can
+any regular that match
+example, mail messages as a
+Mailbox format
+Exit status 0.
+#### TEST: agrep -H -n -s --color --show-position -d \s+ a records.in
+records.in:4:0:1-2: matchrecords.in:12:0:0-1: arecords.in:16:0:2-3: startsrecords.in:17:0:0-1: atrecords.in:27:0:0-1: arecords.in:30:0:2-3: character.records.in:31:0:5-6: Similarly,records.in:37:0:0-1: atrecords.in:47:0:0-1: arecords.in:50:0:2-3: character.records.in:52:0:2-3: charactersrecords.in:53:0:0-1: arerecords.in:54:0:0-1:
+alphanumericsrecords.in:55:0:1-2: (asrecords.in:60:0:3-4: locale)records.in:61:0:0-1: andrecords.in:64:0:2-3:
+character.records.in:66:0:2-3: thatrecords.in:70:0:2-3: charactersrecords.in:74:0:1-2: match;records.in:76:0:1-2: cannotrecords.in:79:0:0-1: asrecords.in:85:0:2-3: charactersrecords.in:89:0:2-3: thatrecords.in:90:0:0-1: arecords.in:92:0:1-2: (arecords.in:94:0:2-3: character)records.in:95:0:0-1: andrecords.in:96:0:0-1: anrecords.in:98:0:1-2: (anrecords.in:99:0:4-5: extrarecords.in:100:0:2-3: character)records.in:103:0:0-1: arecords.in:105:0:2-3: character,records.in:112:0:2-3: thatrecords.in:114:0:0-1: arecords.in:116:0:0-1: andrecords.in:117:0:0-1: anrecords.in:119:0:0-1: addedrecords.in:126:0:0-1: arecords.in:132:0:1-2: largerrecords.in:133:0:2-3: thanrecords.in:141:0:0-1:
+andrecords.in:153:0:5-6: regularrecords.in:166:0:0-1: andrecords.in:167:0:0-1: afterrecords.in:169:0:1-2: lastrecords.in:175:0:0-1: arecords.in:178:0:3-4: defaultrecords.in:187:0:3-4: defaultrecords.in:188:0:0-1: arecords.in:191:0:0-1: arecords.in:194:0:1-2: canrecords.in:196:0:0-1:
+anyrecords.in:197:0:5-6: regularrecords.in:199:0:2-3: thatrecords.in:202:0:1-2: matchrecords.in:207:0:2-3:
+example,records.in:213:0:1-2: mailrecords.in:214:0:4-5: messagesrecords.in:215:0:0-1: asrecords.in:218:0:0-1: arecords.in:219:0:1-2:
+Mailboxrecords.in:220:0:4-5: format
+Exit status 0.
+#### TEST: agrep -H -n -s --color --show-position -d \s+ a < records.in
+(standard input):4:0:1-2: match(standard input):12:0:0-1: a(standard input):16:0:2-3: starts(standard input):17:0:0-1: at(standard input):27:0:0-1: a(standard input):30:0:2-3: character.(standard input):31:0:5-6: Similarly,(standard input):37:0:0-1: at(standard input):47:0:0-1: a(standard input):50:0:2-3: character.(standard input):52:0:2-3: characters(standard input):53:0:0-1: are(standard input):54:0:0-1:
+alphanumerics(standard input):55:0:1-2: (as(standard input):60:0:3-4: locale)(standard input):61:0:0-1: and(standard input):64:0:2-3:
+character.(standard input):66:0:2-3: that(standard input):70:0:2-3: characters(standard input):74:0:1-2: match;(standard input):76:0:1-2: cannot(standard input):79:0:0-1: as(standard input):85:0:2-3: characters(standard input):89:0:2-3: that(standard input):90:0:0-1: a(standard input):92:0:1-2: (a(standard input):94:0:2-3: character)(standard input):95:0:0-1: and(standard input):96:0:0-1: an(standard input):98:0:1-2: (an(standard input):99:0:4-5: extra(standard input):100:0:2-3: character)(standard input):103:0:0-1: a(standard input):105:0:2-3: character,(standard input):112:0:2-3: that(standard input):114:0:0-1: a(standard input):116:0:0-1: and(standard input):117:0:0-1: an(standard input):119:0:0-1: added(standard input):126:0:0-1: a(standard input):132:0:1-2: larger(standard input):133:0:2-3: than(standard input):141:0:0-1:
+and(standard input):153:0:5-6: regular(standard input):166:0:0-1: and(standard input):167:0:0-1: after(standard input):169:0:1-2: last(standard input):175:0:0-1: a(standard input):178:0:3-4: default(standard input):187:0:3-4: default(standard input):188:0:0-1: a(standard input):191:0:0-1: a(standard input):194:0:1-2: can(standard input):196:0:0-1:
+any(standard input):197:0:5-6: regular(standard input):199:0:2-3: that(standard input):202:0:1-2: match(standard input):207:0:2-3:
+example,(standard input):213:0:1-2: mail(standard input):214:0:4-5: messages(standard input):215:0:0-1: as(standard input):218:0:0-1: a(standard input):219:0:1-2:
+Mailbox(standard input):220:0:4-5: format
+Exit status 0.
+#### TEST: agrep -d \s+ [A-Z] records.in
+Force PATTERN A Similarly, Word-constituent Note
+
+Set NUM. Note Thus,
+
+Set PATTERN. The The PATTERN For "^From
+Mailbox
+Exit status 0.
+#### TEST: agrep -d \s+ [A-Z] < records.in
+Force PATTERN A Similarly, Word-constituent Note
+
+Set NUM. Note Thus,
+
+Set PATTERN. The The PATTERN For "^From
+Mailbox
+Exit status 0.
+#### TEST: agrep -c -d \s+ [A-Z] records.in
+18
+
+Exit status 0.
+#### TEST: agrep -c -d \s+ [A-Z] < records.in
+18
+
+Exit status 0.
+#### TEST: agrep -H -d \s+ [A-Z] records.in
+records.in:Forcerecords.in: PATTERNrecords.in: Arecords.in: Similarly,records.in: Word-constituentrecords.in: Noterecords.in:
+
+Setrecords.in: NUM.records.in: Noterecords.in: Thus,records.in:
+
+Setrecords.in: PATTERN.records.in: Therecords.in: Therecords.in: PATTERNrecords.in: Forrecords.in: "^Fromrecords.in:
+Mailbox
+Exit status 0.
+#### TEST: agrep -H -d \s+ [A-Z] < records.in
+(standard input):Force(standard input): PATTERN(standard input): A(standard input): Similarly,(standard input): Word-constituent(standard input): Note(standard input):
+
+Set(standard input): NUM.(standard input): Note(standard input): Thus,(standard input):
+
+Set(standard input): PATTERN.(standard input): The(standard input): The(standard input): PATTERN(standard input): For(standard input): "^From(standard input):
+Mailbox
+Exit status 0.
+#### TEST: agrep -l -d \s+ [A-Z] records.in
+records.in
+
+Exit status 0.
+#### TEST: agrep -l -d \s+ [A-Z] < records.in
+(standard input)
+
+Exit status 0.
+#### TEST: agrep -n -d \s+ [A-Z] records.in
+1:Force2: PATTERN8: A31: Similarly,51: Word-constituent65: Note81:
+
+Set87: NUM.88: Note121: Thus,149:
+
+Set156: PATTERN.157: The177: The193: PATTERN206: For210: "^From219:
+Mailbox
+Exit status 0.
+#### TEST: agrep -n -d \s+ [A-Z] < records.in
+1:Force2: PATTERN8: A31: Similarly,51: Word-constituent65: Note81:
+
+Set87: NUM.88: Note121: Thus,149:
+
+Set156: PATTERN.157: The177: The193: PATTERN206: For210: "^From219:
+Mailbox
+Exit status 0.
+#### TEST: agrep -s -d \s+ [A-Z] records.in
+0:Force0: PATTERN0: A0: Similarly,0: Word-constituent0: Note0:
+
+Set0: NUM.0: Note0: Thus,0:
+
+Set0: PATTERN.0: The0: The0: PATTERN0: For0: "^From0:
+Mailbox
+Exit status 0.
+#### TEST: agrep -s -d \s+ [A-Z] < records.in
+0:Force0: PATTERN0: A0: Similarly,0: Word-constituent0: Note0:
+
+Set0: NUM.0: Note0: Thus,0:
+
+Set0: PATTERN.0: The0: The0: PATTERN0: For0: "^From0:
+Mailbox
+Exit status 0.
+#### TEST: agrep -M -d \s+ [A-Z] records.in
+Force PATTERN A Similarly, Word-constituent Note Set NUM. Note Thus, Set PATTERN. The The PATTERN For
+"^From Mailbox
+Exit status 0.
+#### TEST: agrep -M -d \s+ [A-Z] < records.in
+Force PATTERN A Similarly, Word-constituent Note Set NUM. Note Thus, Set PATTERN. The The PATTERN For
+"^From Mailbox
+Exit status 0.
+#### TEST: agrep --show-position -d \s+ [A-Z] records.in
+0-1:Force0-1: PATTERN0-1: A0-1: Similarly,0-1: Word-constituent0-1: Note0-1:
+
+Set0-1: NUM.0-1: Note0-1: Thus,0-1:
+
+Set0-1: PATTERN.0-1: The0-1: The0-1: PATTERN0-1: For2-3: "^From0-1:
+Mailbox
+Exit status 0.
+#### TEST: agrep --show-position -d \s+ [A-Z] < records.in
+0-1:Force0-1: PATTERN0-1: A0-1: Similarly,0-1: Word-constituent0-1: Note0-1:
+
+Set0-1: NUM.0-1: Note0-1: Thus,0-1:
+
+Set0-1: PATTERN.0-1: The0-1: The0-1: PATTERN0-1: For2-3: "^From0-1:
+Mailbox
+Exit status 0.
+#### TEST: agrep --color -d \s+ [A-Z] records.in
+Force PATTERN A Similarly, Word-constituent Note
+
+Set NUM. Note Thus,
+
+Set PATTERN. The The PATTERN For "^From
+Mailbox
+Exit status 0.
+#### TEST: agrep --color -d \s+ [A-Z] < records.in
+Force PATTERN A Similarly, Word-constituent Note
+
+Set NUM. Note Thus,
+
+Set PATTERN. The The PATTERN For "^From
+Mailbox
+Exit status 0.
+#### TEST: agrep -H -n -s --color --show-position -d \s+ [A-Z] records.in
+records.in:1:0:0-1:Forcerecords.in:2:0:0-1: PATTERNrecords.in:8:0:0-1: Arecords.in:31:0:0-1: Similarly,records.in:51:0:0-1: Word-constituentrecords.in:65:0:0-1: Noterecords.in:81:0:0-1:
+
+Setrecords.in:87:0:0-1: NUM.records.in:88:0:0-1: Noterecords.in:121:0:0-1: Thus,records.in:149:0:0-1:
+
+Setrecords.in:156:0:0-1: PATTERN.records.in:157:0:0-1: Therecords.in:177:0:0-1: Therecords.in:193:0:0-1: PATTERNrecords.in:206:0:0-1: Forrecords.in:210:0:2-3: "^Fromrecords.in:219:0:0-1:
+Mailbox
+Exit status 0.
+#### TEST: agrep -H -n -s --color --show-position -d \s+ [A-Z] < records.in
+(standard input):1:0:0-1:Force(standard input):2:0:0-1: PATTERN(standard input):8:0:0-1: A(standard input):31:0:0-1: Similarly,(standard input):51:0:0-1: Word-constituent(standard input):65:0:0-1: Note(standard input):81:0:0-1:
+
+Set(standard input):87:0:0-1: NUM.(standard input):88:0:0-1: Note(standard input):121:0:0-1: Thus,(standard input):149:0:0-1:
+
+Set(standard input):156:0:0-1: PATTERN.(standard input):157:0:0-1: The(standard input):177:0:0-1: The(standard input):193:0:0-1: PATTERN(standard input):206:0:0-1: For(standard input):210:0:2-3: "^From(standard input):219:0:0-1:
+Mailbox
+Exit status 0.
+#### TEST: agrep -d \.\s+ -M error records.in
+Note that the non-word constituent characters must
+surround the match; they cannot be counted as errors.
+
+
+Exit status 0.
+#### TEST: agrep -d \.\s+ -M error < records.in
+Note that the non-word constituent characters must
+surround the match; they cannot be counted as errors.
+
+
+Exit status 0.
+#### TEST: agrep -c -d \.\s+ -M error records.in
+1
+
+Exit status 0.
+#### TEST: agrep -c -d \.\s+ -M error < records.in
+1
+
+Exit status 0.
+#### TEST: agrep -H -d \.\s+ -M error records.in
+records.in:Note that the non-word constituent characters must
+surround the match; they cannot be counted as errors.
+
+
+Exit status 0.
+#### TEST: agrep -H -d \.\s+ -M error < records.in
+(standard input):Note that the non-word constituent characters must
+surround the match; they cannot be counted as errors.
+
+
+Exit status 0.
+#### TEST: agrep -l -d \.\s+ -M error records.in
+records.in
+
+Exit status 0.
+#### TEST: agrep -l -d \.\s+ -M error < records.in
+(standard input)
+
+Exit status 0.
+#### TEST: agrep -n -d \.\s+ -M error records.in
+5:Note that the non-word constituent characters must
+surround the match; they cannot be counted as errors.
+
+
+Exit status 0.
+#### TEST: agrep -n -d \.\s+ -M error < records.in
+5:Note that the non-word constituent characters must
+surround the match; they cannot be counted as errors.
+
+
+Exit status 0.
+#### TEST: agrep -s -d \.\s+ -M error records.in
+0:Note that the non-word constituent characters must
+surround the match; they cannot be counted as errors.
+
+
+Exit status 0.
+#### TEST: agrep -s -d \.\s+ -M error < records.in
+0:Note that the non-word constituent characters must
+surround the match; they cannot be counted as errors.
+
+
+Exit status 0.
+#### TEST: agrep -M -d \.\s+ -M error records.in
+Note that the non-word constituent characters must
+surround the match; they cannot be counted as errors.
+
+
+Exit status 0.
+#### TEST: agrep -M -d \.\s+ -M error < records.in
+Note that the non-word constituent characters must
+surround the match; they cannot be counted as errors.
+
+
+Exit status 0.
+#### TEST: agrep --show-position -d \.\s+ -M error records.in
+97-102:Note that the non-word constituent characters must
+surround the match; they cannot be counted as errors.
+
+
+Exit status 0.
+#### TEST: agrep --show-position -d \.\s+ -M error < records.in
+97-102:Note that the non-word constituent characters must
+surround the match; they cannot be counted as errors.
+
+
+Exit status 0.
+#### TEST: agrep --color -d \.\s+ -M error records.in
+Note that the non-word constituent characters must
+surround the match; they cannot be counted as errors.
+
+
+Exit status 0.
+#### TEST: agrep --color -d \.\s+ -M error < records.in
+Note that the non-word constituent characters must
+surround the match; they cannot be counted as errors.
+
+
+Exit status 0.
+#### TEST: agrep -H -n -s --color --show-position -d \.\s+ -M error records.in
+records.in:5:0:97-102:Note that the non-word constituent characters must
+surround the match; they cannot be counted as errors.
+
+
+Exit status 0.
+#### TEST: agrep -H -n -s --color --show-position -d \.\s+ -M error < records.in
+(standard input):5:0:97-102:Note that the non-word constituent characters must
+surround the match; they cannot be counted as errors.
+
+
+Exit status 0.
+#### TEST: agrep -d \.\s+ -M default records.in
+The default record delimiter
+is the regexp "\n", so by default a record is a line.
+Exit status 0.
+#### TEST: agrep -d \.\s+ -M default < records.in
+The default record delimiter
+is the regexp "\n", so by default a record is a line.
+Exit status 0.
+#### TEST: agrep -c -d \.\s+ -M default records.in
+1
+
+Exit status 0.
+#### TEST: agrep -c -d \.\s+ -M default < records.in
+1
+
+Exit status 0.
+#### TEST: agrep -H -d \.\s+ -M default records.in
+records.in:The default record delimiter
+is the regexp "\n", so by default a record is a line.
+Exit status 0.
+#### TEST: agrep -H -d \.\s+ -M default < records.in
+(standard input):The default record delimiter
+is the regexp "\n", so by default a record is a line.
+Exit status 0.
+#### TEST: agrep -l -d \.\s+ -M default records.in
+records.in
+
+Exit status 0.
+#### TEST: agrep -l -d \.\s+ -M default < records.in
+(standard input)
+
+Exit status 0.
+#### TEST: agrep -n -d \.\s+ -M default records.in
+11:The default record delimiter
+is the regexp "\n", so by default a record is a line.
+Exit status 0.
+#### TEST: agrep -n -d \.\s+ -M default < records.in
+11:The default record delimiter
+is the regexp "\n", so by default a record is a line.
+Exit status 0.
+#### TEST: agrep -s -d \.\s+ -M default records.in
+0:The default record delimiter
+is the regexp "\n", so by default a record is a line.
+Exit status 0.
+#### TEST: agrep -s -d \.\s+ -M default < records.in
+0:The default record delimiter
+is the regexp "\n", so by default a record is a line.
+Exit status 0.
+#### TEST: agrep -M -d \.\s+ -M default records.in
+The default record delimiter
+is the regexp "\n", so by default a record is a line.
+Exit status 0.
+#### TEST: agrep -M -d \.\s+ -M default < records.in
+The default record delimiter
+is the regexp "\n", so by default a record is a line.
+Exit status 0.
+#### TEST: agrep --show-position -d \.\s+ -M default records.in
+4-11:The default record delimiter
+is the regexp "\n", so by default a record is a line.
+Exit status 0.
+#### TEST: agrep --show-position -d \.\s+ -M default < records.in
+4-11:The default record delimiter
+is the regexp "\n", so by default a record is a line.
+Exit status 0.
+#### TEST: agrep --color -d \.\s+ -M default records.in
+The default record delimiter
+is the regexp "\n", so by default a record is a line.
+Exit status 0.
+#### TEST: agrep --color -d \.\s+ -M default < records.in
+The default record delimiter
+is the regexp "\n", so by default a record is a line.
+Exit status 0.
+#### TEST: agrep -H -n -s --color --show-position -d \.\s+ -M default records.in
+records.in:11:0:4-11:The default record delimiter
+is the regexp "\n", so by default a record is a line.
+Exit status 0.
+#### TEST: agrep -H -n -s --color --show-position -d \.\s+ -M default < records.in
+(standard input):11:0:4-11:The default record delimiter
+is the regexp "\n", so by default a record is a line.
+Exit status 0.
+#### TEST: agrep -d \n\n -M PATTERN records.in
+Force PATTERN to match only whole words. A "whole word" is a
+substring which either starts at the beginning or the record or is
+preceded by a non-word constituent character. Similarly, the
+substring must either end at the end of the record or be followed by a
+non-word constituent character. Word-constituent characters are
+alphanumerics (as defined by the current locale) and the underscore
+character. Note that the non-word constituent characters must
+surround the match; they cannot be counted as errors.
+
+Set the record delimiter regular expression to PATTERN. The text
+between two delimiters, before the first delimiter, and after the last
+delimiter is considered to be a record. The default record delimiter
+is the regexp "\n", so by default a record is a line. PATTERN can be
+any regular expression that does not match the empty string. For
+example, using -d "^From " defines mail messages as records in a
+Mailbox format file.
+ c
+Exit status 0.
+#### TEST: agrep -d \n\n -M PATTERN < records.in
+Force PATTERN to match only whole words. A "whole word" is a
+substring which either starts at the beginning or the record or is
+preceded by a non-word constituent character. Similarly, the
+substring must either end at the end of the record or be followed by a
+non-word constituent character. Word-constituent characters are
+alphanumerics (as defined by the current locale) and the underscore
+character. Note that the non-word constituent characters must
+surround the match; they cannot be counted as errors.
+
+Set the record delimiter regular expression to PATTERN. The text
+between two delimiters, before the first delimiter, and after the last
+delimiter is considered to be a record. The default record delimiter
+is the regexp "\n", so by default a record is a line. PATTERN can be
+any regular expression that does not match the empty string. For
+example, using -d "^From " defines mail messages as records in a
+Mailbox format file.
+ c
+Exit status 0.
+#### TEST: agrep -c -d \n\n -M PATTERN records.in
+2
+
+Exit status 0.
+#### TEST: agrep -c -d \n\n -M PATTERN < records.in
+2
+
+Exit status 0.
+#### TEST: agrep -H -d \n\n -M PATTERN records.in
+records.in:Force PATTERN to match only whole words. A "whole word" is a
+substring which either starts at the beginning or the record or is
+preceded by a non-word constituent character. Similarly, the
+substring must either end at the end of the record or be followed by a
+non-word constituent character. Word-constituent characters are
+alphanumerics (as defined by the current locale) and the underscore
+character. Note that the non-word constituent characters must
+surround the match; they cannot be counted as errors.
+
+records.in:Set the record delimiter regular expression to PATTERN. The text
+between two delimiters, before the first delimiter, and after the last
+delimiter is considered to be a record. The default record delimiter
+is the regexp "\n", so by default a record is a line. PATTERN can be
+any regular expression that does not match the empty string. For
+example, using -d "^From " defines mail messages as records in a
+Mailbox format file.
+ c
+Exit status 0.
+#### TEST: agrep -H -d \n\n -M PATTERN < records.in
+(standard input):Force PATTERN to match only whole words. A "whole word" is a
+substring which either starts at the beginning or the record or is
+preceded by a non-word constituent character. Similarly, the
+substring must either end at the end of the record or be followed by a
+non-word constituent character. Word-constituent characters are
+alphanumerics (as defined by the current locale) and the underscore
+character. Note that the non-word constituent characters must
+surround the match; they cannot be counted as errors.
+
+(standard input):Set the record delimiter regular expression to PATTERN. The text
+between two delimiters, before the first delimiter, and after the last
+delimiter is considered to be a record. The default record delimiter
+is the regexp "\n", so by default a record is a line. PATTERN can be
+any regular expression that does not match the empty string. For
+example, using -d "^From " defines mail messages as records in a
+Mailbox format file.
+ c
+Exit status 0.
+#### TEST: agrep -l -d \n\n -M PATTERN records.in
+records.in
+
+Exit status 0.
+#### TEST: agrep -l -d \n\n -M PATTERN < records.in
+(standard input)
+
+Exit status 0.
+#### TEST: agrep -n -d \n\n -M PATTERN records.in
+1:Force PATTERN to match only whole words. A "whole word" is a
+substring which either starts at the beginning or the record or is
+preceded by a non-word constituent character. Similarly, the
+substring must either end at the end of the record or be followed by a
+non-word constituent character. Word-constituent characters are
+alphanumerics (as defined by the current locale) and the underscore
+character. Note that the non-word constituent characters must
+surround the match; they cannot be counted as errors.
+
+3:Set the record delimiter regular expression to PATTERN. The text
+between two delimiters, before the first delimiter, and after the last
+delimiter is considered to be a record. The default record delimiter
+is the regexp "\n", so by default a record is a line. PATTERN can be
+any regular expression that does not match the empty string. For
+example, using -d "^From " defines mail messages as records in a
+Mailbox format file.
+ c
+Exit status 0.
+#### TEST: agrep -n -d \n\n -M PATTERN < records.in
+1:Force PATTERN to match only whole words. A "whole word" is a
+substring which either starts at the beginning or the record or is
+preceded by a non-word constituent character. Similarly, the
+substring must either end at the end of the record or be followed by a
+non-word constituent character. Word-constituent characters are
+alphanumerics (as defined by the current locale) and the underscore
+character. Note that the non-word constituent characters must
+surround the match; they cannot be counted as errors.
+
+3:Set the record delimiter regular expression to PATTERN. The text
+between two delimiters, before the first delimiter, and after the last
+delimiter is considered to be a record. The default record delimiter
+is the regexp "\n", so by default a record is a line. PATTERN can be
+any regular expression that does not match the empty string. For
+example, using -d "^From " defines mail messages as records in a
+Mailbox format file.
+ c
+Exit status 0.
+#### TEST: agrep -s -d \n\n -M PATTERN records.in
+0:Force PATTERN to match only whole words. A "whole word" is a
+substring which either starts at the beginning or the record or is
+preceded by a non-word constituent character. Similarly, the
+substring must either end at the end of the record or be followed by a
+non-word constituent character. Word-constituent characters are
+alphanumerics (as defined by the current locale) and the underscore
+character. Note that the non-word constituent characters must
+surround the match; they cannot be counted as errors.
+
+0:Set the record delimiter regular expression to PATTERN. The text
+between two delimiters, before the first delimiter, and after the last
+delimiter is considered to be a record. The default record delimiter
+is the regexp "\n", so by default a record is a line. PATTERN can be
+any regular expression that does not match the empty string. For
+example, using -d "^From " defines mail messages as records in a
+Mailbox format file.
+ c
+Exit status 0.
+#### TEST: agrep -s -d \n\n -M PATTERN < records.in
+0:Force PATTERN to match only whole words. A "whole word" is a
+substring which either starts at the beginning or the record or is
+preceded by a non-word constituent character. Similarly, the
+substring must either end at the end of the record or be followed by a
+non-word constituent character. Word-constituent characters are
+alphanumerics (as defined by the current locale) and the underscore
+character. Note that the non-word constituent characters must
+surround the match; they cannot be counted as errors.
+
+0:Set the record delimiter regular expression to PATTERN. The text
+between two delimiters, before the first delimiter, and after the last
+delimiter is considered to be a record. The default record delimiter
+is the regexp "\n", so by default a record is a line. PATTERN can be
+any regular expression that does not match the empty string. For
+example, using -d "^From " defines mail messages as records in a
+Mailbox format file.
+ c
+Exit status 0.
+#### TEST: agrep -M -d \n\n -M PATTERN records.in
+Force PATTERN to match only whole words. A "whole word" is a
+substring which either starts at the beginning or the record or is
+preceded by a non-word constituent character. Similarly, the
+substring must either end at the end of the record or be followed by a
+non-word constituent character. Word-constituent characters are
+alphanumerics (as defined by the current locale) and the underscore
+character. Note that the non-word constituent characters must
+surround the match; they cannot be counted as errors.
+
+Set the record delimiter regular expression to PATTERN. The text
+between two delimiters, before the first delimiter, and after the last
+delimiter is considered to be a record. The default record delimiter
+is the regexp "\n", so by default a record is a line. PATTERN can be
+any regular expression that does not match the empty string. For
+example, using -d "^From " defines mail messages as records in a
+Mailbox format file.
+ c
+Exit status 0.
+#### TEST: agrep -M -d \n\n -M PATTERN < records.in
+Force PATTERN to match only whole words. A "whole word" is a
+substring which either starts at the beginning or the record or is
+preceded by a non-word constituent character. Similarly, the
+substring must either end at the end of the record or be followed by a
+non-word constituent character. Word-constituent characters are
+alphanumerics (as defined by the current locale) and the underscore
+character. Note that the non-word constituent characters must
+surround the match; they cannot be counted as errors.
+
+Set the record delimiter regular expression to PATTERN. The text
+between two delimiters, before the first delimiter, and after the last
+delimiter is considered to be a record. The default record delimiter
+is the regexp "\n", so by default a record is a line. PATTERN can be
+any regular expression that does not match the empty string. For
+example, using -d "^From " defines mail messages as records in a
+Mailbox format file.
+ c
+Exit status 0.
+#### TEST: agrep --show-position -d \n\n -M PATTERN records.in
+6-13:Force PATTERN to match only whole words. A "whole word" is a
+substring which either starts at the beginning or the record or is
+preceded by a non-word constituent character. Similarly, the
+substring must either end at the end of the record or be followed by a
+non-word constituent character. Word-constituent characters are
+alphanumerics (as defined by the current locale) and the underscore
+character. Note that the non-word constituent characters must
+surround the match; they cannot be counted as errors.
+
+47-54:Set the record delimiter regular expression to PATTERN. The text
+between two delimiters, before the first delimiter, and after the last
+delimiter is considered to be a record. The default record delimiter
+is the regexp "\n", so by default a record is a line. PATTERN can be
+any regular expression that does not match the empty string. For
+example, using -d "^From " defines mail messages as records in a
+Mailbox format file.
+ c
+Exit status 0.
+#### TEST: agrep --show-position -d \n\n -M PATTERN < records.in
+6-13:Force PATTERN to match only whole words. A "whole word" is a
+substring which either starts at the beginning or the record or is
+preceded by a non-word constituent character. Similarly, the
+substring must either end at the end of the record or be followed by a
+non-word constituent character. Word-constituent characters are
+alphanumerics (as defined by the current locale) and the underscore
+character. Note that the non-word constituent characters must
+surround the match; they cannot be counted as errors.
+
+47-54:Set the record delimiter regular expression to PATTERN. The text
+between two delimiters, before the first delimiter, and after the last
+delimiter is considered to be a record. The default record delimiter
+is the regexp "\n", so by default a record is a line. PATTERN can be
+any regular expression that does not match the empty string. For
+example, using -d "^From " defines mail messages as records in a
+Mailbox format file.
+ c
+Exit status 0.
+#### TEST: agrep --color -d \n\n -M PATTERN records.in
+Force PATTERN to match only whole words. A "whole word" is a
+substring which either starts at the beginning or the record or is
+preceded by a non-word constituent character. Similarly, the
+substring must either end at the end of the record or be followed by a
+non-word constituent character. Word-constituent characters are
+alphanumerics (as defined by the current locale) and the underscore
+character. Note that the non-word constituent characters must
+surround the match; they cannot be counted as errors.
+
+Set the record delimiter regular expression to PATTERN. The text
+between two delimiters, before the first delimiter, and after the last
+delimiter is considered to be a record. The default record delimiter
+is the regexp "\n", so by default a record is a line. PATTERN can be
+any regular expression that does not match the empty string. For
+example, using -d "^From " defines mail messages as records in a
+Mailbox format file.
+ c
+Exit status 0.
+#### TEST: agrep --color -d \n\n -M PATTERN < records.in
+Force PATTERN to match only whole words. A "whole word" is a
+substring which either starts at the beginning or the record or is
+preceded by a non-word constituent character. Similarly, the
+substring must either end at the end of the record or be followed by a
+non-word constituent character. Word-constituent characters are
+alphanumerics (as defined by the current locale) and the underscore
+character. Note that the non-word constituent characters must
+surround the match; they cannot be counted as errors.
+
+Set the record delimiter regular expression to PATTERN. The text
+between two delimiters, before the first delimiter, and after the last
+delimiter is considered to be a record. The default record delimiter
+is the regexp "\n", so by default a record is a line. PATTERN can be
+any regular expression that does not match the empty string. For
+example, using -d "^From " defines mail messages as records in a
+Mailbox format file.
+ c
+Exit status 0.
+#### TEST: agrep -H -n -s --color --show-position -d \n\n -M PATTERN records.in
+records.in:1:0:6-13:Force PATTERN to match only whole words. A "whole word" is a
+substring which either starts at the beginning or the record or is
+preceded by a non-word constituent character. Similarly, the
+substring must either end at the end of the record or be followed by a
+non-word constituent character. Word-constituent characters are
+alphanumerics (as defined by the current locale) and the underscore
+character. Note that the non-word constituent characters must
+surround the match; they cannot be counted as errors.
+
+records.in:3:0:47-54:Set the record delimiter regular expression to PATTERN. The text
+between two delimiters, before the first delimiter, and after the last
+delimiter is considered to be a record. The default record delimiter
+is the regexp "\n", so by default a record is a line. PATTERN can be
+any regular expression that does not match the empty string. For
+example, using -d "^From " defines mail messages as records in a
+Mailbox format file.
+ c
+Exit status 0.
+#### TEST: agrep -H -n -s --color --show-position -d \n\n -M PATTERN < records.in
+(standard input):1:0:6-13:Force PATTERN to match only whole words. A "whole word" is a
+substring which either starts at the beginning or the record or is
+preceded by a non-word constituent character. Similarly, the
+substring must either end at the end of the record or be followed by a
+non-word constituent character. Word-constituent characters are
+alphanumerics (as defined by the current locale) and the underscore
+character. Note that the non-word constituent characters must
+surround the match; they cannot be counted as errors.
+
+(standard input):3:0:47-54:Set the record delimiter regular expression to PATTERN. The text
+between two delimiters, before the first delimiter, and after the last
+delimiter is considered to be a record. The default record delimiter
+is the regexp "\n", so by default a record is a line. PATTERN can be
+any regular expression that does not match the empty string. For
+example, using -d "^From " defines mail messages as records in a
+Mailbox format file.
+ c
+Exit status 0.
diff --git a/tests/agrep/run-tests.sh b/tests/agrep/run-tests.sh
new file mode 100755
index 000000000000..cdc76a555d86
--- /dev/null
+++ b/tests/agrep/run-tests.sh
@@ -0,0 +1,96 @@
+#! /bin/sh
+
+set -e
+
+agrep="$top_builddir/src/agrep"
+
+echo "$builddir $top_builddir $srcdir"
+
+num_cases=0
+num_expanded=0
+num_tests=0
+num_fail=0
+num_ok=0
+
+SIFS="$IFS"
+
+for args in $srcdir/*.args; do
+ dir=`dirname $args`
+ base=`basename $args .args`
+ orig_input=$dir/$base.input
+ input=$base.in
+ ok=$dir/$base.ok
+ out=$base.out
+
+ rm -f $out
+ IFS="
+"
+ for arg in `cat $args`; do
+ IFS="$SIFS"
+ case "$arg" in
+ \#*) continue;;
+ esac
+
+ num_cases=`expr $num_cases + 1`
+ cp "$orig_input" $input
+
+ for extra in "" -c -H -l -n -s -M --show-position --color \
+ "-H -n -s --color --show-position"; do
+ num_expanded=`expr $num_expanded + 1`
+ # Note that `echo' cannot be used since it works differently on
+ # different platforms with regards to expanding \n (IRIX expands
+ # it, others typically do not). `cat' doesn't process its output.
+ cat >> $out <<EOF
+#### TEST: agrep $extra $arg $input
+EOF
+ cat <<EOF
+agrep $extra $arg $input
+EOF
+ set +e
+ $agrep $extra $arg $input >> $out
+ status=$?
+ set -e
+ cat >> $out <<EOF
+
+Exit status $status.
+EOF
+
+ num_expanded=`expr $num_expanded + 1`
+ cat >> $out <<EOF
+#### TEST: agrep $extra $arg < $input
+EOF
+ cat <<EOF
+agrep $extra $arg < $input
+EOF
+ set +e
+ $agrep $extra $arg < $input >> $out
+ status=$?
+ set -e
+ cat >> $out <<EOF
+
+Exit status $status.
+EOF
+ done
+ done
+ num_tests=`expr $num_tests + 1`
+ case $host_triplet in
+ *-mingw*)
+ # On MinGW something causes \r\n newlines to be output to $out,
+ # and our reference results don't have them.
+ tr -d '\015' < $out > $out.tmp
+ mv $out.tmp $out
+ ;;
+ esac
+ if diff $ok $out; then
+ num_ok=`expr $num_ok + 1`
+ else
+ echo "FAILED (see above)"
+ num_fail=`expr $num_fail + 1`
+ fi
+done
+
+echo "Ran $num_cases tests ($num_expanded expanded) from $num_tests suites."
+echo "$num_ok/$num_tests tests OK"
+
+test $num_fail -eq 0
+exit $?