From a016de24c16715e41fc72d51b4a190481ac9d138 Mon Sep 17 00:00:00 2001 From: Alejandro R Mosteo Date: Mon, 25 Mar 2024 11:54:54 +0100 Subject: [PATCH] Fix non-ASCII char used when --no-color in effect (#1661) --- src/alire/alire-solutions-diffs.adb | 22 +++++++++++----------- testsuite/tests/pin/change-path/test.py | 2 +- testsuite/tests/with/changes-info/test.py | 4 ++-- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/alire/alire-solutions-diffs.adb b/src/alire/alire-solutions-diffs.adb index 5cdb6d812..dc74563da 100644 --- a/src/alire/alire-solutions-diffs.adb +++ b/src/alire/alire-solutions-diffs.adb @@ -45,18 +45,18 @@ package body Alire.Solutions.Diffs is when Missing => TTY.Error (U ("❗")), -- alts: ⚠️❗‼️ when Binary => TTY.Warn (U ("📦")), when Info => TTY.Emph (U ("🛈"))) - else + else "" & (case Change is - when Added => U ("+"), - when Removed => U ("-"), - when Upgraded => U ("^"), - when Downgraded => U ("v"), - when Pinned => U ("·"), - when Unpinned => U ("o"), - when Unchanged => U ("="), - when Missing => U ("!"), - when Binary => U ("b"), - when Info => U ("i") + when Added => '+', + when Removed => '-', + when Upgraded => '^', + when Downgraded => 'v', + when Pinned => '.', + when Unpinned => 'o', + when Unchanged => '=', + when Missing => '!', + when Binary => 'b', + when Info => 'i' )); -- This type is used to summarize every detected change diff --git a/testsuite/tests/pin/change-path/test.py b/testsuite/tests/pin/change-path/test.py index 48ea5ce7b..bdad2e046 100644 --- a/testsuite/tests/pin/change-path/test.py +++ b/testsuite/tests/pin/change-path/test.py @@ -38,7 +38,7 @@ def create_dep(nest): assert_eq("""Note: Synchronizing workspace... Dependencies automatically updated as follows: - · yyy 0.1.0-dev (path=../nest2/yyy) + . yyy 0.1.0-dev (path=../nest2/yyy) yyy file:../nest2/yyy\n""", p.out) diff --git a/testsuite/tests/with/changes-info/test.py b/testsuite/tests/with/changes-info/test.py index 10f4f91f9..261b71a31 100644 --- a/testsuite/tests/with/changes-info/test.py +++ b/testsuite/tests/with/changes-info/test.py @@ -61,7 +61,7 @@ Changes to dependency solution: - +· local_crate unknown (new,path=local_crate)""") + ".*", + +. local_crate unknown (new,path=local_crate)""") + ".*", p.out, flags=re.S) ############################################################################### @@ -70,7 +70,7 @@ assert_match(".*" + re.escape("""Changes to dependency solution: - · libhello 2.0.0 (pin=2.0.0)""") + ".*", + . libhello 2.0.0 (pin=2.0.0)""") + ".*", p.out, flags=re.S) ###############################################################################