[PATCH] test 261a9f47b44b: grep w/ match in last line w/o newline

Christian Ebert blacktrash at gmx.net
Fri Oct 24 01:18:46 CDT 2008


# HG changeset patch
# User Christian Ebert <blacktrash at gmx.net>
# Date 1224828961 -7200
# Node ID a554087125aa25c15e148169091104cfa1db192b
# Parent  9f0e52e1df77639faebde4271047da94909f3730
test 261a9f47b44b: grep w/ match in last line w/o newline

Last character in match output omitted to avoid infinite loop.

diff --git a/tests/test-grep b/tests/test-grep
--- a/tests/test-grep
+++ b/tests/test-grep
@@ -53,6 +53,12 @@
 hg grep orange
 hg grep --all orange
 
+echo % match in last "line" without newline
+python -c 'fp = open("noeol", "wb"); fp.write("no infinite loop"); fp.close();'
+hg ci -Amnoeol
+echo % last character omitted in output to avoid infinite loop
+hg grep loop
+
 # Got a traceback when using grep on a single
 # revision with renamed files.
 cd ..
@@ -66,3 +72,4 @@
 hg grep octarine
 # Used to crash here
 hg grep -r 1 octarine
+
diff --git a/tests/test-grep.out b/tests/test-grep.out
--- a/tests/test-grep.out
+++ b/tests/test-grep.out
@@ -32,6 +32,10 @@
 color:3:+:orange
 color:2:-:orange
 color:1:+:orange
+% match in last line without newline
+adding noeol
+% last character omitted in output to avoid infinite loop
+noeol:4:no infinite loo
 % issue 685
 adding color
 color:0:octarine


More information about the Mercurial-devel mailing list