aboutsummaryrefslogtreecommitdiffstats
path: root/lib/stdlib/test/epp_SUITE.erl
diff options
context:
space:
mode:
Diffstat (limited to 'lib/stdlib/test/epp_SUITE.erl')
-rw-r--r--lib/stdlib/test/epp_SUITE.erl45
1 files changed, 33 insertions, 12 deletions
diff --git a/lib/stdlib/test/epp_SUITE.erl b/lib/stdlib/test/epp_SUITE.erl
index 4078513e38..915f478dfa 100644
--- a/lib/stdlib/test/epp_SUITE.erl
+++ b/lib/stdlib/test/epp_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1998-2016. All Rights Reserved.
+%% Copyright Ericsson AB 1998-2017. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -28,7 +28,7 @@
otp_8130/1, overload_mac/1, otp_8388/1, otp_8470/1,
otp_8562/1, otp_8665/1, otp_8911/1, otp_10302/1, otp_10820/1,
otp_11728/1, encoding/1, extends/1, function_macro/1,
- test_error/1, test_warning/1]).
+ test_error/1, test_warning/1, otp_14285/1]).
-export([epp_parse_erl_form/2]).
@@ -68,7 +68,8 @@ all() ->
not_circular, skip_header, otp_6277, otp_7702, otp_8130,
overload_mac, otp_8388, otp_8470, otp_8562,
otp_8665, otp_8911, otp_10302, otp_10820, otp_11728,
- encoding, extends, function_macro, test_error, test_warning].
+ encoding, extends, function_macro, test_error, test_warning,
+ otp_14285].
groups() ->
[{upcase_mac, [], [upcase_mac_1, upcase_mac_2]},
@@ -306,7 +307,7 @@ otp_5362(Config) when is_list(Config) ->
File_Back_hrl = filename:join(Dir, "back_5362.hrl"),
Back = <<"-module(back_5362).
- -compile(export_all).
+ -export([foo/1]).
-file(?FILE, 1).
-include(\"back_5362.hrl\").
@@ -334,7 +335,7 @@ otp_5362(Config) when is_list(Config) ->
-file(?FILE, 100).
- -compile(export_all).
+ -export([foo/1,bar/1]).
-file(\"other.file\", ?LINE). % like an included file...
foo(A) -> % line 105
@@ -362,7 +363,7 @@ otp_5362(Config) when is_list(Config) ->
Blank = <<"-module(blank_5362).
- -compile(export_all).
+ -export([q/1,a/1,b/1,c/1]).
-
file(?FILE, 18). q(Q) -> foo. % line 18
@@ -677,7 +678,7 @@ otp_8130(Config) when is_list(Config) ->
{otp_8130_c6,
<<"-define(M3(), A).\n"
"t() -> A = 1, ?3.14159}.\n">>,
- {errors,[{{2,16},epp,{call,"?3.14159"}}],[]}},
+ {errors,[{{2,16},epp,{call,[$?,"3.14159"]}}],[]}},
{otp_8130_c7,
<<"\nt() -> ?A.\n">>,
@@ -1258,7 +1259,7 @@ do_otp_8911(Config) ->
File = "i.erl",
Cont = <<"-module(i).
- -compile(export_all).
+ -export([t/0]).
-file(\"fil1\", 100).
-include(\"i1.erl\").
t() ->
@@ -1384,6 +1385,26 @@ do_otp_10820(File, C, PC) ->
true = test_server:stop_node(Node),
ok.
+%% OTP_14285: Unicode atoms.
+otp_14285(Config) when is_list(Config) ->
+ %% This is just a sample of errors.
+ Cs = [{otp_8562,
+ <<"-export([f/0]).
+ -define('a\x{400}b', 'a\x{400}d').
+ f() ->
+ ?'a\x{400}b'.
+ g() ->
+ ?\"a\x{400}b\".
+ h() ->
+ ?'a\x{400}no'().
+ "/utf8>>,
+ {errors,[{6,epp,{call,[63,[91,["97",44,"1024",44,"98"],93]]}},
+ {8,epp,{undefined,'a\x{400}no',0}}],
+ []}}
+ ],
+ [] = compile(Config, Cs),
+ ok.
+
%% OTP-11728. Bugfix circular macro.
otp_11728(Config) when is_list(Config) ->
Dir = proplists:get_value(priv_dir, Config),
@@ -1391,7 +1412,7 @@ otp_11728(Config) when is_list(Config) ->
HrlFile = filename:join(Dir, "otp_11728.hrl"),
ok = file:write_file(HrlFile, H),
C = <<"-module(otp_11728).
- -compile(export_all).
+ -export([function_name/0]).
-include(\"otp_11728.hrl\").
@@ -1599,12 +1620,12 @@ check_test(Config, Test) ->
end.
compile_test(Config, Test0) ->
- Test = [<<"-module(epp_test). -compile(export_all). ">>, Test0],
+ Test = [<<"-module(epp_test). ">>, Test0],
Filename = "epp_test.erl",
PrivDir = proplists:get_value(priv_dir, Config),
File = filename:join(PrivDir, Filename),
ok = file:write_file(File, Test),
- Opts = [export_all,return,nowarn_unused_record,{outdir,PrivDir}],
+ Opts = [export_all,nowarn_export_all,return,nowarn_unused_record,{outdir,PrivDir}],
case compile_file(File, Opts) of
{ok, Ws} -> warnings(File, Ws);
Else -> Else
@@ -1653,7 +1674,7 @@ unopaque_forms(Forms) ->
[erl_parse:anno_to_term(Form) || Form <- Forms].
run_test(Config, Test0) ->
- Test = [<<"-module(epp_test). -compile(export_all). ">>, Test0],
+ Test = [<<"-module(epp_test). -export([t/0]). ">>, Test0],
Filename = "epp_test.erl",
PrivDir = proplists:get_value(priv_dir, Config),
File = filename:join(PrivDir, Filename),