Merge branch 'mats' into issue-27
[erlware-mode.git] / test.erl
blob915d8b38ec6968dc094965d54d7c280d91eb3187
1 %% This file contains Erlang code for testing the
2 %% Erlware emacs mode. It contains functions that
3 %% use different corner cases to make sure the mode
4 %% does the right thing.
5 %%
6 %% <<If comment-multi-line is on, Press Return to get another %% line>>
8 -module(test.erl).
10 func1() ->
11 % This line should stay here after a tab.
12 % If the comment-multi-line variable is non-nil, then pressing
13 % Return at end of this line shouldto get another % line.
14 ok.
16 func2() ->
17 % Pressing tabs on all lines should not change indents.
18 {1, $(},
19 {2, $)},
20 {3, $>},
21 {4, $<},
22 {5, $,},
23 {6, ${},
24 [$% | ["should not be highlighted as a comment"]],
25 ok.
27 func3() ->
28 % If you edit the font lock mode to underline function names,
29 % there should not be an underline character after the '->'.
30 fun() -> ok end.
32 func4() ->
33 try
34 module:somefun(monkey, horse)
35 catch
36 % both these clauses should maintain their indents after tab presses
37 error:something ->
38 error;
39 error:function_clause ->
40 error
41 end.
43 func5(X)
44 when is_atom(X) ->
45 % 'is_atom' should be highlighted as a guard above
47 % All functions below should be highlighted as functions, not
48 % as guards or bifs. So each entire function name should be
49 % highlighted in the same way.
50 f:is_atom(),
51 g:registered(),
52 h:my_registered(),
54 % This should be highlighted as a bif.
55 registered(),
57 % Should be highlighted as a function.
58 deregistered().
60 func6() ->
61 % anatom should be highlighted as an atom, not a string
62 "string$", anatom,
63 % this comment should be highlighted as a comment
64 % following should be highlighted as a string, should indent on tab
65 "some $a string".