git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] grep: add known breakage of coloring when using extended patterns
@ 2011-05-02 11:35 Bert Wesarg
  2011-05-02 11:41 ` Johannes Sixt
  2011-05-02 17:14 ` René Scharfe
  0 siblings, 2 replies; 8+ messages in thread
From: Bert Wesarg @ 2011-05-02 11:35 UTC (permalink / raw)
  To: René Scharfe
  Cc: Junio C Hamano, Nguyễn Thái Ngọc Duy,
	Thiago dos Santos Alvest, git, Bert Wesarg

The coloring code does not respect the extended pattern format, expose
this with an known breakage test.

Signed-off-by: Bert Wesarg <bert.wesarg@googlemail.com>
---
 t/t7812-grep-color.sh |   25 +++++++++++++++++++++++++
 1 files changed, 25 insertions(+), 0 deletions(-)
 create mode 100755 t/t7812-grep-color.sh

diff --git a/t/t7812-grep-color.sh b/t/t7812-grep-color.sh
new file mode 100755
index 0000000..2cffff3
--- /dev/null
+++ b/t/t7812-grep-color.sh
@@ -0,0 +1,25 @@
+#!/bin/sh
+
+test_description='git grep --color
+'
+
+. ./test-lib.sh
+
+test_expect_success 'setup' '
+	test_commit initial input "foo bar baz
+bar baz
+"
+'
+
+cat >expected <<EOF
+input<CYAN>:<RESET><BOLD;RED>foo<RESET> bar baz
+EOF
+
+
+test_expect_failure 'grep coloring does not honor boolean algebra' '
+	git grep --color -e foo --or \( -e bar --and --not -e baz \) |
+		test_decode_color >actual
+    test_cmp expected actual
+'
+
+test_done
-- 
1.7.5.349.gfeb1a

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2011-05-03 17:36 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-05-02 11:35 [PATCH] grep: add known breakage of coloring when using extended patterns Bert Wesarg
2011-05-02 11:41 ` Johannes Sixt
2011-05-02 11:48   ` Bert Wesarg
2011-05-02 17:14 ` René Scharfe
2011-05-02 17:37   ` Junio C Hamano
2011-05-02 21:07     ` René Scharfe
2011-05-02 22:04       ` Junio C Hamano
2011-05-03 17:36         ` René Scharfe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).