From aa9054e0ea48a127f2aeafcdce1df4d1aec09574 Mon Sep 17 00:00:00 2001 From: Dan Gudmundsson Date: Wed, 20 Dec 2017 10:33:56 +0100 Subject: 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([])") --- lib/tools/test/emacs_SUITE_data/comprehensions | 47 ++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 lib/tools/test/emacs_SUITE_data/comprehensions (limited to 'lib/tools/test/emacs_SUITE_data/comprehensions') 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 || <> <= <<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 = << <> || + #record{a=X} <- lists:seq(1, 10), + true = (X rem 2) + >>, + + Binary2 = << <> || <> <= <<0:512>>, + true = (X rem 2) + >>, + + Bin3 = << + << + X:8, + 34:8 + >> + || <> <= <<0:512>>, + true = (X rem 2) + >>, + ok. -- cgit v1.2.3