Don't use sed -r; instead use old-style regexp
authorMartijn Pieters <mj@zopatista.com>
Tue, 28 Apr 2009 17:17:54 +0200
changeset 8245 0eade101f762
parent 8244 99d7e2db8da8
child 8247 8846ebb844ac
Don't use sed -r; instead use old-style regexp Rev d895158fe8af introduced some sed -r tests, but -r is only available on GNU sed, while BSD sed uses -E. Better to use old-style regular expressions, that way the tests work on all sed variants.
tests/test-hgwebdir
--- a/tests/test-hgwebdir	Tue Apr 28 18:14:49 2009 +0200
+++ b/tests/test-hgwebdir	Tue Apr 28 17:17:54 2009 +0200
@@ -65,11 +65,11 @@
 echo % should succeed, slashy names
 "$TESTDIR/get-with-headers.py" localhost:$HGPORT1 '/?style=raw'
 "$TESTDIR/get-with-headers.py" localhost:$HGPORT1 '/?style=paper' \
-	| sed -r "s/[0-9]+ seconds? ago/seconds ago/"
+	| sed "s/[0-9]\{1,\} seconds\{0,1\} ago/seconds ago/"
 "$TESTDIR/get-with-headers.py" localhost:$HGPORT1 '/t?style=raw'
 "$TESTDIR/get-with-headers.py" localhost:$HGPORT1 '/t/?style=raw'
 "$TESTDIR/get-with-headers.py" localhost:$HGPORT1 '/t/?style=paper' \
-	| sed -r "s/[0-9]+ seconds? ago/seconds ago/"
+	| sed "s/[0-9]\{1,\} seconds\{0,1\} ago/seconds ago/"
 "$TESTDIR/get-with-headers.py" localhost:$HGPORT1 '/t/a?style=atom' \
 	| sed "s/http:\/\/[^/]*\//http:\/\/127.0.0.1\//"
 "$TESTDIR/get-with-headers.py" localhost:$HGPORT1 '/t/a/?style=atom' \