From 0190973194f5317482fea3b8bb968dad68e50bd6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20V=C3=A1zquez=20Acosta?= Date: Fri, 2 Oct 2026 13:20:40 +0000 Subject: [PATCH 1/2] Forward-port integer range regression tests to v13 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Port the ReScript regression test from #8714 unchanged and regenerate the JavaScript snapshot with the v13 compiler. The compiler already handles these patterns correctly after removing Pisout. Original-commit: 54ab8075cc6ce57b1b5e477e691af5ce6dbd1075 Co-Authored-By: Claude Opus 5.5 (1M context) Signed-off-by: Manuel Vázquez Acosta Signed-off-by: Florian Hammerschmidt --- tests/tests/src/or_pattern_int_range_test.mjs | 36 +++++++++++++++++++ tests/tests/src/or_pattern_int_range_test.res | 20 +++++++++++ 2 files changed, 56 insertions(+) create mode 100644 tests/tests/src/or_pattern_int_range_test.mjs create mode 100644 tests/tests/src/or_pattern_int_range_test.res diff --git a/tests/tests/src/or_pattern_int_range_test.mjs b/tests/tests/src/or_pattern_int_range_test.mjs new file mode 100644 index 00000000000..1864d567b8e --- /dev/null +++ b/tests/tests/src/or_pattern_int_range_test.mjs @@ -0,0 +1,36 @@ +// Generated by ReScript, PLEASE EDIT WITH CARE + +import * as Mocha from "mocha"; +import * as Test_utils from "./test_utils.mjs"; + +function isRetriable(error) { + let match = error.status; + return !(match > 504 || match < 502); +} + +Mocha.describe("Or_pattern_int_range_test", () => { + Mocha.test("int range on record field", () => Test_utils.eq("File \"or_pattern_int_range_test.res\", line 15, characters 6-13", [ + 404, + 500, + 501, + 502, + 503, + 504, + 505 + ].map(status => isRetriable({ + status: status + })), [ + false, + false, + false, + true, + true, + true, + false + ])); +}); + +export { + isRetriable, +} +/* Not a pure module */ diff --git a/tests/tests/src/or_pattern_int_range_test.res b/tests/tests/src/or_pattern_int_range_test.res new file mode 100644 index 00000000000..90735ac135e --- /dev/null +++ b/tests/tests/src/or_pattern_int_range_test.res @@ -0,0 +1,20 @@ +open Mocha +open Test_utils + +type response = {status: int} + +let isRetriable = error => + switch error { + | {status: 502 | 503 | 504} => true + | _ => false + } + +describe(__MODULE__, () => { + test("int range on record field", () => { + eq( + __LOC__, + [404, 500, 501, 502, 503, 504, 505]->Array.map(status => isRetriable({status: status})), + [false, false, false, true, true, true, false], + ) + }) +}) From c452ac229e2ef8990e02f50c6916fbe26669b974 Mon Sep 17 00:00:00 2001 From: Florian Hammerschmidt Date: Fri, 2 Oct 2026 19:26:35 +0200 Subject: [PATCH 2/2] Document v13 integer range regression coverage Signed-off-by: Florian Hammerschmidt --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 54012b56111..37c7ba1ebcd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -33,6 +33,7 @@ #### :house: Internal +- Forward-port integer range pattern regression coverage from v12 to v13. https://github.com/rescript-lang/rescript/pull/8718 - Represent inline record definitions with an explicit parsetree origin while retaining the existing PPX wire representation. https://github.com/rescript-lang/rescript/pull/8686 - Make expression attributes immutable in the current parsetree, now that editor refactors construct new expression nodes. https://github.com/rescript-lang/rescript/pull/8685 - Remove the unused `pat_record_label` alias from the current parsetree. https://github.com/rescript-lang/rescript/pull/8684