blob: dc4b7e0282e82be8217f98feeb767b0ed7c4f3c7 [file] [log] [blame]
aPiecekf1f4efe2023-05-11 14:26:39 +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_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
11test 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
aPieceka4723482023-05-11 14:31:02 +020017test 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
aPiecekf1f4efe2023-05-11 14:26:39 +020023cleanupTests