Skip to content

Commit

Permalink
env() objects even work inside quote strings
Browse files Browse the repository at this point in the history
  • Loading branch information
James Halliday committed May 13, 2013
1 parent 914a1a9 commit 16139f5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion test/env_fn.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@ var test = require('tape');
var parse = require('../').parse;

test('functional env expansion', function (t) {
t.plan(3);
t.plan(4);

t.same(parse('a $XYZ c', getEnv), [ 'a', 'xxx', 'c' ]);
t.same(parse('a $XYZ c', getEnvObj), [ 'a', { op: '@@' }, 'c' ]);
t.same(parse('a${XYZ}c', getEnvObj), [ 'a', { op: '@@' }, 'c' ]);
t.same(parse('"a $XYZ c"', getEnvObj), [ 'a ', { op: '@@' }, ' c' ]);

function getEnv (key) {
return 'xxx';
Expand Down

0 comments on commit 16139f5

Please sign in to comment.