summaryrefslogtreecommitdiffstats
path: root/tests/yangre/file.test
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-27 04:23:18 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-27 04:23:18 +0000
commit16527d165de55f2727f55b752b30d44a7e61e927 (patch)
tree0840ee6e0e109a9e85f0d80ff36f92587c6a5538 /tests/yangre/file.test
parentReleasing progress-linux version 2.1.30-2.1~progress7.99u1. (diff)
downloadlibyang2-16527d165de55f2727f55b752b30d44a7e61e927.tar.xz
libyang2-16527d165de55f2727f55b752b30d44a7e61e927.zip
Merging upstream version 2.1.148.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/yangre/file.test')
-rw-r--r--tests/yangre/file.test37
1 files changed, 37 insertions, 0 deletions
diff --git a/tests/yangre/file.test b/tests/yangre/file.test
new file mode 100644
index 0000000..80ea3f6
--- /dev/null
+++ b/tests/yangre/file.test
@@ -0,0 +1,37 @@
+source [expr {[info exists ::env(TESTS_DIR)] ? "$env(TESTS_DIR)/ly.tcl" : "ly.tcl"}]
+
+set fdir "$::env(TESTS_DIR)/files"
+
+test file_empty {file is empty} {
+ ly_cmd "-f $fdir/empty.txt"
+} {}
+
+test file_empty_str {<string> is empty} {
+ ly_cmd "-f $fdir/empty_str.txt"
+} {}
+
+test file_empty_str_err {empty <string> is not allowed} {
+ ly_cmd_err "-f $fdir/empty_str_err.txt" "does not conform"
+} {}
+
+test file_one_pattern {one pattern in the file} {
+ ly_cmd "-f $fdir/one_pattern.txt"
+} {}
+
+test file_two_patterns {two patterns in the file} {
+ ly_cmd "-f $fdir/two_patterns.txt"
+} {}
+
+test file_two_patterns_err {two patterns and the <string> is wrong} {
+ ly_cmd_err "-f $fdir/two_patterns_err.txt" "does not conform"
+} {}
+
+test file_two_patterns_invert_match {one pattern is inverted} {
+ ly_cmd "-f $fdir/two_patterns_invert_match.txt"
+} {}
+
+test file_two_patterns_invert_match_err {one pattern is inverted and the <string> is wrong} {
+ ly_cmd_err "-f $fdir/two_patterns_invert_match_err.txt" "does not conform to inverted"
+} {}
+
+cleanupTests