Skip to content

Commit 1c1c525

Browse files
committed
Update tests using LC:s with nonsensical assignments
1 parent ef88ad0 commit 1c1c525

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
@@ -359,8 +359,8 @@ utf32_illegal_sequences(Config) when is_list(Config) ->
359359
utf32_fail_range(16#D800, 16#DFFF), %Reserved for UTF-16.
360360
utf32_fail_range(-100, -1),
361361

362-
<<>> = id(<< 0 || <<X/utf32>> <= <<"àxxx">>, _ = X >>),
363-
<<>> = id(<< 0 || <<X/little-utf32>> <= <<"àxxx">>, _ = X >>),
362+
<<>> = id(<< 0 || <<X/utf32>> <= <<"àxxx">>, true =:= X >>),
363+
<<>> = id(<< 0 || <<X/little-utf32>> <= <<"àxxx">>, true =:= X >>),
364364

365365
ok.
366366

lib/compiler/test/bs_bincomp_SUITE.erl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ inconsistent_types_2() ->
261261
<<
262262
Y ||
263263
_ <- Y,
264-
(not ((false = Y) = (Y /= []))), (_ = Y)
264+
(not ((false = Y) = (Y /= []))), true =:= (_ = Y)
265265
>>
266266
end
267267
>>.

lib/compiler/test/receive_SUITE.erl

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

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

197197
%% Cover code in beam_ssa_pre_codegen.
198198
self() ! 0,

lib/compiler/test/trycatch_SUITE.erl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1175,7 +1175,7 @@ grab_bag_3() ->
11751175
try 2 of
11761176
true ->
11771177
<<
1178-
"" || [V0] = door
1178+
"" || true =:= ([V0] = door)
11791179
>>
11801180
catch
11811181
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
@@ -232,10 +232,10 @@ otp_8310() ->
232232
a = if (false orelse a) =:= a -> a; true -> b end,
233233
F1 = fun() -> a end,
234234
{'EXIT',{{bad_filter,a},_}} =
235-
(catch {a, [X || X <- [1,2,3], _ = F1()]}),
235+
(catch {a, [X || X <- [1,2,3], F1()]}),
236236
F2 = fun() -> << 3:8 >> end,
237237
{'EXIT',{{bad_filter,<<3>>},_}} =
238-
(catch {a, << << X >> || << X >> <= << 7:8 >>,_ = F2() >>}),
238+
(catch {a, << << X >> || << X >> <= << 7:8 >>, F2() >>}),
239239
{'EXIT',{{bad_generator,a},_}} =
240240
(catch {a, [X || X <- a]}),
241241
{'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
@@ -365,9 +365,9 @@ unused_vars_warn_lc(Config) when is_list(Config) ->
365365
[Z || Z <- (Y = X), % Y unused.
366366
Y > X]; % Y unbound.
367367
k(X) ->
368-
[Y || Y = X > 3, Z = X]; % Z unused.
368+
[Y || true =:= (Y = X > 3), true =:= (Z = X)]; % Z unused.
369369
k(X) ->
370-
[Z || Y = X > 3, Z = X]. % Y unused.
370+
[Z || true =:= (Y = X > 3), true =:= (Z = X)]. % Y unused.
371371
">>,
372372
[warn_unused_vars],
373373
{error,[{{8,21},erl_lint,{unbound_var,'Y'}},
@@ -376,8 +376,8 @@ unused_vars_warn_lc(Config) when is_list(Config) ->
376376
{{4,34},erl_lint,{unused_var,'Y'}},
377377
{{8,34},erl_lint,{unused_var,'Y'}},
378378
{{10,31},erl_lint,{unused_var,'Y'}},
379-
{{13,36},erl_lint,{unused_var,'Z'}},
380-
{{15,25},erl_lint,{unused_var,'Y'}}]}},
379+
{{13,57},erl_lint,{unused_var,'Z'}},
380+
{{15,35},erl_lint,{unused_var,'Y'}}]}},
381381

382382
{lc14,
383383
<<"lc2() ->

lib/stdlib/test/qlc_SUITE.erl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2977,14 +2977,14 @@ lookup2(Config) when is_list(Config) ->
29772977
<<"%% Only guards are inspected. No lookup.
29782978
etsc(fun(E) ->
29792979
Q = qlc:q([{X,Y} || {X,Y} <- ets:table(E),
2980-
Y = (X =:= 3)]),
2980+
true =:= (Y = (X =:= 3))]),
29812981
{'EXIT', {{badmatch,false},_}} = (catch qlc:e(Q))
29822982
end, [{false,3},{true,3}])">>,
29832983

29842984
<<"%% Only guards are inspected. No lookup.
29852985
etsc(fun(E) ->
29862986
Q = qlc:q([{X,Y} || {X,Y} <- ets:table(E),
2987-
Y = (X =:= 3)]),
2987+
true =:= (Y = (X =:= 3))]),
29882988
{'EXIT', {{badmatch,false},_}} = (catch qlc:e(Q))
29892989
end, [{3,true},{4,true}])">>,
29902990

@@ -2995,7 +2995,7 @@ lookup2(Config) when is_list(Config) ->
29952995
true = ets:insert(E2, [{true,1},{false,2}]),
29962996
Q = qlc:q([{X,Z} || {_,X} <- ets:table(E1),
29972997
{Y,Z} <- ets:table(E2),
2998-
Y = (X =:= 3)]),
2998+
true =:= (Y = (X =:= 3))]),
29992999
{'EXIT', {{badmatch,false},_}} = (catch qlc:e(Q)),
30003000
ets:delete(E1),
30013001
ets:delete(E2)">>,

0 commit comments

Comments
 (0)