securityos/node_modules/shell-parse/tests/pipes.js

38 lines
770 B
JavaScript
Raw Normal View History

2024-09-06 15:32:35 +00:00
var test = require('tape')
var parse = require('../parser')
test('long example', function (t) {
t.deepEqual(parse("first | second"), [
{
"type": "command",
"command": {
"type": "literal",
"value": "first"
},
"args": [],
"redirects": [
{
"type": "pipe",
"command": {
"type": "command",
"command": {
"type": "literal",
"value": "second"
},
"args": [],
"redirects": [],
"env": {},
"control": ";",
"next": null
}
}
],
"env": {},
"control": ";",
"next": null
},
], "pipe operators are treated as redirects")
t.end()
})