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