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: 1 addition & 1 deletion tests/build_tests/transitive_dependency/a/src/src.res
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Js.Console.log("src")
Console.log("src")
6 changes: 3 additions & 3 deletions tests/tests/src/DictInternalRepresentation.res
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ let foo = () => {
| dict{"first": first} => first ++ "2"
| _ => "hello"
}
Js.log(first)
Console.log(first)
let second = switch intDict {
| dict{"first": first} => first + 2
| _ => 1
}
Js.log(second)
Console.log(second)
let third = switch stringDict {
| dict{"first": first} => first ++ "2"
| _ => "hello"
}
Js.log(third)
Console.log(third)
}
4 changes: 2 additions & 2 deletions tests/tests/src/Import.res
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ let eachIntAsync = async (list: list<int>, f: int => unit) => {
let eachIntLazy = (list: list<int>, f: int => unit) =>
Js.Promise.then_(each => list->each(f)->Js.Promise.resolve, Js.import(Belt.List.forEach))

let _ = list{1, 2, 3}->eachIntLazy(n => Js.log2("lazy", n))
let _ = list{1, 2, 3}->eachIntAsync(n => Js.log2("async", n))
let _ = list{1, 2, 3}->eachIntLazy(n => Console.log2("lazy", n))
let _ = list{1, 2, 3}->eachIntAsync(n => Console.log2("async", n))

module type BeltList = module type of Belt.List
let beltAsModule = await Js.import(module(Belt.List: BeltList))
Expand Down
4 changes: 2 additions & 2 deletions tests/tests/src/ImportAttributes.res
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
@module({from: "./myJson.json", with: {type_: "json", \"some-identifier": "yep"}})
external myJson: Js.Json.t = "default"

Js.log(myJson)
Console.log(myJson)

@module({from: "./myCss.css", with: {type_: "css", \"some-identifier": "yep"}})
external buttonCss: string = "button"

Js.log(buttonCss)
Console.log(buttonCss)
8 changes: 4 additions & 4 deletions tests/tests/src/SafePromises.res
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,18 @@
let nestedPromise = async (xxx: promise<promise<int>>) => {
let xx = await xxx

let _ = xx->Js.Promise2.then(x => Js.Promise.resolve(Js.log2("Promise2.then", x)))
let _ = xx->Js.Promise2.then(x => Js.Promise.resolve(Console.log2("Promise2.then", x)))
let _ = xx->Js.Promise2.catch(x => {
Js.log2("Promise2.catch_", x)
Console.log2("Promise2.catch_", x)
Js.Promise.resolve(0)
})

// This crashes
let _ = Js.Promise.then_(x => Js.Promise.resolve(Js.log2("Promise.then_", x)), xx)
let _ = Js.Promise.then_(x => Js.Promise.resolve(Console.log2("Promise.then_", x)), xx)
}

let create = async x => {
Js.log2("create", x)
Console.log2("create", x)
x
}

Expand Down
18 changes: 9 additions & 9 deletions tests/tests/src/UncurriedAlways.res
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ let w = 3->foo(4)

let a = 3->foo(4)

Js.log(a) // Test automatic uncurried application
Console.log(a) // Test automatic uncurried application

let _ = Js.Array2.map([1], x => x + 1)

Expand All @@ -39,7 +39,7 @@ module AllLabels = {
let ptl = foo(~y="y", ...)

let a1 = ptl(~x="x", ~z="z")
Js.log2("a1:", a1)
Console.log2("a1:", a1)
}

module OptAtEnd = {
Expand All @@ -48,9 +48,9 @@ module OptAtEnd = {
let ptl = foo(~y="y", ...)

let b1 = ptl(~x="x", ~z="z")
Js.log2("b1:", b1)
Console.log2("b1:", b1)
let b2 = ptl(~x="x", ~z="z", ~d="d<-100")
Js.log2("b2:", b2)
Console.log2("b2:", b2)
}

module OptMixed = {
Expand All @@ -69,26 +69,26 @@ module OptMixed = {
let ptl = foo(~y="y", ~w="w", ...)

let c1 = ptl(~x="x", ~z="z")
Js.log2("c1:", c1)
Console.log2("c1:", c1)
let c2 = ptl(~x="x", ~z="z", ~d1="d1<-100")
Js.log2("c2:", c2)
Console.log2("c2:", c2)
let c3 = ptl(~x="x", ~z="z", ~d2="d2<-200", ~d4="d4<-400")
Js.log2("c3:", c3)
Console.log2("c3:", c3)
}

let fn = cb => {
cb()
}

fn(s => Js.log(#foo(s)))
fn(s => Console.log(#foo(s)))

let fn1 = (a, b, ()) => a() + b

let a = fn1(() => 1, 2, _)

module PartialApplication = {
let f3 = (~x, ~y, ~z) => {
Js.log(x)
Console.log(x)
x + y + z
}

Expand Down
4 changes: 2 additions & 2 deletions tests/tests/src/UncurriedExternals.res
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ module StandardNotation = {

type counter
@set external setIncrementC: (counter, @this (counter, int) => unit) => unit = "increment"
let tsiC = c => setIncrementC(c, @this (me, amount) => Js.log(me))
let tsiC = c => setIncrementC(c, @this (me, amount) => Console.log(me))
@set external setIncrementU: (counter, @this (counter, int) => unit) => unit = "increment"
let tsiU = c => setIncrementU(c, @this (me, amount) => Js.log(me))
let tsiU = c => setIncrementU(c, @this (me, amount) => Console.log(me))

@module("react")
external useState: (unit => 'state) => ('state, ('state => 'state) => unit) = "useState"
Expand Down
64 changes: 32 additions & 32 deletions tests/tests/src/UntaggedVariants.res
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ let rec tuplesToObjects = (l: ListWithTuples.t<_>): ListWithObjects.t<_> =>

let l1 = ListWithTuples.Cons((1, Cons((2, Cons((3, Empty))))))
let l2 = tuplesToObjects(l1)
Js.log2("l1", l1)
Js.log2("l2", l2)
Console.log2("l1", l1)
Console.log2("l2", l2)

module Truthy = {
@unboxed
Expand Down Expand Up @@ -86,7 +86,7 @@ module Unknown = {
| A => "a"
| B => "b"
| Unknown(v) => {
Js.log(x)
Console.log(x)
"Unknown"
}
}
Expand Down Expand Up @@ -333,8 +333,8 @@ module ComplexPattern = {

let check = s =>
switch s {
| Array([True, False, Array([String("My name is"), Number(10.)])]) => Js.log("yup")
| _ => Js.log("Nope...")
| Array([True, False, Array([String("My name is"), Number(10.)])]) => Console.log("yup")
| _ => Console.log("Nope...")
}
}

Expand Down Expand Up @@ -375,12 +375,12 @@ module Arr = {

let classify = async (a: arr) =>
switch a {
| Array(arr) => Js.log(arr->Belt.Array.joinWith("-", x => x))
| String(s) => Js.log(s)
| Promise(p) => Js.log(await p)
| Object({userName}) => Js.log(userName)
| Test => Js.log("testing")
| TestInt => Js.log(12)
| Array(arr) => Console.log(arr->Belt.Array.joinWith("-", x => x))
| String(s) => Console.log(s)
| Promise(p) => Console.log(await p)
| Object({userName}) => Console.log(userName)
| Test => Console.log("testing")
| TestInt => Console.log(12)
}
}

Expand Down Expand Up @@ -416,27 +416,27 @@ module AllInstanceofTypes = {

let classifyAll = async (t: t) =>
switch t {
| String(s) => Js.log(s)
| Promise(p) => Js.log(await p)
| Object({userName}) => Js.log(userName)
| Date(date) => Js.log(date->Js.Date.toString)
| RegExp(re) => Js.log(re->Js.Re.test_("test"))
| Array(arr) => Js.log(arr->Belt.Array.joinWith("-", x => x))
| File(file) => Js.log(file->fileName)
| Blob(blob) => Js.log(blob->blobSize)
| ArrayBuffer(_) => Js.log("ArrayBuffer")
| Int8Array(_) => Js.log("Int8Array")
| Int16Array(_) => Js.log("Int16Array")
| Int32Array(_) => Js.log("Int32Array")
| Uint8Array(_) => Js.log("Uint8Array")
| Uint8ClampedArray(_) => Js.log("Uint8ClampedArray")
| Uint16Array(_) => Js.log("Uint16Array")
| Uint32Array(_) => Js.log("Uint32Array")
| Float32Array(_) => Js.log("Float32Array")
| Float64Array(_) => Js.log("Float64Array")
| BigInt64Array(_) => Js.log("BigInt64Array")
| BigUint64Array(_) => Js.log("BigUint64Array")
| DataView(_) => Js.log("DataView")
| String(s) => Console.log(s)
| Promise(p) => Console.log(await p)
| Object({userName}) => Console.log(userName)
| Date(date) => Console.log(date->Js.Date.toString)
| RegExp(re) => Console.log(re->Js.Re.test_("test"))
| Array(arr) => Console.log(arr->Belt.Array.joinWith("-", x => x))
| File(file) => Console.log(file->fileName)
| Blob(blob) => Console.log(blob->blobSize)
| ArrayBuffer(_) => Console.log("ArrayBuffer")
| Int8Array(_) => Console.log("Int8Array")
| Int16Array(_) => Console.log("Int16Array")
| Int32Array(_) => Console.log("Int32Array")
| Uint8Array(_) => Console.log("Uint8Array")
| Uint8ClampedArray(_) => Console.log("Uint8ClampedArray")
| Uint16Array(_) => Console.log("Uint16Array")
| Uint32Array(_) => Console.log("Uint32Array")
| Float32Array(_) => Console.log("Float32Array")
| Float64Array(_) => Console.log("Float64Array")
| BigInt64Array(_) => Console.log("BigInt64Array")
| BigUint64Array(_) => Console.log("BigUint64Array")
| DataView(_) => Console.log("DataView")
}
}

Expand Down
2 changes: 1 addition & 1 deletion tests/tests/src/VariantCoercion.res
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ module CoerceVariantBinaryOp = {
}

for x in 1 to (B :> int) {
Js.log(x)
Console.log(x)
}

type flagStr = | @as("one") One | @as("two") Two
Expand Down
30 changes: 15 additions & 15 deletions tests/tests/src/VariantPatternMatchingSpreads.res
Original file line number Diff line number Diff line change
Expand Up @@ -5,39 +5,39 @@ type d = | ...b | ...c

let doWithA = (a: a) => {
switch a {
| One => Js.log("aaa")
| Two => Js.log("twwwoooo")
| Three => Js.log("threeeee")
| One => Console.log("aaa")
| Two => Console.log("twwwoooo")
| Three => Console.log("threeeee")
}
}

let doWithB = (b: b) => {
switch b {
| One => Js.log("aaa")
| _ => Js.log("twwwoooo")
| One => Console.log("aaa")
| _ => Console.log("twwwoooo")
}
}

let lookup = (b: b) =>
switch b {
| ...a as a => doWithA(a)
| Four => Js.log("four")
| Five => Js.log("five")
| Four => Console.log("four")
| Five => Console.log("five")
}

let lookup2 = (d: d) =>
switch d {
| ...a as a => doWithA(a)
| ...b as b => doWithB(b)
| Six | Seven => Js.log("Got rest of d")
| Six | Seven => Console.log("Got rest of d")
}

let lookupOpt = (b: option<b>) =>
switch b {
| Some(...a as a) => doWithA(a)
| Some(Four) => Js.log("four")
| Some(Five) => Js.log("five")
| None => Js.log("None")
| Some(Four) => Console.log("four")
| Some(Five) => Console.log("five")
| None => Console.log("None")
}

module Foo = {
Expand All @@ -47,12 +47,12 @@ module Foo = {

let doWithZ = (z: Foo.zz) =>
switch z {
| First => Js.log("First")
| Second => Js.log("Second")
| First => Console.log("First")
| Second => Console.log("Second")
}

let lookup3 = (d: Foo.xx) =>
switch d {
| ...Foo.zz as z => Js.log(z)
| Third => Js.log("Third")
| ...Foo.zz as z => Console.log(z)
| Third => Console.log("Third")
}
16 changes: 8 additions & 8 deletions tests/tests/src/VariantPatternMatchingSpreadsWithPayloads.res
Original file line number Diff line number Diff line change
Expand Up @@ -5,29 +5,29 @@ type d = | ...b | ...c

let doWithA = (a: a) => {
switch a {
| One => Js.log("aaa")
| Two(_) => Js.log("twwwoooo")
| Three => Js.log("threeeee")
| One => Console.log("aaa")
| Two(_) => Console.log("twwwoooo")
| Three => Console.log("threeeee")
}
}

let doWithB = (b: b) => {
switch b {
| One => Js.log("aaa")
| _ => Js.log("twwwoooo")
| One => Console.log("aaa")
| _ => Console.log("twwwoooo")
}
}

let lookup = (b: b) =>
switch b {
| ...a as a => doWithA(a)
| Four => Js.log("four")
| Five => Js.log("five")
| Four => Console.log("four")
| Five => Console.log("five")
}

let lookup2 = (d: d) =>
switch d {
| ...a as a => doWithA(a)
| ...b as b => doWithB(b)
| Six | Seven(_) => Js.log("Got rest of d")
| Six | Seven(_) => Console.log("Got rest of d")
}
2 changes: 1 addition & 1 deletion tests/tests/src/a_recursive_type.res
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ type rec t1 = A(array<t1>)
let rec h1 = A [|h1|] // could be relaxed
let rec h2 = A2 [|h2|]

;; Js.log (h,h2) */
;; Console.log (h,h2) */
/* If we inline g's definition -- it will be the same, inline uncarefully
(inline the inlined result)
will make it non-terminating
Expand Down
2 changes: 1 addition & 1 deletion tests/tests/src/a_scope_bug.res
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ let rec odd = z => {
let even = even * even
even + 4 + even
}
a->Js.Int.toString->Js.log
a->Js.Int.toString->Console.log
even(32)
}
and even = y => odd(y)
2 changes: 1 addition & 1 deletion tests/tests/src/acyc/a4_a5.res
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
include A3_a4

Js.log(v)
Console.log(v)
2 changes: 1 addition & 1 deletion tests/tests/src/acyc/x.res
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ module A3_a4 = {
module A4_a5 = {
include A3_a4

Js.log(v)
Console.log(v)
}
Loading
Loading