Skip to content

Commit 2c17b1b

Browse files
authored
Don't assume Bash flags for BASH_REMATCH (#30)
This makes the test work with all versions of Bash 5.x
1 parent 852013d commit 2c17b1b

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

test/data/bash-rematch.cmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ c
99
s
1010
c
1111
s
12-
eval typeset -p BASH_REMATCH
12+
eval typeset | grep -E '^BASH_REMATCH='
1313
c
1414
s
1515
c

test/data/bash-rematch.right

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ Breakpoint 1 hit (2 times).
3030
(bash-rematch.sh:8):
3131
8: echo "${!i} matches"
3232
0: $BASH_REMATCH = 456
33-
+eval typeset -p BASH_REMATCH
34-
declare -a BASH_REMATCH=([0]="456")
33+
+eval typeset | grep -E '^BASH_REMATCH='
34+
BASH_REMATCH=([0]="456")
3535
$? is 0
3636
+c
3737
456 matches

0 commit comments

Comments
 (0)