Merge pull request #3194 from bshelton229/literal-dollar-character
Make literal $ character work in set $location_path
This commit is contained in:
commit
f56ab42cd2
3 changed files with 48 additions and 1 deletions
|
|
@ -858,3 +858,29 @@ func TestBuildUpstreamName(t *testing.T) {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestEscapeLiteralDollar(t *testing.T) {
|
||||
escapedPath := escapeLiteralDollar("/$")
|
||||
expected := "/${literal_dollar}"
|
||||
if escapedPath != expected {
|
||||
t.Errorf("Expected %v but returned %v", expected, escapedPath)
|
||||
}
|
||||
|
||||
escapedPath = escapeLiteralDollar("/hello-$/world-$/")
|
||||
expected = "/hello-${literal_dollar}/world-${literal_dollar}/"
|
||||
if escapedPath != expected {
|
||||
t.Errorf("Expected %v but returned %v", expected, escapedPath)
|
||||
}
|
||||
|
||||
leaveUnchagned := "/leave-me/unchagned"
|
||||
escapedPath = escapeLiteralDollar(leaveUnchagned)
|
||||
if escapedPath != leaveUnchagned {
|
||||
t.Errorf("Expected %v but returned %v", leaveUnchagned, escapedPath)
|
||||
}
|
||||
|
||||
escapedPath = escapeLiteralDollar(false)
|
||||
expected = ""
|
||||
if escapedPath != expected {
|
||||
t.Errorf("Expected %v but returned %v", expected, escapedPath)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue