From e3aa17458c4957abe6a0bb7951b125ebee29aca4 Mon Sep 17 00:00:00 2001 From: Olof hagsand Date: Tue, 16 Feb 2021 20:58:43 +0100 Subject: [PATCH] Implemented: [Simplifying error messages for regex validations. #174](https://github.com/clicon/clixon/issues/174) --- CHANGELOG.md | 1 + test/test_type.sh | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0c8fe6f05..727ae10fa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -86,6 +86,7 @@ Developers may need to change their code ### Minor changes +* Implemented: [Simplifying error messages for regex validations. #174](https://github.com/clicon/clixon/issues/174) * Add ca_reset plugin also when backend starts as `-s none` * Corrected client session handling to make internal IPC socket persistent * Applies to cli/netconf/restconf/client-api code diff --git a/test/test_type.sh b/test/test_type.sh index 062bcc997..a8c9ba16c 100755 --- a/test/test_type.sh +++ b/test/test_type.sh @@ -249,7 +249,7 @@ EOF expectpart "$($clixon_cli -1f $cfg -l o set c talle x99)" 0 '^$' new "cli set transitive string error. Wrong type" - expectpart "$($clixon_cli -1f $cfg -l o set c talle 9xx)" 255 '^CLI syntax error: "set c talle 9xx": regexp match fail: 9xx does not match \[a-z\]\[0-9\]\*$' + expectpart "$($clixon_cli -1f $cfg -l o set c talle 9xx)" 255 '^CLI syntax error: "set c talle 9xx": "9xx" is invalid input for cli command: talle$' new "netconf discard-changes" expecteof "$clixon_netconf -qf $cfg" 0 "]]>]]>" "^]]>]]>$" @@ -576,13 +576,13 @@ EOF expectpart "$($clixon_cli -1f $cfg -l o set digit4 0123)" 0 '^$' new "cli yang pattern \d error" - expectpart "$($clixon_cli -1f $cfg -l o set digit4 01b2)" 255 '^CLI syntax error: "set digit4 01b2": regexp match fail: 01b2 does not match' + expectpart "$($clixon_cli -1f $cfg -l o set digit4 01b2)" 255 '^CLI syntax error: "set digit4 01b2": "01b2" is invalid input for cli command: digit4$' new "cli yang pattern \w ok" expectpart "$($clixon_cli -1f $cfg -l o set word4 abc9)" 0 '^$' new "cli yang pattern \w error" - expectpart "$($clixon_cli -1f $cfg -l o set word4 ab%3)" 255 '^CLI syntax error: "set word4 ab%3": regexp match fail: ab%3 does not match' + expectpart "$($clixon_cli -1f $cfg -l o set word4 ab%3)" 255 '^CLI syntax error: "set word4 ab%3": "ab%3" is invalid input for cli command: word4$' new "netconf pattern \w" expecteof "$clixon_netconf -qf $cfg" 0 "aXG9]]>]]>" "^]]>]]>$"