* Fixed: Yang patterns: \n and other non-printable characters were broken

* Example: Clixon interpereted them two characters: `\\ n` instead of ascii 10
This commit is contained in:
Olof hagsand 2021-08-05 09:59:20 +02:00
parent 603f9724ce
commit dcaeb581a1
5 changed files with 107 additions and 0 deletions

View file

@ -368,6 +368,15 @@ module pattern{
'[0-9]|25[0-5])$';
}
}
leaf p47 {
description "draft-wwlh-netconf-list-pagination-00 module example-social";
type string {
length "1..80";
pattern '.*[\n].*' {
modifier invert-match;
}
}
}
}
}
EOF
@ -741,6 +750,11 @@ testrun "p$pnr" true '255.149.90.121'
testrun "p$pnr" true '251.148.80.69'
testrun "p$pnr" false '248:197.7.89/8'
let pnr=47 # '.*[\n].*
testrun "p$pnr" true 'Ensure all nights are cold'
testrun "p$pnr" false 'kalle foo'
testrun "p$pnr" false '01234567890123456789012345678901234567890123456789012345678901234567890123456789zzz'
# CLI tests
new "CLI tests for RFC7950 Sec 9.4.7 ex 2 AB"
expectpart "$($clixon_cli -1f $cfg -l o set c rfc2 AB)" 0 '^$'