From b2d86a16b2a0a53c8c0c176909fbdc0ec22ee732 Mon Sep 17 00:00:00 2001 From: Matthew Rothenberg Date: Thu, 16 Oct 2014 15:31:12 -0400 Subject: [PATCH] use perl instead of sed -r to strip colors in test `sed -r` is not present on some BSD based systems, including MacOSX Darwin. perl is standard pretty much everywhere, so this a more reliable way to test. Since this is only used for tests, any performance differences should not matter significantly. --- test/support/test_helper.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/support/test_helper.sh b/test/support/test_helper.sh index cf211a6..ba9e472 100644 --- a/test/support/test_helper.sh +++ b/test/support/test_helper.sh @@ -15,7 +15,7 @@ fi # Strip color codes from a string strip_colors() { - sed -r "s/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]//g" + perl -pe 's/\e\[[\d;]*m//g' } # Print space separated tab completion options