aboutsummaryrefslogtreecommitdiffstats
path: root/lib/stdlib/test/erl_lint_SUITE.erl
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2016-02-05 13:10:38 +0100
committerBjörn Gustavsson <[email protected]>2016-02-05 13:17:25 +0100
commit6fbe8cd45ee7f9f63dd0cad38dd6529598dcb21e (patch)
tree601e6b58d6644a6eedb7fce5360a3cde223b3777 /lib/stdlib/test/erl_lint_SUITE.erl
parentbf11b8fc3e9ac0f3cd48d8a3a834bd7d709ecc9e (diff)
downloadotp-6fbe8cd45ee7f9f63dd0cad38dd6529598dcb21e.tar.gz
otp-6fbe8cd45ee7f9f63dd0cad38dd6529598dcb21e.tar.bz2
otp-6fbe8cd45ee7f9f63dd0cad38dd6529598dcb21e.zip
Move record compilation errors to erl_lint_SUITE
The two bad record usage test cases in compile_SUITE do not belong there, as the errors are detected in erl_lint. Move the test to the erl_lint_SUITE.
Diffstat (limited to 'lib/stdlib/test/erl_lint_SUITE.erl')
-rw-r--r--lib/stdlib/test/erl_lint_SUITE.erl17
1 files changed, 15 insertions, 2 deletions
diff --git a/lib/stdlib/test/erl_lint_SUITE.erl b/lib/stdlib/test/erl_lint_SUITE.erl
index c5e2e5609d..32247ba492 100644
--- a/lib/stdlib/test/erl_lint_SUITE.erl
+++ b/lib/stdlib/test/erl_lint_SUITE.erl
@@ -65,7 +65,8 @@
too_many_arguments/1,
basic_errors/1,bin_syntax_errors/1,
predef/1,
- maps/1,maps_type/1,otp_11851/1,otp_11879/1,otp_13230/1
+ maps/1,maps_type/1,otp_11851/1,otp_11879/1,otp_13230/1,
+ record_errors/1
]).
% Default timetrap timeout (set in init_per_testcase).
@@ -94,7 +95,8 @@ all() ->
bif_clash, behaviour_basic, behaviour_multiple, otp_11861,
otp_7550, otp_8051, format_warn, {group, on_load},
too_many_arguments, basic_errors, bin_syntax_errors, predef,
- maps, maps_type, otp_11851, otp_11879, otp_13230].
+ maps, maps_type, otp_11851, otp_11879, otp_13230,
+ record_errors].
groups() ->
[{unused_vars_warn, [],
@@ -3881,6 +3883,17 @@ otp_13230(Config) when is_list(Config) ->
[]} = run_test2(Config, Abstr, []),
ok.
+record_errors(Config) when is_list(Config) ->
+ Ts = [{rec1,
+ <<"-record(r, {a,b}).
+ b() -> #r{a=foo,b=42,a=bar}.
+ u(R) -> R#r{a=1,b=2,a=2}.
+ ">>,
+ [],
+ {errors,[{2,erl_lint,{redefine_field,r,a}},
+ {3,erl_lint,{redefine_field,r,a}}],[]}}],
+ run(Config, Ts).
+
run(Config, Tests) ->
F = fun({N,P,Ws,E}, BadL) ->
case catch run_test(Config, P, Ws) of