Entry: scripts/run-bin.mjs Preload shim (must load first): scripts/run-bin-prelude.mjs Harness: scripts/lib/run-bin-harness.mjs Usage: node scripts/run-bin.mjs ls -la /bin node scripts/run-bin.mjs cat /etc/passwd node scripts/run-bin.mjs --cmd sed -n '1,5p' /home/user/note.txt node scripts/run-bin.mjs --json echo "hello" printf 'a\nb\n' | node scripts/run-bin.mjs cat npm run test:coreutils -- --suite basic npm run test:coreutils -- --build --watch -- echo test # rebuild + watch src/<cmd>.js (use `--buil
52 lines
933 B
JSON
52 lines
933 B
JSON
{
|
|
"schema": 1,
|
|
"cases": [
|
|
{
|
|
"id": "echo-text",
|
|
"argv": ["echo", "bare-os-run-bin"],
|
|
"expect": {
|
|
"exitCode": 0,
|
|
"stdoutIncludes": "bare-os-run-bin"
|
|
}
|
|
},
|
|
{
|
|
"id": "pwd-root",
|
|
"argv": ["pwd"],
|
|
"expect": {
|
|
"exitCode": 0,
|
|
"stdoutIncludes": "/"
|
|
}
|
|
},
|
|
{
|
|
"id": "true-exit",
|
|
"argv": ["true"],
|
|
"expect": {
|
|
"exitCode": 0
|
|
}
|
|
},
|
|
{
|
|
"id": "false-exit",
|
|
"argv": ["false"],
|
|
"expect": {
|
|
"exitCode": 1
|
|
}
|
|
},
|
|
{
|
|
"id": "cat-note",
|
|
"argv": ["cat", "/home/user/note.txt"],
|
|
"expect": {
|
|
"exitCode": 0,
|
|
"stdoutIncludes": "hello from fixture layout"
|
|
}
|
|
},
|
|
{
|
|
"id": "grep-home",
|
|
"argv": ["grep", "hello", "/home/user/note.txt"],
|
|
"expect": {
|
|
"exitCode": 0,
|
|
"stdoutIncludes": "hello"
|
|
}
|
|
}
|
|
]
|
|
}
|