This is in POSIX, but pcre2grep gets it wrong (
https://bugs.exim.org/show_bug.cgi?id=2294).
---
 tests/grep.test | 8 ++++++++
 1 file changed, 8 insertions(+)
From 6af18fe70dcea718ceddecb4070aa9344c20398f Mon Sep 17 00:00:00 2001
From: Elliott Hughes <e...@google.com>
Date: Thu, 26 Jul 2018 15:42:02 -0700
Subject: [PATCH] Add tests for grep with implicit/explicit BREs and explicit
 EREs.

This is in POSIX, but pcre2grep gets it wrong (https://bugs.exim.org/show_bug.cgi?id=2294).
---
 tests/grep.test | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/tests/grep.test b/tests/grep.test
index 2a4f178..21cd8bb 100755
--- a/tests/grep.test
+++ b/tests/grep.test
@@ -143,3 +143,11 @@ rm test
 # match after NUL byte
 testing "match after NUL byte" "grep -a two" "one\0and two three\n" \
   "" 'one\0and two three'
+
+# BREs versus EREs
+testing "implicit BRE |" "grep 'uno|dos'" "uno|dos\n" \
+  "" "uno\ndos\nuno|dos\n"
+testing "explicit BRE |" "grep -e 'uno|dos'" "uno|dos\n" \
+  "" "uno\ndos\nuno|dos\n"
+testing "explicit ERE |" "grep -E 'uno|dos'" "uno\ndos\nuno|dos\n" \
+  "" "uno\ndos\nuno|dos\n"
-- 
2.18.0.345.g5c9ce644c3-goog

_______________________________________________
Toybox mailing list
Toybox@lists.landley.net
http://lists.landley.net/listinfo.cgi/toybox-landley.net

Reply via email to