Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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: 0 additions & 2 deletions scripts/res/GenApiDocs.res
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,6 @@ type section = {
submodules: array<module_>,
}

let env = Process.env

let docsDecoded = entryPointFiles->Array.map(((packageName, libFile)) =>
try {
let entryPointFile = Path.join([
Expand Down
4 changes: 2 additions & 2 deletions tests/belt_tests/src/belt_list_test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -770,7 +770,7 @@ Mocha.describe("Belt_list_test", () => {
Test_utils.eq("File \"belt_list_test.res\", line 147, characters 7-14", Belt_List.take(length_10_id, 0), /* [] */0);
Test_utils.eq("File \"belt_list_test.res\", line 148, characters 7-14", Belt_List.take(length_8_id, -2), undefined);
});
Mocha.test("droo", () => {
Mocha.test("drop", () => {
Test_utils.eq("File \"belt_list_test.res\", line 152, characters 7-14", Belt_List.drop(length_10_id, 10), /* [] */0);
Test_utils.eq("File \"belt_list_test.res\", line 153, characters 7-14", Belt_List.drop(length_10_id, 8), {
hd: 8,
Expand Down Expand Up @@ -1962,7 +1962,7 @@ Mocha.describe("Belt_list_test", () => {
}
}) === 0);
});
Mocha.test("makeBy", () => {
Mocha.test("make equals makeBy", () => {
let makeTest = n => Test_utils.eq("File \"belt_list_test.res\", line 329, characters 27-34", Belt_List.make(n, 3), Belt_List.makeBy(n, param => 3));
makeTest(0);
makeTest(1);
Expand Down
4 changes: 2 additions & 2 deletions tests/belt_tests/src/belt_list_test.res
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ describe(__MODULE__, () => {
eq(__LOC__, N.take(length_8_id, -2), None)
})

test("droo", () => {
test("drop", () => {
eq(__LOC__, N.drop(length_10_id, 10), Some(list{}))
eq(__LOC__, N.drop(length_10_id, 8), Some(list{8, 9}))
eq(__LOC__, N.drop(length_10_id, 0), Some(length_10_id))
Expand Down Expand Up @@ -325,7 +325,7 @@ describe(__MODULE__, () => {
ok(__LOC__, N.cmpByLength(list{1, 3}, list{1, 2}) == 0)
})

test("makeBy", () => {
test("make equals makeBy", () => {
let makeTest = n => eq(__LOC__, N.make(n, 3), N.makeBy(n, _ => 3))

makeTest(0)
Expand Down
2 changes: 1 addition & 1 deletion tests/belt_tests/src/bs_map_set_dict_test.res
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ describe(__MODULE__, () => {
})

test("map_set_dict_tests", () => {
// All tests are already run as standalone assertions above
// The top-level blocks above only log their results
ok(__LOC__, true)
})
})
2 changes: 1 addition & 1 deletion tests/belt_tests/src/list_test.res
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ describe(__MODULE__, () => {
})

test("length2", () => {
eq(__LOC__, 5, List.length(list{0, 1, 2, 3, 4})) /* This is tuple haha */
eq(__LOC__, 5, List.length(list{0, 1, 2, 3, 4}))
})

test("long_length", () => {
Expand Down
21 changes: 0 additions & 21 deletions tests/belt_tests/src/test_for_map.mjs

This file was deleted.

12 changes: 0 additions & 12 deletions tests/belt_tests/src/test_for_map.res

This file was deleted.

6 changes: 0 additions & 6 deletions tests/belt_tests/src/test_utils.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,9 @@ function throws(loc, f) {
Nodeassert.throws(f, undefined, loc);
}

function approxEq(loc, threshold, a, b) {
let diff = Math.abs(a - b);
Nodeassert.ok(diff <= threshold, loc);
}

export {
ok,
eq,
throws,
approxEq,
}
/* node:assert Not a pure module */
5 changes: 0 additions & 5 deletions tests/belt_tests/src/test_utils.res
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
let ok = (loc, a) => Node_assert.ok(a, ~message=loc)
let eq = (loc, a, b) => Node_assert.deepEqual(a, b, ~message=loc)
let throws = (loc, f) => Node_assert.throws(f, ~message=loc)

let approxEq = (loc, threshold, a, b) => {
let diff = Math.abs(a -. b)
Node_assert.ok(diff <= threshold, ~message=loc)
}
2 changes: 1 addition & 1 deletion tests/belt_tests/src/ticker.res
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ module Ticker_map = Map.String
algorithm (lowest rank for the deepest nodes).

We then collect all the tickers which depends on each of the
market tickers and finally we `sort_uniq` that list by rank to
market tickers and finally we sort that list by rank to
guarantee that a composite ticker is update only once and in
the correct order.
*/
Expand Down
8 changes: 3 additions & 5 deletions tests/docstring_tests/Node.res
Original file line number Diff line number Diff line change
@@ -1,20 +1,16 @@
module Path = {
@module("node:path") external join2: (string, string) => string = "join"
@module("node:path") @variadic external join: array<string> => string = "join"
@module("node:path") external dirname: string => string = "dirname"
}

module Process = {
@scope("process") external cwd: unit => string = "cwd"
@scope("process") @val external version: string = "version"
@scope("process") @val external argv: array<string> = "argv"
@scope("process") external exit: int => unit = "exit"
@scope("process") external env: Dict.t<string> = "env"
}

module Fs = {
@module("node:fs") external readdirSync: string => array<string> = "readdirSync"
@module("node:fs/promises") external writeFile: (string, string) => promise<unit> = "writeFile"
// existsSync, mkdirSync, writeFileSync and readFileSync are used by scripts/res/GenApiDocs.res
@module("node:fs") external existsSync: string => bool = "existsSync"
@module("node:fs") external mkdirSync: string => unit = "mkdirSync"
@module("node:fs") external writeFileSync: (string, string) => unit = "writeFileSync"
Expand All @@ -36,6 +32,7 @@ module ChildProcess = {
@send external on: (readable, string, Buffer.t => unit) => unit = "on"
@send
external once: (spawnReturns, string, (Null.t<float>, Null.t<string>) => unit) => unit = "once"
// execSync is used by scripts/res/GenApiDocs.res
type execSyncOptions = {maxBuffer?: float}
@module("child_process")
external execSync: (string, ~options: execSyncOptions=?) => Buffer.t = "execSync"
Expand All @@ -51,4 +48,5 @@ module URL = {
}

@val @scope(("import", "meta")) external url: string = "url"
// dirname is used by scripts/res/GenApiDocs.res
@val @scope(("import", "meta")) external dirname: string = "dirname"
57 changes: 0 additions & 57 deletions tests/tests/src/DerivingAccessorsUncurried.mjs

This file was deleted.

21 changes: 0 additions & 21 deletions tests/tests/src/DerivingAccessorsUncurried.res

This file was deleted.

3 changes: 0 additions & 3 deletions tests/tests/src/DotDotDot.res
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,6 @@ type svgProps = {

let x: svgProps = {x: "test", name: "test"}

// uncomment this to reveal a parser error
// type copiedSvgProps = {...svgProps}

module MultipleDotDotDots = {
type t1 = {x: int}
type t2 = {y: string}
Expand Down
3 changes: 0 additions & 3 deletions tests/tests/src/a_scope_bug.res
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
/** FIXME: the inner
[even ] is printed as [even] while global [even] is printed as [even$1]
*/
let rec odd = z => {
let a = {
let even = z
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ function f3(x) {
return (y, z) => (x + y | 0) + z | 0;
}

Mocha.describe("Arity_deopt", () => {
Mocha.describe("Arity_deopt_test", () => {
Mocha.test("arity_deopt_tests", () => {
Test_utils.eq("File \"arity_deopt.res\", line 43, characters 7-14", 6, 6);
Test_utils.eq("File \"arity_deopt.res\", line 44, characters 7-14", 6, 6);
Test_utils.eq("File \"arity_deopt.res\", line 45, characters 7-14", 6, 6);
Test_utils.eq("File \"arity_deopt.res\", line 46, characters 7-14", 6, 6);
Test_utils.eq("File \"arity_deopt_test.res\", line 43, characters 7-14", 6, 6);
Test_utils.eq("File \"arity_deopt_test.res\", line 44, characters 7-14", 6, 6);
Test_utils.eq("File \"arity_deopt_test.res\", line 45, characters 7-14", 6, 6);
Test_utils.eq("File \"arity_deopt_test.res\", line 46, characters 7-14", 6, 6);
});
});

Expand Down
File renamed without changes.
1 change: 0 additions & 1 deletion tests/tests/src/bs_auto_uncurry.res
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ let f_02 = xs =>
Console.log("x")
})
let f_03 = (xs, u) => hi(u)
/* arity adjust to [0] [ function (){return u (0)}] */

let h = (x, y, z) => map2(x, y, z)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ let h = (v.contents = v.contents + 1 | 0, {

let z = (v.contents = v.contents + 1 | 0, "Float", add(3.0, 2.0));

Mocha.describe("Bs_ignore_effect", () => {
Mocha.test("ignore effect 1", () => Test_utils.eq("File \"bs_ignore_effect.res\", line 29, characters 35-42", v.contents, 2));
Mocha.test("ignore effect 2", () => Test_utils.eq("File \"bs_ignore_effect.res\", line 30, characters 35-42", z, 5.0));
Mocha.describe("Bs_ignore_effect_test", () => {
Mocha.test("ignore effect 1", () => Test_utils.eq("File \"bs_ignore_effect_test.res\", line 29, characters 35-42", v.contents, 2));
Mocha.test("ignore effect 2", () => Test_utils.eq("File \"bs_ignore_effect_test.res\", line 30, characters 35-42", z, 5.0));
});

export {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ function f(xOpt, y) {
return xOpt$1 + y | 0;
}

Mocha.describe("Test_case_opt_collision", () => {
Mocha.describe("Case_opt_collision_test", () => {
Mocha.test("optional parameter collision", () => {
console.log(f(undefined, 2));
Test_utils.eq("File \"test_case_opt_collision.res\", line 13, characters 7-14", f(undefined, 2), 7);
Test_utils.eq("File \"test_case_opt_collision.res\", line 14, characters 7-14", f(4, 2), 8);
Test_utils.eq("File \"case_opt_collision_test.res\", line 13, characters 7-14", f(undefined, 2), 7);
Test_utils.eq("File \"case_opt_collision_test.res\", line 14, characters 7-14", f(4, 2), 8);
});
});

Expand Down
16 changes: 0 additions & 16 deletions tests/tests/src/conditional/cond_a_C.mjs

This file was deleted.

6 changes: 0 additions & 6 deletions tests/tests/src/conditional/cond_a_C.res

This file was deleted.

9 changes: 0 additions & 9 deletions tests/tests/src/conditional/cond_c.mjs

This file was deleted.

1 change: 0 additions & 1 deletion tests/tests/src/conditional/cond_c.res

This file was deleted.

2 changes: 0 additions & 2 deletions tests/tests/src/debug_tmp.mjs

This file was deleted.

21 changes: 0 additions & 21 deletions tests/tests/src/debug_tmp.res

This file was deleted.

12 changes: 11 additions & 1 deletion tests/tests/src/flexible_array_test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,17 @@ let x$1 = sort(of_array(v));

let y = Stdlib_Array.fromInitializer(500, i => i + 1 | 0);

Primitive_object.equal(x$1, of_array(y));
if (!Primitive_object.equal(x$1, of_array(y))) {
throw {
RE_EXN_ID: "Assert_failure",
_1: [
"flexible_array_test.res",
187,
2
],
Error: new Error()
};
}

export {
sub,
Expand Down
Loading
Loading