blob: 4bba596a30c57522f3f530c8dce482155b70e254 [file] [log] [blame]
aPiecekaa285692023-04-05 13:36:25 +02001source [expr {[info exists ::env(TESTS_DIR)] ? "$env(TESTS_DIR)/interactive/ly.tcl" : "ly.tcl"}]
2
3set ddir "$::env(TESTS_DIR)/data"
4
5test data_present_via_mandatory {validation of mandatory-stmt will pass only with the --present} {
6-setup $ly_setup -cleanup $ly_cleanup -body {
7 ly_cmd "load modleaf modmandatory"
8 ly_cmd_err "data $ddir/modleaf.xml" "Mandatory node \"lft\" instance does not exist."
9 ly_cmd "data -e $ddir/modleaf.xml"
10}}
11
aPiecek65de6d12023-04-05 13:38:53 +020012test data_present_merge {validation with --present and --merge} {
13-setup $ly_setup -cleanup $ly_cleanup -body {
14 ly_cmd "load modleaf modmandatory moddefault"
15 ly_cmd_err "data -m $ddir/modleaf.xml $ddir/moddefault.xml" "Mandatory node \"lft\" instance does not exist."
16 ly_cmd "data -e -m $ddir/modleaf.xml $ddir/moddefault.xml"
17}}
18
aPiecekaa285692023-04-05 13:36:25 +020019test data_present_merge_invalid {using --present and --merge but data are invalid} {
20-setup $ly_setup -cleanup $ly_cleanup -body {
21 ly_cmd "load modleaf modmandatory"
22 ly_cmd_err "data -e -m $ddir/modleaf.xml $ddir/modmandatory_invalid.xml" "Mandatory node \"lft\" instance does not exist."
23}}
24
25cleanupTests