Skip to content

Commit 476a894

Browse files
committed
test: unskip some tests and add more examples
1 parent f47b1e7 commit 476a894

File tree

1 file changed

+46
-4
lines changed

1 file changed

+46
-4
lines changed

test/spitfire_test.exs

Lines changed: 46 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,11 @@ defmodule SpitfireTest do
2525
do:
2626
{:__block__, [],
2727
[
28+
{:use, [],
29+
[
30+
{:__aliases__, [], [:AnotherMod, :Nested]},
31+
[some: :option]
32+
]},
2833
{:def, [],
2934
[
3035
{:run, [], [{:arg, [], Elixir}]},
@@ -628,18 +633,56 @@ defmodule SpitfireTest do
628633
end
629634
end
630635

631-
@tag skip: true
632636
test "case expr" do
633637
codes = [
634638
{~s'''
635639
case foo do
636-
bar -> bar
640+
bar ->
641+
bar
642+
637643
end
638644
''',
639645
{:case, [],
640646
[
641647
{:foo, [], Elixir},
642-
[do: [{:->, [], [[{:bar, [], Elixir}], {:bar, [], Elixir}]}]]
648+
[do: [{:->, [depth: 1], [[{:bar, [], Elixir}], {:bar, [], Elixir}]}]]
649+
]}},
650+
{~s'''
651+
case :foo do
652+
:foo ->
653+
case get(:foo) do
654+
:FOO ->
655+
:bar
656+
_ ->
657+
:error
658+
end
659+
660+
_ ->
661+
:error
662+
end
663+
''',
664+
{:case, [],
665+
[
666+
:foo,
667+
[
668+
do: [
669+
{:->, [depth: 1],
670+
[
671+
[:foo],
672+
{:case, [],
673+
[
674+
{:get, [], [:foo]},
675+
[
676+
do: [
677+
{:->, [depth: 2], [[:FOO], :bar]},
678+
{:->, [depth: 2], [[{:_, [], Elixir}], :error]}
679+
]
680+
]
681+
]}
682+
]},
683+
{:->, [depth: 1], [[{:_, [], Elixir}], :error]}
684+
]
685+
]
643686
]}}
644687
]
645688

@@ -648,7 +691,6 @@ defmodule SpitfireTest do
648691
end
649692
end
650693

651-
@tag skip: true
652694
test "parse ambiguous function calls" do
653695
codes = [
654696
{~s'''

0 commit comments

Comments
 (0)