Author: kevans
Date: Tue Sep  3 18:32:29 2019
New Revision: 351769
URL: https://svnweb.freebsd.org/changeset/base/351769

Log:
  bsdgrep(1): add some basic tests for some GNU Extension support
  
  These will be expanded later as I come up with good test cases; for now,
  these seem to be enough to trigger bugs in base gnugrep and expose missing
  features in bsdgrep.

Modified:
  head/usr.bin/grep/tests/grep_freebsd_test.sh

Modified: head/usr.bin/grep/tests/grep_freebsd_test.sh
==============================================================================
--- head/usr.bin/grep/tests/grep_freebsd_test.sh        Tue Sep  3 18:04:45 
2019        (r351768)
+++ head/usr.bin/grep/tests/grep_freebsd_test.sh        Tue Sep  3 18:32:29 
2019        (r351769)
@@ -82,8 +82,34 @@ rgrep_body()
        atf_check -o file:d_grep_r_implied.out rgrep --exclude="*.out" -e 
"test" "$(atf_get_srcdir)"
 }
 
+atf_test_case gnuext
+gnuext_body()
+{
+       grep_type
+       _type=$?
+       if [ $_type -eq $GREP_TYPE_BSD ]; then
+               atf_expect_fail "this test requires GNU extensions in regex(3)"
+       elif [ $_type -eq $GREP_TYPE_GNU_FREEBSD ]; then
+               atf_expect_fail "\\s and \\S are known to be buggy in base 
gnugrep"
+       fi
+
+       atf_check -o save:grep_alnum.out grep -o '[[:alnum:]]' /COPYRIGHT
+       atf_check -o file:grep_alnum.out grep -o '\w' /COPYRIGHT
+
+       atf_check -o save:grep_nalnum.out grep -o '[^[:alnum:]]' /COPYRIGHT
+       atf_check -o file:grep_nalnum.out grep -o '\W' /COPYRIGHT
+
+       atf_check -o save:grep_space.out grep -o '[[:space:]]' /COPYRIGHT
+       atf_check -o file:grep_space.out grep -o '\s' /COPYRIGHT
+
+       atf_check -o save:grep_nspace.out grep -o '[^[:space:]]' /COPYRIGHT
+       atf_check -o file:grep_nspace.out grep -o '\S' /COPYRIGHT
+
+}
+
 atf_init_test_cases()
 {
        atf_add_test_case grep_r_implied
        atf_add_test_case rgrep
+       atf_add_test_case gnuext
 }
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to