escape some other bash-y special chars ($!)

This commit is contained in:
Alex Quick
2017-07-16 18:31:51 -04:00
parent 88e7c8bd35
commit 5d289f4405
2 changed files with 14 additions and 6 deletions

View File

@ -346,8 +346,8 @@ func TestWrite(t *testing.T) {
writeAndCompare(`key=va"lu"e`, `key="va\"lu\"e"`)
//but single quotes are left alone
writeAndCompare(`key=va'lu'e`, `key="va'lu'e"`)
// newlines and backslashes are escaped
writeAndCompare(`foo="ba\n\r\\r!"`, `foo="ba\n\r\\r!"`)
// newlines, backslashes, and some other special chars are escaped
writeAndCompare(`foo="$ba\n\r\\r!"`, `foo="\$ba\n\r\\r\!"`)
}
func TestRoundtrip(t *testing.T) {