Skip to content

Commit 04741c8

Browse files
committed
Improve coverage on lists
1 parent 6acc6a0 commit 04741c8

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

lib/elixir/test/elixir/module/types/pattern_test.exs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,12 @@ defmodule Module.Types.PatternTest do
130130

131131
assert typecheck!([x = [1, 2, 3 | y], y = [1.0, 2.0, 3.0]], x) ==
132132
dynamic(non_empty_list(union(integer(), float())))
133+
134+
assert typecheck!([x = [:ok | z]], {x, z}) ==
135+
dynamic(tuple([non_empty_list(term(), term()), term()]))
136+
137+
assert typecheck!([x = [y | z]], {x, y, z}) ==
138+
dynamic(tuple([non_empty_list(term(), term()), term(), term()]))
133139
end
134140

135141
test "in patterns through ++" do

0 commit comments

Comments
 (0)