summaryrefslogtreecommitdiffstats
path: root/tests/yanglint/non-interactive/data_in_format.test
diff options
context:
space:
mode:
Diffstat (limited to 'tests/yanglint/non-interactive/data_in_format.test')
-rw-r--r--tests/yanglint/non-interactive/data_in_format.test18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/yanglint/non-interactive/data_in_format.test b/tests/yanglint/non-interactive/data_in_format.test
new file mode 100644
index 0000000..f1336dd
--- /dev/null
+++ b/tests/yanglint/non-interactive/data_in_format.test
@@ -0,0 +1,18 @@
+source [expr {[info exists ::env(TESTS_DIR)] ? "$env(TESTS_DIR)/non-interactive/ly.tcl" : "ly.tcl"}]
+
+set mdir $::env(YANG_MODULES_DIR)
+set ddir $::env(TESTS_DIR)/data
+
+test data_in_format_xml {--in-format xml} {
+ ly_cmd "-I xml $mdir/modleaf.yang $ddir/modleaf.dxml"
+ ly_cmd_err "-I json $mdir/modleaf.yang $ddir/modleaf.dxml" "Failed to parse"
+ ly_cmd_err "-I lyb $mdir/modleaf.yang $ddir/modleaf.dxml" "Failed to parse"
+} {}
+
+test data_in_format_json {--in-format json} {
+ ly_cmd "-I json $mdir/modleaf.yang $ddir/modleaf.djson"
+ ly_cmd_err "-I xml $mdir/modleaf.yang $ddir/modleaf.djson" "Failed to parse"
+ ly_cmd_err "-I lyb $mdir/modleaf.yang $ddir/modleaf.djson" "Failed to parse"
+} {}
+
+cleanupTests