aboutsummaryrefslogtreecommitdiffstats
path: root/lib/test_server/test/erl2html2_SUITE_data/m1.erl
diff options
context:
space:
mode:
authorSiri Hansen <[email protected]>2012-11-19 15:13:47 +0100
committerSiri Hansen <[email protected]>2012-11-19 18:07:33 +0100
commita908160088b654e436bdcdd32369c29603ca5fa7 (patch)
treea5444eccddaa7c80a10db0987582b764254d0e51 /lib/test_server/test/erl2html2_SUITE_data/m1.erl
parenta7af6cae44d1837d0c6cb35b99feff1260659102 (diff)
downloadotp-a908160088b654e436bdcdd32369c29603ca5fa7.tar.gz
otp-a908160088b654e436bdcdd32369c29603ca5fa7.tar.bz2
otp-a908160088b654e436bdcdd32369c29603ca5fa7.zip
[test_server] Fix erl2html2.erl to handle badly indented files
Line numbering of erlang files that were not correctly indented could be wrong after coverting to html with erl2html2:convert/[2,3]. This has been corrected. This commit also fixes the following: * There are now link targets for each line and not only for each 10th line - meaning that links from test logs are now to the exact line, and not to the last number for which N rem 10 == 0. * there will only be one link target per function, i.e. the faulty link targets for function clauses are removed. * link targets for function now includes the arity (e.g. func/1 has a link target "func-1") And some tests are added.
Diffstat (limited to 'lib/test_server/test/erl2html2_SUITE_data/m1.erl')
-rw-r--r--lib/test_server/test/erl2html2_SUITE_data/m1.erl46
1 files changed, 46 insertions, 0 deletions
diff --git a/lib/test_server/test/erl2html2_SUITE_data/m1.erl b/lib/test_server/test/erl2html2_SUITE_data/m1.erl
new file mode 100644
index 0000000000..156f1d0a51
--- /dev/null
+++ b/lib/test_server/test/erl2html2_SUITE_data/m1.erl
@@ -0,0 +1,46 @@
+%% Comment with <html> code &amp; </html>
+%% and also some "quotes" and 'single quotes'
+
+-module(m1).
+
+-compile(export_all).
+
+-include("header1.hrl").
+-include("header2.hrl").
+
+-define(MACRO1,value).
+
+%%% Comment
+foo(x) ->
+ %% Comment
+ ok_x;
+foo(y) ->
+ %% Second clause
+ ok_y.
+
+'quoted_foo'() ->
+ ok.
+
+'quoted_foo_with_"_and_/'() ->
+ ok.
+
+'quoted_foo_with_(_and_)'() ->
+ ok.
+
+'quoted_foo_with_<_and_>'() ->
+ ok.
+
+bar() ->
+ do_something(),
+ok. % indentation error, OTP-9710
+
+%% Function inside macro definition
+?MACRO_DEFINING_A_FUNCTION.
+
+%% Two function one one line
+quuux() -> ok. quuuux() -> ok.
+
+%% do_something/0 does something
+do_something() ->
+ ?MACRO1.
+%% comments after last line