Skip to content

Commit

Permalink
test: push 7114 regression test
Browse files Browse the repository at this point in the history
  • Loading branch information
renanmav committed Nov 9, 2024
1 parent c02fbfe commit b97ff56
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions test/regression/issue/07114.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import { expect, test } from "bun:test";
import { bunEnv, bunExe, tempDirWithFiles } from "harness";

test("short flags should be properly parsed", () => {
const dir = tempDirWithFiles("07114", {
"package.json": JSON.stringify({
name: "short-flags-test",
version: "0.0.0",
}),
});

// Test single short flag
const singleFlag = Bun.spawnSync({
cmd: [bunExe(), "-t"],
cwd: dir,
env: bunEnv,
stderr: "pipe",
});
expect(singleFlag.stderr.toString()).not.toContain("Invalid argument '-t'");

// Test multiple combined short flags
const multipleFlags = Bun.spawnSync({
cmd: [bunExe(), "-abc"],
cwd: dir,
env: bunEnv,
stderr: "pipe",
});
expect(multipleFlags.stderr.toString()).not.toContain("Invalid argument");

// Test short flag with value
const flagWithValue = Bun.spawnSync({
cmd: [bunExe(), "-p", "3000"],
cwd: dir,
env: bunEnv,
stderr: "pipe",
});
expect(flagWithValue.stderr.toString()).not.toContain("Invalid argument '-p'");
});

0 comments on commit b97ff56

Please sign in to comment.