Skip to content

Commit

Permalink
Add tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
toots committed Nov 12, 2023
1 parent 1806f98 commit c4a1f26
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tests/core/types.ml
Original file line number Diff line number Diff line change
Expand Up @@ -395,3 +395,9 @@ let () =
in

Typing.(a <: b)

let () =
for _ = 0 to 20 do
let idx = Random.int 10_000 in
assert (Liquidsoap_lang.Type_base.(var_index (var_name idx) = idx))
done
14 changes: 14 additions & 0 deletions tests/language/type_errors.liq
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,20 @@ def f() =
incorrect('fallback(transitions=[],transitions=[])')
section("FUNCTIONS")

incorrect(
'def f((x:univ(a)), (y:univ(a))) = 1 end f(123, "aabb")'
)
correct(
'def f((x:univ(a)), (y:univ(b))) = 1 end f(123, "aabb")'
)

incorrect(
'def x = (1:univ?) end x + 1'
)
correct(
'def x = (1:univ) end x + 1'
)

# Partial application is not supported anymore
incorrect(
'def f(x,y) = y end ignore(f(2))'
Expand Down

0 comments on commit c4a1f26

Please sign in to comment.