Skip to content

Commit

Permalink
add test for numeric parameter names
Browse files Browse the repository at this point in the history
Verify the current behavior of bracketed numeric names, and an example
test case for simple names in preparation for #4.
  • Loading branch information
mgood committed Jan 24, 2024
1 parent ed83dfb commit 256a914
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions posix_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,12 @@ var paramtests = []struct {
{"${set}", "yes", ""},
{"${null}", "", ""},
{"${unset}", "", ""},
{"${1}X${2}", "oneXtwo", ""},

// Names, no brackets
{"$set", "yes", ""},
{"$set$set2", "yesyes-two", ""},
// {"$1X$2", "oneXtwo", ""}, // TODO(#3) parse numeric simple names

// Default
{"${set:-word}", "yes", ""},
Expand Down Expand Up @@ -150,6 +152,8 @@ func TestExpand_simple(t *testing.T) {
"set": "yes",
"set2": "yes-two",
"null": "",
"1": "one",
"2": "two",
}

for _, tt := range paramtests {
Expand Down

0 comments on commit 256a914

Please sign in to comment.