mirror of
https://github.com/morluto/rea.git
synced 2026-10-26 17:35:11 +00:00
test(erlang): reject an empty BEAM path at the CLI
NUL paths cannot be passed through process spawn, so the shared NUL rule stays covered by the public schema and service tests. Co-authored-by: morluto <morluto@users.noreply.github.com>
This commit is contained in:
1 file changed
+7
-9
@@ -42,16 +42,14 @@ cliTest(
|
||||
},
|
||||
);
|
||||
|
||||
cliTest("rejects empty and NUL BEAM paths before reading", async ({ cli }) => {
|
||||
cliTest("rejects an empty BEAM path before reading", async ({ cli }) => {
|
||||
const root = await createTestTempDirectory("rea-beam-cli-path-");
|
||||
for (const path of ["", "app\0.beam"]) {
|
||||
const result = await cli.run({
|
||||
arguments: ["inspect-erlang-beam", path, "--json"],
|
||||
cwd: root,
|
||||
});
|
||||
expect(result.exitCode, result.stderr).not.toBe(0);
|
||||
expect(result.stdout).not.toContain("sha256");
|
||||
}
|
||||
const result = await cli.run({
|
||||
arguments: ["inspect-erlang-beam", "", "--json"],
|
||||
cwd: root,
|
||||
});
|
||||
expect(result.exitCode, result.stderr).not.toBe(0);
|
||||
expect(result.stdout).not.toContain("sha256");
|
||||
});
|
||||
|
||||
cliTest("reports a truncated BEAM as invalid input", async ({ cli }) => {
|
||||
|
||||
Reference in new issue
Block a user