From e06ec920f7a5d784e674c4c4b4e6d1da3dc7391d Mon Sep 17 00:00:00 2001 From: Piotr Russ Date: Mon, 16 Nov 2020 00:10:28 +0100 Subject: api, login, auth --- node_modules/shell-quote/test/env_fn.js | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 node_modules/shell-quote/test/env_fn.js (limited to 'node_modules/shell-quote/test/env_fn.js') diff --git a/node_modules/shell-quote/test/env_fn.js b/node_modules/shell-quote/test/env_fn.js new file mode 100644 index 0000000..b9f3c20 --- /dev/null +++ b/node_modules/shell-quote/test/env_fn.js @@ -0,0 +1,19 @@ +var test = require('tape'); +var parse = require('../').parse; + +test('functional env expansion', function (t) { + 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'; + } + + function getEnvObj (key) { + return { op: '@@' }; + } +}); -- cgit v1.2.3