diff options
author | Björn Gustavsson <[email protected]> | 2016-04-27 11:59:15 +0200 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2016-04-27 14:43:10 +0200 |
commit | 1dae2af0186107dff01916323a5a58ce83db22ae (patch) | |
tree | f08c600ebc35f104a49351e5fa8130e6753baa24 /lib/compiler/test/lc_SUITE.erl | |
parent | a6b9fcfb146481657a980c96bf4bfe6c25f0f7c1 (diff) | |
download | otp-1dae2af0186107dff01916323a5a58ce83db22ae.tar.gz otp-1dae2af0186107dff01916323a5a58ce83db22ae.tar.bz2 otp-1dae2af0186107dff01916323a5a58ce83db22ae.zip |
Move list comprehension tests to lc_SUITE
Diffstat (limited to 'lib/compiler/test/lc_SUITE.erl')
-rw-r--r-- | lib/compiler/test/lc_SUITE.erl | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/compiler/test/lc_SUITE.erl b/lib/compiler/test/lc_SUITE.erl index dd0bcb4245..3cb49433ce 100644 --- a/lib/compiler/test/lc_SUITE.erl +++ b/lib/compiler/test/lc_SUITE.erl @@ -89,6 +89,18 @@ basic(Config) when is_list(Config) -> %% Filter expressions with andalso/orelse. "abc123" = alphanum("?abc123.;"), + %% Aliased patterns. + [] = [t || {C=D}={_,_} <- []], + [] = [X || {X,{Y}={X,X}} <- []], + [t] = [t || "a"++"b" = "ab" <- ["ab"]], + + %% Strange filter block. + [] = [{X,Y} || {X} <- [], begin Y = X, Y =:= X end], + [{a,a}] = [{X,Y} || {X} <- [{a}], begin Y = X, Y =:= X end], + + %% Not matching. + [] = [3 || {3=4} <- []], + %% Error cases. [] = [{xx,X} || X <- L0, element(2, X) == no_no_no], {'EXIT',_} = (catch [X || X <- L1, list_to_atom(X) == dum]), |