mirror of
https://github.com/anomalyco/opencode.git
synced 2026-08-27 03:51:21 -04:00
19 lines
613 B
TypeScript
19 lines
613 B
TypeScript
import { describe, expect, test } from "bun:test"
|
|
import { ShellScan } from "../../src/shell/scan.js"
|
|
|
|
describe("ShellScan structural mutation closure", () => {
|
|
test.each(['printf "unterminated', "printf ok &&", "| printf ok", "printf ok >"])(
|
|
"keeps malformed Bash input opaque: %s",
|
|
(source) => {
|
|
expect(ShellScan.scan(source).kind).toBe("opaque")
|
|
},
|
|
)
|
|
|
|
test.each(["Write-Output ok`", 'Write-Output "unterminated', "Get-ChildItem |"])(
|
|
"keeps incomplete PowerShell input opaque: %s",
|
|
(source) => {
|
|
expect(ShellScan.scanPowerShell(source).kind).toBe("opaque")
|
|
},
|
|
)
|
|
})
|