File 1906-Update-tests-using-LC-s-with-nonsensical-assignments.patch of Package erlang

From 54b3a9228640e360408083cedc267c2d64f6fb33 Mon Sep 17 00:00:00 2001
From: Richard Carlsson <carlsson.richard@gmail.com>
Date: Sat, 1 Feb 2025 13:44:02 +0100
Subject: [PATCH 6/8] Update tests using LC:s with nonsensical assignments

---
 erts/emulator/test/bs_utf_SUITE.erl                    |  4 ++--
 lib/compiler/test/bs_bincomp_SUITE.erl                 |  2 +-
 lib/compiler/test/receive_SUITE.erl                    |  2 +-
 lib/compiler/test/trycatch_SUITE.erl                   |  2 +-
 .../test/int_eval_SUITE_data/my_int_eval_module.erl    |  4 ++--
 lib/stdlib/test/erl_lint_SUITE.erl                     | 10 ++++++----
 lib/stdlib/test/qlc_SUITE.erl                          |  6 +++---
 7 files changed, 16 insertions(+), 14 deletions(-)

diff --git a/erts/emulator/test/bs_utf_SUITE.erl b/erts/emulator/test/bs_utf_SUITE.erl
index 224fea6913..9d1de12dcd 100644
--- a/erts/emulator/test/bs_utf_SUITE.erl
+++ b/erts/emulator/test/bs_utf_SUITE.erl
@@ -359,8 +359,8 @@ utf32_illegal_sequences(Config) when is_list(Config) ->
     utf32_fail_range(16#D800, 16#DFFF),		%Reserved for UTF-16.
     utf32_fail_range(-100, -1),
 
-    <<>> = id(<< 0 || <<X/utf32>> <= <<"àxxx">>, _ = X >>),
-    <<>> = id(<< 0 || <<X/little-utf32>> <= <<"àxxx">>, _ = X >>),
+    <<>> = id(<< 0 || <<X/utf32>> <= <<"àxxx">>, true =:= X >>),
+    <<>> = id(<< 0 || <<X/little-utf32>> <= <<"àxxx">>, true =:= X >>),
 
     ok.
 
diff --git a/lib/compiler/test/bs_bincomp_SUITE.erl b/lib/compiler/test/bs_bincomp_SUITE.erl
index dcc714179d..cdf2f6e50a 100644
--- a/lib/compiler/test/bs_bincomp_SUITE.erl
+++ b/lib/compiler/test/bs_bincomp_SUITE.erl
@@ -261,7 +261,7 @@ inconsistent_types_2() ->
                    <<
                      Y ||
                        _ <- Y,
-                       (not ((false = Y) = (Y /= []))), (_ = Y)
+                       (not ((false = Y) = (Y /= []))), true =:= (_ = Y)
                    >>
            end
     >>.
diff --git a/lib/compiler/test/receive_SUITE.erl b/lib/compiler/test/receive_SUITE.erl
index 5ab76e89e0..76977c71e1 100644
--- a/lib/compiler/test/receive_SUITE.erl
+++ b/lib/compiler/test/receive_SUITE.erl
@@ -192,7 +192,7 @@ coverage(Config) when is_list(Config) ->
 
     %% Cover code for handling a non-boolean `br` in beam_ssa_dead.
     self() ! whatever,
-    {'EXIT',{{badmatch,_},_}} = (catch [a || other = receive whatever -> false end]),
+    {'EXIT',{{badmatch,_},_}} = (catch [a || true =:= (other = receive whatever -> false end)]),
 
     %% Cover code in beam_ssa_pre_codegen.
     self() ! 0,
diff --git a/lib/compiler/test/trycatch_SUITE.erl b/lib/compiler/test/trycatch_SUITE.erl
index 0ae2170634..5550751f92 100644
--- a/lib/compiler/test/trycatch_SUITE.erl
+++ b/lib/compiler/test/trycatch_SUITE.erl
@@ -1175,7 +1175,7 @@ grab_bag_3() ->
     try 2 of
         true ->
             <<
-              "" || [V0] = door
+              "" || true =:= ([V0] = door)
             >>
     catch
         error:true:V0 ->
diff --git a/lib/debugger/test/int_eval_SUITE_data/my_int_eval_module.erl b/lib/debugger/test/int_eval_SUITE_data/my_int_eval_module.erl
index 8e4aebe352..75d26afd3f 100644
--- a/lib/debugger/test/int_eval_SUITE_data/my_int_eval_module.erl
+++ b/lib/debugger/test/int_eval_SUITE_data/my_int_eval_module.erl
@@ -232,10 +232,10 @@ otp_8310() ->
     a = if (false orelse a) =:= a -> a; true -> b end,
     F1 = fun() -> a end,
     {'EXIT',{{bad_filter,a},_}} =
-        (catch {a, [X || X <- [1,2,3], _ = F1()]}),
+        (catch {a, [X || X <- [1,2,3], F1()]}),
     F2 = fun() -> << 3:8 >> end,
     {'EXIT',{{bad_filter,<<3>>},_}} =
-        (catch {a, << << X >> || << X >> <= << 7:8 >>,_ = F2() >>}),
+        (catch {a, << << X >> || << X >> <= << 7:8 >>, F2() >>}),
     {'EXIT',{{bad_generator,a},_}} =
         (catch {a, [X || X <- a]}),
     {'EXIT',{{bad_generator,b},_}} =
diff --git a/lib/stdlib/test/erl_lint_SUITE.erl b/lib/stdlib/test/erl_lint_SUITE.erl
index b1fc026c91..a60319230f 100644
--- a/lib/stdlib/test/erl_lint_SUITE.erl
+++ b/lib/stdlib/test/erl_lint_SUITE.erl
@@ -367,9 +367,9 @@ unused_vars_warn_lc(Config) when is_list(Config) ->
                   [Z || Z <- (Y = X), % Y unused.
                        Y > X]; % Y unbound.
               k(X) ->
-                  [Y || Y = X > 3, Z = X]; % Z unused.
+                  [Y || true =:= (Y = X > 3), true =:= (Z = X)]; % Z unused.
               k(X) ->
-                  [Z || Y = X > 3, Z = X]. % Y unused.
+                  [Z || true =:= (Y = X > 3), true =:= (Z = X)]. % Y unused.
            ">>,
            [warn_unused_vars],
            {error,[{{8,21},erl_lint,{unbound_var,'Y'}},
@@ -378,8 +378,10 @@ unused_vars_warn_lc(Config) when is_list(Config) ->
                    {{4,34},erl_lint,{unused_var,'Y'}},
                    {{8,34},erl_lint,{unused_var,'Y'}},
                    {{10,31},erl_lint,{unused_var,'Y'}},
-                   {{13,36},erl_lint,{unused_var,'Z'}},
-                   {{15,25},erl_lint,{unused_var,'Y'}}]}},
+                   {{13,20},erl_lint,{export_var_subexpr,'Y',{'=:=',{13,30}}}},
+                   {{13,57},erl_lint,{unused_var,'Z'}},
+                   {{15,20},erl_lint,{export_var_subexpr,'Z',{'=:=',{15,52}}}},
+                   {{15,35},erl_lint,{unused_var,'Y'}}]}},
 
           {lc14,
            <<"lc2() ->
diff --git a/lib/stdlib/test/qlc_SUITE.erl b/lib/stdlib/test/qlc_SUITE.erl
index 55e8426775..52fbf2261b 100644
--- a/lib/stdlib/test/qlc_SUITE.erl
+++ b/lib/stdlib/test/qlc_SUITE.erl
@@ -2977,14 +2977,14 @@ lookup2(Config) when is_list(Config) ->
        <<"%% Only guards are inspected. No lookup.
           etsc(fun(E) ->
                  Q = qlc:q([{X,Y} || {X,Y} <- ets:table(E),
-                                     Y = (X =:= 3)]),
+                                     true =:= (Y = (X =:= 3))]),
                  {'EXIT', {{badmatch,false},_}} = (catch qlc:e(Q))
          end, [{false,3},{true,3}])">>,
 
        <<"%% Only guards are inspected. No lookup.
           etsc(fun(E) ->
                  Q = qlc:q([{X,Y} || {X,Y} <- ets:table(E),
-                                     Y = (X =:= 3)]),
+                                     true =:= (Y = (X =:= 3))]),
                  {'EXIT', {{badmatch,false},_}} = (catch qlc:e(Q))
          end, [{3,true},{4,true}])">>,
 
@@ -2995,7 +2995,7 @@ lookup2(Config) when is_list(Config) ->
           true = ets:insert(E2, [{true,1},{false,2}]),
           Q = qlc:q([{X,Z} || {_,X} <- ets:table(E1),
                               {Y,Z} <- ets:table(E2),
-                              Y = (X =:= 3)]),
+                              true =:= (Y = (X =:= 3))]),
           {'EXIT', {{badmatch,false},_}} = (catch qlc:e(Q)),
           ets:delete(E1),
           ets:delete(E2)">>,
-- 
2.51.0

openSUSE Build Service is sponsored by