From 51649b9c3f05250e118060280189d2799430e129 Mon Sep 17 00:00:00 2001 From: Antonio Nuno Monteiro Date: Tue, 25 Jul 2023 16:45:04 -0700 Subject: [PATCH] chore: remove `.res` tests --- jscomp/test/re_or_res/gh_161.res | 9 -- jscomp/test/re_or_res/gpr_4931_allow.res | 8 -- jscomp/test/re_or_res/gpr_5312.res | 10 -- jscomp/test/re_or_res/hello_res.res | 4 - jscomp/test/re_or_res/hello_res.resi | 1 - jscomp/test/re_or_res/inline_map_demo.res | 140 -------------------- jscomp/test/re_or_res/record_regression.res | 75 ----------- jscomp/test/re_or_res/res_debug.res | 50 ------- jscomp/test/re_or_res/rescript_compat.res | 8 -- jscomp/test/re_or_res/then_mangle_test.res | 17 --- jscomp/test/re_or_res/unboxed_attribute.res | 4 - 11 files changed, 326 deletions(-) delete mode 100644 jscomp/test/re_or_res/gh_161.res delete mode 100644 jscomp/test/re_or_res/gpr_4931_allow.res delete mode 100644 jscomp/test/re_or_res/gpr_5312.res delete mode 100644 jscomp/test/re_or_res/hello_res.res delete mode 100644 jscomp/test/re_or_res/hello_res.resi delete mode 100644 jscomp/test/re_or_res/inline_map_demo.res delete mode 100644 jscomp/test/re_or_res/record_regression.res delete mode 100644 jscomp/test/re_or_res/res_debug.res delete mode 100644 jscomp/test/re_or_res/rescript_compat.res delete mode 100644 jscomp/test/re_or_res/then_mangle_test.res delete mode 100644 jscomp/test/re_or_res/unboxed_attribute.res diff --git a/jscomp/test/re_or_res/gh_161.res b/jscomp/test/re_or_res/gh_161.res deleted file mode 100644 index 662bb0aac4..0000000000 --- a/jscomp/test/re_or_res/gh_161.res +++ /dev/null @@ -1,9 +0,0 @@ -module X = { - type t = { id : int } -} - -// https://github.com/melange-re/melange/pull/161 -let builds_in_melange = () => { - let { id } = { X.id: 0 } - id -} diff --git a/jscomp/test/re_or_res/gpr_4931_allow.res b/jscomp/test/re_or_res/gpr_4931_allow.res deleted file mode 100644 index 4363f9dbb5..0000000000 --- a/jscomp/test/re_or_res/gpr_4931_allow.res +++ /dev/null @@ -1,8 +0,0 @@ - -%%raw(` -if(import.meta.hot) { - import.meta.hot.accept(); -}else{ - console.log("ok") -}`) - diff --git a/jscomp/test/re_or_res/gpr_5312.res b/jscomp/test/re_or_res/gpr_5312.res deleted file mode 100644 index c86e1bf6bf..0000000000 --- a/jscomp/test/re_or_res/gpr_5312.res +++ /dev/null @@ -1,10 +0,0 @@ -@@config({flags : ["-dsource", "-w", "-103"]}) -module type MyModule = { - type t - @bs.send.pipe(: t) external someFunction: (string, string) => unit = "someFunction" -} - -module MyModule: MyModule = { - type t - @bs.send.pipe(: t) external someFunction: (string, string) => unit = "someFunction" -} \ No newline at end of file diff --git a/jscomp/test/re_or_res/hello_res.res b/jscomp/test/re_or_res/hello_res.res deleted file mode 100644 index df77c24d46..0000000000 --- a/jscomp/test/re_or_res/hello_res.res +++ /dev/null @@ -1,4 +0,0 @@ - -let b = List.length(list{1,2,3}) -let a = b - 1 -Js.log ("hello, res") \ No newline at end of file diff --git a/jscomp/test/re_or_res/hello_res.resi b/jscomp/test/re_or_res/hello_res.resi deleted file mode 100644 index f561459817..0000000000 --- a/jscomp/test/re_or_res/hello_res.resi +++ /dev/null @@ -1 +0,0 @@ -let a : int \ No newline at end of file diff --git a/jscomp/test/re_or_res/inline_map_demo.res b/jscomp/test/re_or_res/inline_map_demo.res deleted file mode 100644 index dab5033643..0000000000 --- a/jscomp/test/re_or_res/inline_map_demo.res +++ /dev/null @@ -1,140 +0,0 @@ -@@config({no_export: no_export, flags: ["-w", "@A-70"]}) - -let compare = (x: int, y: int) => compare(x, y) - - -type rec t<'a> = - | Empty - | Node(t<'a>, int, 'a, t<'a>, int) - -let height = x => - switch x { - | Empty => 0 - | Node(_, _, _, _, h) => h - } - -let create = (l, x, d, r) => { - let hl = height(l) and hr = height(r) - Node( - l, - x, - d, - r, - if hl >= hr { - hl + 1 - } else { - hr + 1 - }, - ) -} - -let bal = (l, x, d, r) => { - let hl = switch l { - | Empty => 0 - | Node(_, _, _, _, h) => h - } - let hr = switch r { - | Empty => 0 - | Node(_, _, _, _, h) => h - } - if hl > hr + 2 { - switch l { - | Empty => assert false - | Node(ll, lv, ld, lr, _) => - if height(ll) >= height(lr) { - create(ll, lv, ld, create(lr, x, d, r)) - } else { - switch lr { - | Empty => assert false - | Node(lrl, lrv, lrd, lrr, _) => - create(create(ll, lv, ld, lrl), lrv, lrd, create(lrr, x, d, r)) - } - } - } - } else if hr > hl + 2 { - switch r { - | Empty => assert false - | Node(rl, rv, rd, rr, _) => - if height(rr) >= height(rl) { - create(create(l, x, d, rl), rv, rd, rr) - } else { - switch rl { - | Empty => assert false - | Node(rll, rlv, rld, rlr, _) => - create(create(l, x, d, rll), rlv, rld, create(rlr, rv, rd, rr)) - } - } - } - } else { - Node( - l, - x, - d, - r, - if hl >= hr { - hl + 1 - } else { - hr + 1 - }, - ) - } -} - -let rec add = (x, data, tree) => - switch tree { - | Empty => Node(Empty, x, data, Empty, 1) - | Node(l, v, d, r, h) => - let c = compare(x, v) - if c == 0 { - Node(l, x, data, r, h) - } else if c < 0 { - bal(add(x, data, l), v, d, r) - } else { - bal(l, v, d, add(x, data, r)) - } - } - -let empty = Empty - -/* Beware: those two functions assume that the added k is *strictly* - smaller (or bigger) than all the present keys in the tree; it - does not test for equality with the current min (or max) key. - - Indeed, they are only used during the "join" operation which - respects this precondition. -*/ - -/* Same as create and bal, but no assumptions are made on the - relative heights of l and r. */ - -/* Merge two trees l and r into one. - All elements of l must precede the elements of r. - No assumption on the heights of l and r. */ - -/* end */ -let m = List.fold_left( - (acc, (k, v)) => add(k, v, acc), - empty, - list{(10, 'a'), (3, 'b'), (7, 'c'), (20, 'd')}, -) - -let rec find = (px, x) => - switch x { - | Empty => raise(Not_found) - | Node(l, v, d, r, _) => - let c = compare(px, v) - if c == 0 { - d - } else { - find( - px, - if c < 0 { - l - } else { - r - }, - ) - } - } - -Mt.from_pair_suites(__MODULE__, list{("find", _ => Mt.Eq(find(10, m), 'a'))}) diff --git a/jscomp/test/re_or_res/record_regression.res b/jscomp/test/re_or_res/record_regression.res deleted file mode 100644 index a37a2fde37..0000000000 --- a/jscomp/test/re_or_res/record_regression.res +++ /dev/null @@ -1,75 +0,0 @@ -@@config({flags: ["-bs-diagnose"] }) - -@obj -type t0 = {x: int, y: option, z: int} - -// let f0 = { x : 3 ,y : None} - -let f1 = {x: 3, z: 2} - -type r = { - x: int, - y: option, - z: int, -} - -// let v0 = { x : 3 , z : 2 } - -// let v2 = { ... v0 , x : 3 } - -let v1: t0 = { - x: 3, - z: 3, -} - -let v2: r = {x: 3, y: None, z: 2} - -@obj -type config = { - x: int, - y0: option, - y1: option, - y2: option, - y3: option, - y4: option, - y5: option, - y6: option, - y7: option, - y8: option, - y9: option, - y10: option, - y11: option, - y12: option, - y13: option, - y14: option, - y15: option, - y16: option, - y17: option, - y18: option, - y19: option, - y20: option, - y21: option, - y22: option, - y23: option, - z: int, -} - -let v: config = {x: 2, z: 3} - -let h: config = {...v, y1: Some(22)} - -@obj -type small_config = { - x: int, - y0: option, - y1: option, - z: int, -} - -let v1: small_config = {x: 2, z: 3} - -let h10: small_config = {...v1, y1: Some(22)} - -let h11 = (v1) : small_config => { - { ... v1, y1 : Some(22)} -} \ No newline at end of file diff --git a/jscomp/test/re_or_res/res_debug.res b/jscomp/test/re_or_res/res_debug.res deleted file mode 100644 index 19fb9ea329..0000000000 --- a/jscomp/test/re_or_res/res_debug.res +++ /dev/null @@ -1,50 +0,0 @@ -@@config({ - flags: [ - /* "-w"; - "@A" */ - /* "-drawlambda"; */ - /* "-dtypedtree"; */ - /* "-bs-diagnose"; */ - "-dparsetree", - /* "-dsource"; */ - ], -}) -type t = { x : int, y : int} - -// let f = (x,y) => { -// let {} = {x,y} -// x + y -// } - - -let u = #0 - -let f = (window, a, b) => { - window["location"](. a, b) -} - -// let h = () => { -// // external hi : int => int = "hi" -// let h = 3 -// h - -// } - -@obj -type r = { - x: int, - y: option < int>, - z : int -} - -let v0 = { x : 3 , z : 2 } - - - - -let v2 = { ... v0 , x : 3 } - -let v1 : r = { x : 3 - , z : 3 -} -// failed to type check diff --git a/jscomp/test/re_or_res/rescript_compat.res b/jscomp/test/re_or_res/rescript_compat.res deleted file mode 100644 index bd2a75a672..0000000000 --- a/jscomp/test/re_or_res/rescript_compat.res +++ /dev/null @@ -1,8 +0,0 @@ -@obj -type t = { - @get @set - "some_prop": unit => unit, -} - -let set_onreadystatechange = (cb: unit => unit, x: t): unit => - x["some_prop"] = cb diff --git a/jscomp/test/re_or_res/then_mangle_test.res b/jscomp/test/re_or_res/then_mangle_test.res deleted file mode 100644 index dcc8fa8f17..0000000000 --- a/jscomp/test/re_or_res/then_mangle_test.res +++ /dev/null @@ -1,17 +0,0 @@ -@@config({no_export}) - -let suites : ref = ref (list{}) -let test_id = ref(0) - -let {eq_suites} = module (Mt) -let eq = (loc,x,y) => eq_suites(loc,x,y,~test_id,~suites) - -let then = (a,b)=>{ - Js.log("no inline") - a*a+b*b -} - -eq(__LOC__,then(1,2),5) - - -Mt.from_pair_suites(__FILE__ ,suites.contents) \ No newline at end of file diff --git a/jscomp/test/re_or_res/unboxed_attribute.res b/jscomp/test/re_or_res/unboxed_attribute.res deleted file mode 100644 index cea831c6f7..0000000000 --- a/jscomp/test/re_or_res/unboxed_attribute.res +++ /dev/null @@ -1,4 +0,0 @@ -type rec func<'a, 'b, 'i> = ('i => res<'a, 'b, 'i>) -@unboxed and res<'a, 'b, 'i> = Val(('b, func<'a, 'b, 'i>)) - -let rec u = _ => Val(3, u) \ No newline at end of file