mirror of
https://github.com/drwetter/testssl.sh.git
synced 2026-09-14 13:48:16 +02:00
double quoting needed in passed expression to grep
This commit is contained in:
+3
-3
@@ -28,7 +28,7 @@ $tests++;
|
||||
#2
|
||||
printf "\n%s\n", "Testing for backticks ...";
|
||||
|
||||
my @matches = qx(grep -nP '`[^`]*`' $prg);
|
||||
@matches = qx(grep -nP '`[^`]*`' $prg);
|
||||
is(scalar(@matches), 0, "Checking bad backtick patterns")
|
||||
or diag(@matches);
|
||||
$tests++;
|
||||
@@ -36,7 +36,7 @@ $tests++;
|
||||
#3
|
||||
printf "\n%s\n", "Sourcing without checking the file exists #1 ...";
|
||||
|
||||
my @matches = qx(grep -nP '^\s*\.\s+\$' $prg);
|
||||
@matches = qx(grep -nP '^\\s*\\.\\s+\\$' $prg);
|
||||
is(scalar(@matches), 0, "Checking bad sourcing pattern #1")
|
||||
or diag(@matches);
|
||||
$tests++;
|
||||
@@ -44,7 +44,7 @@ $tests++;
|
||||
#4
|
||||
printf "\n%s\n", "Sourcing without checking the file exists #2 ...";
|
||||
|
||||
my @matches = qx(grep -nP '^\s*source\s+\$' $prg);
|
||||
@matches = qx(grep -nP '^\\s*source\\s+\\$' $prg);
|
||||
is(scalar(@matches), 0, "Checking bad sourcing pattern #2")
|
||||
or diag(@matches);
|
||||
$tests++;
|
||||
|
||||
Reference in New Issue
Block a user