Skip to content

Commit

Permalink
fixup! Add emacs indention testcase
Browse files Browse the repository at this point in the history
  • Loading branch information
dgud committed Jan 19, 2018
1 parent 47cf536 commit 040f2cb
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 16 deletions.
35 changes: 21 additions & 14 deletions lib/tools/test/emacs_SUITE_data/funcs
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,11 @@ func5(
ok.

a_function_with_a_very_very_long_name() ->
#rec{
field1=1,
field2=1}.
A00 = #record{
field1=1,
field2=1
},
A00.

when1(W1, W2)
when is_number(W1),
Expand Down Expand Up @@ -101,30 +103,34 @@ match3({
) ->
ok.

match4(<<M4A:8,
match4(<<
M4A:8,
M4B:16/unsigned-integer,
_/binary
>>,
M4C) ->
ok.

match5(M5A,
#record{b=M5B,
c=M5C
}
#record{
b=M5B,
c=M5C
}
) ->
ok.

match6(M6A,
#{ key6a := 6a,
key6b := 6b
#{key6a := a6,
key6b := b6
}) ->
ok.

funs(1) ->
funs(1)
when
X ->
%% Changed fun to one indention level
%% 'when' and several clause forces a depth of '4'
Var = spawn(fun(X)
Var = spawn(fun(X, _)
when X == 2;
X > 10 ->
hello,
Expand All @@ -143,11 +149,12 @@ funs(1) ->
Var;
funs(2) ->
%% check EEP37 named funs
Fn1 = fun Fact(N)
when N > 0 ->
Fn1 = fun
Factory(N) when
N > 0 ->
F = Fact(N-1),
N * F;
Fact(0) ->
Factory(0) ->
1
end,
Fn1;
Expand Down
5 changes: 5 additions & 0 deletions lib/tools/test/emacs_SUITE_data/macros
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@
M2A2)
).

-define(
M3,
undefined
).

-ifdef(DEBUG).
-define(LOG,
logger:log(?MODULE,?LINE)
Expand Down
2 changes: 1 addition & 1 deletion lib/tools/test/emacs_SUITE_data/records
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
-record(record3, {r3a = 8#42423 bor
8#4234,
r3b = 8#5432
bor 2#1010101
bor 2#1010101,
r3c = 123 +
234,
r3d}).
Expand Down
2 changes: 1 addition & 1 deletion lib/tools/test/emacs_SUITE_data/terms
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ deep(Rec) ->
1,
2,
3
]
],
{key,
3}
=>
Expand Down

0 comments on commit 040f2cb

Please sign in to comment.