aPiecek | a7366ac | 2023-04-06 10:36:58 +0200 | [diff] [blame] | 1 | source [expr {[info exists ::env(TESTS_DIR)] ? "$env(TESTS_DIR)/non-interactive/ly.tcl" : "ly.tcl"}] |
| 2 | |
| 3 | set mdir $::env(YANG_MODULES_DIR) |
| 4 | set ddir $::env(TESTS_DIR)/data |
| 5 | |
| 6 | test data_no_strict_basic {} { |
| 7 | ly_cmd_err "$ddir/modmandatory.xml $mdir/modleaf.yang" "No module with namespace \"urn:yanglint:modmandatory\" in the context." |
| 8 | ly_cmd "-n $ddir/modmandatory.xml $mdir/modleaf.yang" |
| 9 | } {} |
| 10 | |
| 11 | test data_no_strict_invalid_data {validation with --no-strict but data are invalid} { |
| 12 | set errmsg "Mandatory node \"lft\" instance does not exist." |
| 13 | ly_cmd_err "-n $ddir/modmandatory_invalid.xml $mdir/modmandatory.yang" $errmsg |
| 14 | } {} |
| 15 | |
| 16 | test data_no_strict_ignore_invalid_data {--no-strict ignore invalid data if no schema is provided} { |
| 17 | ly_cmd "-f xml -n $ddir/modmandatory_invalid.xml $ddir/modleaf.xml $mdir/modleaf.yang" "modleaf.*</lfl>$" |
| 18 | } {} |
| 19 | |
| 20 | cleanupTests |