From 05623b7969002c5e41cb92231e34811e8f106caf Mon Sep 17 00:00:00 2001 From: Peter Goodspeed-Niklaus Date: Tue, 14 Nov 2017 13:47:58 +0100 Subject: [PATCH 1/2] Improve test-exercise: sed now more precisely excises #[ignore] lines Previous implementation simply deleted all lines containing the string `[ignore]`. This was not desired behavior, because it also deleted lines which used the attribute inline. The updated version now removes the string `#[ignore]` and any trailing whitespace. If the line is blank in consequence, it deletes the entire line; otherwise it leaves it. --- bin/test-exercise | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bin/test-exercise b/bin/test-exercise index cccc6577f..f49d65ee2 100755 --- a/bin/test-exercise +++ b/bin/test-exercise @@ -72,7 +72,10 @@ fi # eliminate #[ignore] lines from tests for test in "$exercise/tests/*.rs"; do - sed -i '/\[ignore\]/d' $test + sed -i -e '/#\[ignore\]/{ + s/#\[ignore\]\s*\(.*\)$/\1/ + /^\s*$/d + }' $test done # run tests from within exercise directory From 1aeef834c215ae18c820d9aa4777d5887d1d43b7 Mon Sep 17 00:00:00 2001 From: Peter Goodspeed-Niklaus Date: Tue, 14 Nov 2017 14:31:12 +0100 Subject: [PATCH 2/2] Simplify expression --- bin/test-exercise | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/test-exercise b/bin/test-exercise index f49d65ee2..a7aaa9ac1 100755 --- a/bin/test-exercise +++ b/bin/test-exercise @@ -73,7 +73,7 @@ fi # eliminate #[ignore] lines from tests for test in "$exercise/tests/*.rs"; do sed -i -e '/#\[ignore\]/{ - s/#\[ignore\]\s*\(.*\)$/\1/ + s/#\[ignore\]\s*// /^\s*$/d }' $test done