File: file.test

package info (click to toggle)
libyang 5.0.2-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 11,212 kB
  • sloc: ansic: 131,170; xml: 671; sh: 448; tcl: 325; makefile: 19
file content (37 lines) | stat: -rw-r--r-- 1,055 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
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 match"
} {}

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 match"
} {}

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 match inverted"
} {}

cleanupTests