aPiecek | f1f4efe | 2023-05-11 14:26:39 +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_format_xml {Print data in xml format} { |
| 6 | -setup $ly_setup -cleanup $ly_cleanup -body { |
| 7 | ly_cmd "load modleaf" |
| 8 | ly_cmd "data -f xml $ddir/modleaf.xml" "<lfl xmlns=\"urn:yanglint:modleaf\">7</lfl>" |
| 9 | }} |
| 10 | |
| 11 | test data_format_json {Print data in json format} { |
| 12 | -setup $ly_setup -cleanup $ly_cleanup -body { |
| 13 | ly_cmd "load modleaf" |
| 14 | ly_cmd "data -f json $ddir/modleaf.xml" "{\r\n \"modleaf:lfl\": 7\r\n}" |
| 15 | }} |
| 16 | |
aPiecek | a472348 | 2023-05-11 14:31:02 +0200 | [diff] [blame] | 17 | test data_format_lyb_err {Print data in lyb format} { |
| 18 | -setup $ly_setup -cleanup $ly_cleanup -body { |
| 19 | ly_cmd "load modleaf" |
| 20 | ly_cmd_err "data -f lyb $ddir/modleaf.xml" "The LYB format requires the -o" |
| 21 | }} |
| 22 | |
aPiecek | f1f4efe | 2023-05-11 14:26:39 +0200 | [diff] [blame] | 23 | cleanupTests |