From 94842f5a3d4ff4fdf23bd1555ece1621d3b51996 Mon Sep 17 00:00:00 2001 From: Massimo Manghi Date: Sun, 30 Nov 2025 18:55:54 +0100 Subject: [PATCH] change expected error message regexp in validate-2.2 test. Actually the message has no "" to mark an empty string --- tests/validate.test | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tests/validate.test b/tests/validate.test index 2deae1a..b35de48 100644 --- a/tests/validate.test +++ b/tests/validate.test @@ -53,13 +53,15 @@ test validate-2.1 {validator throws error} -body { #<<< } -result 0 #>>> test validate-2.2 {validator throws error} -body { #<<< - list [catch { + set outcome [list [catch { parse_args::parse_args {-rating ""} { -rating {-validate {tcl::mathop::+ 1}} } } r o] \ - [regexp {^Validation failed for "-rating": (cannot|can't) use (non-numeric|empty) string "" as (right )?operand of "\+"$} $r] \ - [dict get $o -errorcode] + [regexp {^Validation failed for "-rating": (cannot|can't) use (non-numeric|empty) string as (right )?operand of "\+"$} $r] \ + [dict get $o -errorcode]] + + set outcome } -cleanup { unset -nocomplain r o } -result {1 1 {PARSE_ARGS VALIDATION -rating}} -match regexp