Skip to content

Commit

Permalink
failing tests for unimplemented env interpolation
Browse files Browse the repository at this point in the history
  • Loading branch information
James Halliday committed Apr 15, 2013
1 parent 9d7b727 commit 590534a
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions test/env.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
var test = require('tap').test;
var parse = require('../').parse;

test('expand environment variables', function (t) {
t.same(parse('a $XYZ c', { XYZ: 'b' }), [ 'a', 'b', 'c' ]);
t.same(parse('a${XYZ}c', { XYZ: 'b' }), [ 'abc' ]);
t.same(parse('a${XYZ}c $XYZ', { XYZ: 'b' }), [ 'abcb' ]);
t.same(parse('"_$X-$Y_"', { X: 'a', Y: 'b' }), [ '_a-b_' ]);
t.same(parse("'_$X-$Y_'", { X: 'a', Y: 'b' }), [ '_$X-$Y_' ]);
t.same(parse('qrs"$zzz"wxy', { zzz: 'tuv' }), [ 'qrstuvwxy' ]);
t.same(parse("qrs'$zzz'wxy", { zzz: 'tuv' }), [ 'qrs$zzzwxy' ]);
t.same(parse("qrs${zzz}wxy"), [ 'qrswxy' ]);
t.same(parse("ab$x", { x: 'c' }), [ 'abc' ]);
t.same(parse("ab\\$x", { x: 'c' }), [ 'ab$x' ]);
t.same(parse("ab${x}def", { x: 'c' }), [ 'abcdef' ]);
t.same(parse("ab\\${x}def", { x: 'c' }), [ 'ab${x}def' ]);

t.end();
});

0 comments on commit 590534a

Please sign in to comment.