source: frontend/node_modules/shell-quote/test/env_fn.js

Last change on this file was 9af201e, checked in by MBK <marija.karapandzova@…>, 12 days ago

Fix frontend appearance

  • Property mode set to 100644
File size: 483 bytes
RevLine 
[9af201e]1'use strict';
2
3var test = require('tape');
4var parse = require('../').parse;
5
6function getEnv() {
7 return 'xxx';
8}
9
10function getEnvObj() {
11 return { op: '@@' };
12}
13
14test('functional env expansion', function (t) {
15 t.plan(4);
16
17 t.same(parse('a $XYZ c', getEnv), ['a', 'xxx', 'c']);
18 t.same(parse('a $XYZ c', getEnvObj), ['a', { op: '@@' }, 'c']);
19 t.same(parse('a${XYZ}c', getEnvObj), ['a', { op: '@@' }, 'c']);
20 t.same(parse('"a $XYZ c"', getEnvObj), ['a ', { op: '@@' }, ' c']);
21});
Note: See TracBrowser for help on using the repository browser.