Skip to content

Commit 9ebce19

Browse files
author
José Valim
committed
Push a test case related to the nested vars in clauses
1 parent fb82b0c commit 9ebce19

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

lib/elixir/test/elixir/kernel/case_test.exs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,18 @@ defmodule Kernel.CaseTest do
1818
assert vars_case(-1, -1) == { 0, 1 }
1919
end
2020

21+
test :nested_vars_match do
22+
x = { :error, { :ok, :done } }
23+
assert (case x do
24+
{ :ok, right } ->
25+
right
26+
{ _left, right } ->
27+
case right do
28+
{ :ok, right } -> right
29+
end
30+
end) == :done
31+
end
32+
2133
test :match_with_in do
2234
assert(case 3 do
2335
x in [1,2,3] ->

0 commit comments

Comments
 (0)