Skip to content

Commit 5f98841

Browse files
committed
Update tests using LC:s with nonsensical assignments
1 parent 179d097 commit 5f98841

File tree

7 files changed

+14
-14
lines changed

7 files changed

+14
-14
lines changed

erts/emulator/test/bs_utf_SUITE.erl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -357,8 +357,8 @@ utf32_illegal_sequences(Config) when is_list(Config) ->
357357
utf32_fail_range(16#D800, 16#DFFF), %Reserved for UTF-16.
358358
utf32_fail_range(-100, -1),
359359

360-
<<>> = id(<< 0 || <<X/utf32>> <= <<"àxxx">>, _ = X >>),
361-
<<>> = id(<< 0 || <<X/little-utf32>> <= <<"àxxx">>, _ = X >>),
360+
<<>> = id(<< 0 || <<X/utf32>> <= <<"àxxx">>, true =:= X >>),
361+
<<>> = id(<< 0 || <<X/little-utf32>> <= <<"àxxx">>, true =:= X >>),
362362

363363
ok.
364364

lib/compiler/test/bs_bincomp_SUITE.erl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ inconsistent_types_2() ->
274274
<<
275275
Y ||
276276
_ <- Y,
277-
(not ((false = Y) = (Y /= []))), (_ = Y)
277+
(not ((false = Y) = (Y /= []))), true =:= (_ = Y)
278278
>>
279279
end
280280
>>.

lib/compiler/test/receive_SUITE.erl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ coverage(Config) when is_list(Config) ->
190190

191191
%% Cover code for handling a non-boolean `br` in beam_ssa_dead.
192192
self() ! whatever,
193-
{'EXIT',{{badmatch,_},_}} = (catch [a || other = receive whatever -> false end]),
193+
{'EXIT',{{badmatch,_},_}} = (catch [a || true =:= (other = receive whatever -> false end)]),
194194

195195
%% Cover code in beam_ssa_pre_codegen.
196196
self() ! 0,

lib/compiler/test/trycatch_SUITE.erl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1173,7 +1173,7 @@ grab_bag_3() ->
11731173
try 2 of
11741174
true ->
11751175
<<
1176-
"" || [V0] = door
1176+
"" || true =:= ([V0] = door)
11771177
>>
11781178
catch
11791179
error:true:V0 ->

lib/debugger/test/int_eval_SUITE_data/my_int_eval_module.erl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -230,10 +230,10 @@ otp_8310() ->
230230
a = if (false orelse a) =:= a -> a; true -> b end,
231231
F1 = fun() -> a end,
232232
{'EXIT',{{bad_filter,a},_}} =
233-
(catch {a, [X || X <- [1,2,3], _ = F1()]}),
233+
(catch {a, [X || X <- [1,2,3], F1()]}),
234234
F2 = fun() -> << 3:8 >> end,
235235
{'EXIT',{{bad_filter,<<3>>},_}} =
236-
(catch {a, << << X >> || << X >> <= << 7:8 >>,_ = F2() >>}),
236+
(catch {a, << << X >> || << X >> <= << 7:8 >>, F2() >>}),
237237
{'EXIT',{{bad_generator,a},_}} =
238238
(catch {a, [X || X <- a]}),
239239
{'EXIT',{{bad_generator,b},_}} =

lib/stdlib/test/erl_lint_SUITE.erl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -361,9 +361,9 @@ unused_vars_warn_lc(Config) when is_list(Config) ->
361361
[Z || Z <- (Y = X), % Y unused.
362362
Y > X]; % Y unbound.
363363
k(X) ->
364-
[Y || Y = X > 3, Z = X]; % Z unused.
364+
[Y || true =:= (Y = X > 3), true =:= (Z = X)]; % Z unused.
365365
k(X) ->
366-
[Z || Y = X > 3, Z = X]. % Y unused.
366+
[Z || true =:= (Y = X > 3), true =:= (Z = X)]. % Y unused.
367367
">>,
368368
[warn_unused_vars],
369369
{error,[{{8,21},erl_lint,{unbound_var,'Y'}},
@@ -372,8 +372,8 @@ unused_vars_warn_lc(Config) when is_list(Config) ->
372372
{{4,34},erl_lint,{unused_var,'Y'}},
373373
{{8,34},erl_lint,{unused_var,'Y'}},
374374
{{10,31},erl_lint,{unused_var,'Y'}},
375-
{{13,36},erl_lint,{unused_var,'Z'}},
376-
{{15,25},erl_lint,{unused_var,'Y'}}]}},
375+
{{13,57},erl_lint,{unused_var,'Z'}},
376+
{{15,35},erl_lint,{unused_var,'Y'}}]}},
377377

378378
{lc14,
379379
<<"lc2() ->

lib/stdlib/test/qlc_SUITE.erl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2968,14 +2968,14 @@ lookup2(Config) when is_list(Config) ->
29682968
<<"%% Only guards are inspected. No lookup.
29692969
etsc(fun(E) ->
29702970
Q = qlc:q([{X,Y} || {X,Y} <- ets:table(E),
2971-
Y = (X =:= 3)]),
2971+
true =:= (Y = (X =:= 3))]),
29722972
{'EXIT', {{badmatch,false},_}} = (catch qlc:e(Q))
29732973
end, [{false,3},{true,3}])">>,
29742974

29752975
<<"%% Only guards are inspected. No lookup.
29762976
etsc(fun(E) ->
29772977
Q = qlc:q([{X,Y} || {X,Y} <- ets:table(E),
2978-
Y = (X =:= 3)]),
2978+
true =:= (Y = (X =:= 3))]),
29792979
{'EXIT', {{badmatch,false},_}} = (catch qlc:e(Q))
29802980
end, [{3,true},{4,true}])">>,
29812981

@@ -2986,7 +2986,7 @@ lookup2(Config) when is_list(Config) ->
29862986
true = ets:insert(E2, [{true,1},{false,2}]),
29872987
Q = qlc:q([{X,Z} || {_,X} <- ets:table(E1),
29882988
{Y,Z} <- ets:table(E2),
2989-
Y = (X =:= 3)]),
2989+
true =:= (Y = (X =:= 3))]),
29902990
{'EXIT', {{badmatch,false},_}} = (catch qlc:e(Q)),
29912991
ets:delete(E1),
29922992
ets:delete(E2)">>,

0 commit comments

Comments
 (0)