diff options
author | Dan Gudmundsson <[email protected]> | 2017-12-20 10:33:56 +0100 |
---|---|---|
committer | Dan Gudmundsson <[email protected]> | 2018-03-01 13:37:13 +0100 |
commit | aa9054e0ea48a127f2aeafcdce1df4d1aec09574 (patch) | |
tree | 7950c22586d9539ac9451a88f49b00139fe9a457 /lib/tools/test/emacs_SUITE_data/comprehensions | |
parent | 31782c3accacafb20bc7efd46004921aea8f9f22 (diff) | |
download | otp-aa9054e0ea48a127f2aeafcdce1df4d1aec09574.tar.gz otp-aa9054e0ea48a127f2aeafcdce1df4d1aec09574.tar.bz2 otp-aa9054e0ea48a127f2aeafcdce1df4d1aec09574.zip |
Add emacs indention testcase
Split the manual testcase and run them in daily tests instead.
Easy to run directly as well:
(cd ../test; cerl -eval "emacs_SUITE:indent([])")
Diffstat (limited to 'lib/tools/test/emacs_SUITE_data/comprehensions')
-rw-r--r-- | lib/tools/test/emacs_SUITE_data/comprehensions | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/lib/tools/test/emacs_SUITE_data/comprehensions b/lib/tools/test/emacs_SUITE_data/comprehensions new file mode 100644 index 0000000000..45279850a5 --- /dev/null +++ b/lib/tools/test/emacs_SUITE_data/comprehensions @@ -0,0 +1,47 @@ +%% -*- Mode: erlang; indent-tabs-mode: nil -*- +%% Copyright Ericsson AB 2017. All Rights Reserved. + +%%% indentation of comprehensions + +%%% Not everything in these test are set in stone +%%% better indentation rules can be added but by having +%%% these tests we can see what changes in new implementations +%%% and notice when doing unintentional changes + +list() -> + %% I don't have a good idea how we want to handle this + %% but they are here to show how they are indented today. + Result1 = [X || + #record{a=X} <- lists:seq(1, 10), + true = (X rem 2) + ], + Result2 = [X || <<X:32,_:32>> <= <<0:512>>, + true = (X rem 2) + ], + Res = [ func(X, + arg2) + || + #record{a=X} <- lists:seq(1, 10), + true = (X rem 2) + ], + Result1. + +binary(B) -> + Binary1 = << <<X:8>> || + #record{a=X} <- lists:seq(1, 10), + true = (X rem 2) + >>, + + Binary2 = << <<X:8>> || <<X:32,_:32>> <= <<0:512>>, + true = (X rem 2) + >>, + + Bin3 = << + << + X:8, + 34:8 + >> + || <<X:32,_:32>> <= <<0:512>>, + true = (X rem 2) + >>, + ok. |