Skip to contentSkip to conversation

t/t0211-trace2-perf.sh: fix typo patern -> pattern

PATCH Superseded Marcel Telka 3 participants 3 messages May 15, 2024 – May 16, 2024

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 t/t0211-trace2-perf.sh: fix typo patern -> pattern

---
 t/t0211-trace2-perf.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
t/t0211-trace2-perf.sh +1 -1
index 13ef69b92f..070fe7a5da 100755
@@ -233,7 +233,7 @@ have_counter_event () {
 
 	pattern="d0|${thread}|${event}||||${category}|name:${name} value:${value}" &&
 
-	grep "${patern}" ${file}
+	grep "${pattern}" ${file}
 }
 
 test_expect_success 'global counter test/test1' '
#1 lore raw

On Thu, May 16, 2024 at 12:51:00AM +0200, Marcel Telka wrote:

Thanks for the patch, which looks obviously good to me. It would be nice to have a short explanation in the commit message that explains why this issue was able to sneak.

Patrick

Quoted 19 lines
---
 t/t0211-trace2-perf.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
t/t0211-trace2-perf.sh +1 -1
index 13ef69b92f..070fe7a5da 100755
@@ -233,7 +233,7 @@ have_counter_event () {
 
 	pattern="d0|${thread}|${event}||||${category}|name:${name} value:${value}" &&
 
-	grep "${patern}" ${file}
+	grep "${pattern}" ${file}
 }
 
 test_expect_success 'global counter test/test1' '
#2 lore raw
Quoted 7 lines · Patrick Steinhardt

On Thu, May 16, 2024 at 12:51:00AM +0200, Marcel Telka wrote:

Thanks for the patch, which looks obviously good to me. It would be nice to have a short explanation in the commit message that explains why this issue was able to sneak.

Patrick

A good piece of advice.

FYI, I have the following since last night, as the original report was whitespace damaged and did not apply.

-------- >8 --------------- >8 --------------- >8 --------
Subject: [PATCH] t0211: typofix

Marcel Telka noticed that one test assigns to $pattern and then uses $patern in an invocation of "grep". Of course, looking for an empty string will succeed, so the test succeeds for a wrong reason.

---
 t/t0211-trace2-perf.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
t/t0211-trace2-perf.sh +1 -1
index 0b3436e8ca..37a51e6449 100755
@@ -233,7 +233,7 @@ have_counter_event () {
 
 	pattern="d0|${thread}|${event}||||${category}|name:${name} value:${value}" &&
 
-	grep "${patern}" ${file}
+	grep "${pattern}" ${file}
 }
 
 test_expect_success 'global counter test/test1' '
Signature · 1 line
2.45.1-190-g19fe900cfc