Skip to content

Commit

Permalink
test: more escape cases
Browse files Browse the repository at this point in the history
  • Loading branch information
milas committed Sep 26, 2022
1 parent c23e7ac commit f3671f6
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions dotenv/godotenv_test.go
Expand Up @@ -383,6 +383,10 @@ func TestParsing(t *testing.T) {
parseAndCompare(t, `FOO=a\tb`, "FOO", `a\tb`)
parseAndCompare(t, `FOO="a\tb"`, "FOO", "a\tb")

// various shell escape sequences
// see https://pubs.opengroup.org/onlinepubs/9699919799/utilities/echo.html
parseAndCompare(t, `KEY="Z\aZ\bZ\fZ\nZ\rZ\tZ\vZ\\Z\0123Z"`, "KEY", "Z\aZ\bZ\fZ\nZ\rZ\tZ\vZ\\ZSZ")

// it 'parses variables with "." in the name' do
// expect(env('FOO.BAR=foobar')).to eql('FOO.BAR' => 'foobar')
parseAndCompare(t, "FOO.BAR=foobar", "FOO.BAR", "foobar")
Expand Down

0 comments on commit f3671f6

Please sign in to comment.