yanglint TEST of option --in-format
diff --git a/tools/lint/tests/data/modleaf.djson b/tools/lint/tests/data/modleaf.djson
new file mode 100644
index 0000000..25af218
--- /dev/null
+++ b/tools/lint/tests/data/modleaf.djson
@@ -0,0 +1,3 @@
+{
+  "modleaf:lfl": 7
+}
diff --git a/tools/lint/tests/data/modleaf.dxml b/tools/lint/tests/data/modleaf.dxml
new file mode 100644
index 0000000..408936a
--- /dev/null
+++ b/tools/lint/tests/data/modleaf.dxml
@@ -0,0 +1 @@
+<lfl xmlns="urn:yanglint:modleaf">7</lfl>
diff --git a/tools/lint/tests/interactive/data_in_format.test b/tools/lint/tests/interactive/data_in_format.test
new file mode 100644
index 0000000..cc5f37e
--- /dev/null
+++ b/tools/lint/tests/interactive/data_in_format.test
@@ -0,0 +1,21 @@
+source [expr {[info exists ::env(TESTS_DIR)] ? "$env(TESTS_DIR)/interactive/ly.tcl" : "ly.tcl"}]
+
+set ddir "$::env(TESTS_DIR)/data"
+
+test data_in_format_xml {--in-format xml} {
+-setup $ly_setup -cleanup $ly_cleanup -body {
+    ly_cmd "load modleaf"
+    ly_cmd "data -F xml $ddir/modleaf.dxml"
+    ly_cmd_err "data -F json $ddir/modleaf.dxml" "Failed to parse"
+    ly_cmd_err "data -F lyb $ddir/modleaf.dxml" "Failed to parse"
+}}
+
+test data_in_format_json {--in-format json} {
+-setup $ly_setup -cleanup $ly_cleanup -body {
+    ly_cmd "load modleaf"
+    ly_cmd "data -F json $ddir/modleaf.djson"
+    ly_cmd_err "data -F xml $ddir/modleaf.djson" "Failed to parse"
+    ly_cmd_err "data -F lyb $ddir/modleaf.djson" "Failed to parse"
+}}
+
+cleanupTests