From 85c6372b3c0b5c0f5db674238f0010bcf83be840 Mon Sep 17 00:00:00 2001 From: Alejandro R Mosteo Date: Wed, 16 Jun 2021 16:41:58 +0200 Subject: [PATCH] Show bad tag in error message (#749) --- src/alire/alire-properties-labeled.adb | 7 ++++++- testsuite/tests/index/bad-tag/test.py | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/alire/alire-properties-labeled.adb b/src/alire/alire-properties-labeled.adb index bf132cba..ab7eebe7 100644 --- a/src/alire/alire-properties-labeled.adb +++ b/src/alire/alire-properties-labeled.adb @@ -1,5 +1,9 @@ +with Alire.Utils.TTY; + package body Alire.Properties.Labeled is + package TTY renames Utils.TTY; + ------------ -- Filter -- ------------ @@ -136,7 +140,8 @@ package body Alire.Properties.Labeled is end if; if not Utils.Is_Valid_Tag (L.Value) then - From.Checked_Error ("Tag string is not valid"); + From.Checked_Error ("Tag string is not valid: " + & TTY.Error (L.Value)); end if; when others => null; diff --git a/testsuite/tests/index/bad-tag/test.py b/testsuite/tests/index/bad-tag/test.py index 6afe8faf..4ff4a510 100644 --- a/testsuite/tests/index/bad-tag/test.py +++ b/testsuite/tests/index/bad-tag/test.py @@ -10,7 +10,7 @@ p = run_alr('show', 'hello_world', complain_on_error=False, debug=False, quiet=True) assert_match( '.*Loading .*hello_world-0.1.0.toml:.*tags:' - '.*Tag string is not valid\n', + '.*Tag string is not valid: .*\n', p.out) print('SUCCESS') -- 2.39.5