additional tests

This commit is contained in:
Scott Motte
2025-10-23 14:25:25 -07:00
parent 0692981a2d
commit d74584c53c
2 changed files with 12 additions and 2 deletions

View File

@@ -55,7 +55,8 @@ ONETWO_SIMPLE2=$ONE${TWO}
ONETWO_SUPER_SIMPLE=$ONE$TWO
TWO_DOLLAR_SIGNS_FOLLOWED_BY_DIGIT="abcd$$1234foo"
TWO_DOLLAR_SIGNS_FOLLOWED_BY_LETTER="pa$"
TWO_DOLLAR_SIGNS_FOLLOWED_BY_LETTER="pa$$word@"
TWO_DOLLAR_SIGNS_FOLLOWED_BY_LETTER_SINGLE_QUOTE='pa$$word@'
# https://github.com/motdotla/dotenv-expand/issues/80
DONT_CHOKE1='.kZh`>4[,[DDU-*Jt+[;8-,@K=,9%;F9KsoXqOE)gpG^X!{)Q+/9Fc(QF}i[NEi!'

View File

@@ -293,7 +293,16 @@ t.test('handles two dollar signs followed by letter', ct => {
const testPath = 'tests/.env.expand'
const env = dotenvx.config({ path: testPath })
ct.equal(env.parsed.TWO_DOLLAR_SIGNS_FOLLOWED_BY_LETTER, 'pa$')
ct.equal(env.parsed.TWO_DOLLAR_SIGNS_FOLLOWED_BY_LETTER, 'pa$@')
ct.end()
})
t.test('handles two dollar signs followed by letter but single quoted', ct => {
const testPath = 'tests/.env.expand'
const env = dotenvx.config({ path: testPath })
ct.equal(env.parsed.TWO_DOLLAR_SIGNS_FOLLOWED_BY_LETTER_SINGLE_QUOTE, 'pa$$word@')
ct.end()
})