Skip to content

Commit

Permalink
add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
yoshihiro503 committed Jun 26, 2019
1 parent e17b13a commit df90cd5
Showing 1 changed file with 30 additions and 4 deletions.
34 changes: 30 additions & 4 deletions test/blackbox-test/test-cases/try_catch_expr.erl
Original file line number Diff line number Diff line change
@@ -1,8 +1,34 @@
-module(try_catch_expr).

-export([main/0]).
-export([catch_expr/0, expr_try1/0, expr_try2/0, expr_try3/0]).

-spec main() -> any().
main() ->
-spec catch_expr() -> any().
catch_expr() ->
catch 1 + 2.



-spec expr_try1() -> number().
expr_try1() ->
try
1 + 2
catch
Err:Stack -> {hoge, Err, Stack}
end.

-spec expr_try2() -> number().
expr_try2() ->
try 1 + 2 of
X -> 2 * X
catch
Err:Stack -> {hoge, Err, Stack}
end.

-spec expr_try3() -> ok.
expr_try3() ->
try 1 + 2 of
X -> 2 * X
catch
Err:Stack -> {hoge, Err, Stack}
after
ok
end.

0 comments on commit df90cd5

Please sign in to comment.