Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/jsc/bindings/wtf-bindings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ extern "C" int uv_tty_reset_mode(void)

static void uv__tty_make_raw(struct termios* tio)
{
assert(tio != NULL);
ASSERT(tio != NULL);

#if defined __sun || defined __MVS__
/*
Expand Down
2 changes: 1 addition & 1 deletion src/semver/SemverQuery.rs
Original file line number Diff line number Diff line change
Expand Up @@ -722,7 +722,7 @@ pub fn parse(input: &[u8], sliced: SlicedString) -> Result<Group, AllocError> {
let mut token = Token::default();
let mut prev_token = Token::default();

let mut count: u8 = 0;
let mut count: u32 = 0;
Comment thread
robobun marked this conversation as resolved.
let mut skip_round;
let mut is_or = false;

Expand Down
17 changes: 16 additions & 1 deletion test/cli/install/semver.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
// IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

import { bunEnv, bunExe } from "harness";
import { unsortedPrereleases } from "./semver-fixture.js";
const { satisfies, order } = Bun.semver;

Expand Down Expand Up @@ -226,7 +227,7 @@ describe("Bun.semver.satisfies()", () => {
}
}
Bun.gc(true);
});
}, 30_000);

test("exact versions", () => {
testSatisfiesExact("1.2.3", "1.2.3", true);
Expand Down Expand Up @@ -738,3 +739,17 @@ describe("Bun.semver.satisfies()", () => {
expect(unsortedPrereleases.sort(Bun.semver.order)).toMatchSnapshot();
});
});

test("a version range with >=256 || comparators does not abort", async () => {
const range = Array(300).fill("1.0.0").join(" || ");
await using proc = Bun.spawn({
cmd: [bunExe(), "-e", `process.stdout.write(String(Bun.semver.satisfies("1.0.0", ${JSON.stringify(range)})))`],
env: bunEnv,
stdout: "pipe",
stderr: "pipe",
});
const [stdout, stderr, exitCode] = await Promise.all([proc.stdout.text(), proc.stderr.text(), proc.exited]);
expect(stdout).toBe("true");
if (exitCode !== 0) expect(stderr).toBe("");
expect(exitCode).toBe(0);
Comment thread
robobun marked this conversation as resolved.
Outdated
}, 30_000);
Loading