blob: 80ea3f694f3ec3f9b56579a05030e127f2b0e685 [file] [log] [blame]
aPiecekeebb14b2023-06-29 16:16:17 +02001source [expr {[info exists ::env(TESTS_DIR)] ? "$env(TESTS_DIR)/ly.tcl" : "ly.tcl"}]
2
3set fdir "$::env(TESTS_DIR)/files"
4
5test file_empty {file is empty} {
6 ly_cmd "-f $fdir/empty.txt"
7} {}
8
9test file_empty_str {<string> is empty} {
10 ly_cmd "-f $fdir/empty_str.txt"
11} {}
12
13test file_empty_str_err {empty <string> is not allowed} {
14 ly_cmd_err "-f $fdir/empty_str_err.txt" "does not conform"
15} {}
16
17test file_one_pattern {one pattern in the file} {
18 ly_cmd "-f $fdir/one_pattern.txt"
19} {}
20
21test file_two_patterns {two patterns in the file} {
22 ly_cmd "-f $fdir/two_patterns.txt"
23} {}
24
25test file_two_patterns_err {two patterns and the <string> is wrong} {
26 ly_cmd_err "-f $fdir/two_patterns_err.txt" "does not conform"
27} {}
28
29test file_two_patterns_invert_match {one pattern is inverted} {
30 ly_cmd "-f $fdir/two_patterns_invert_match.txt"
31} {}
32
33test file_two_patterns_invert_match_err {one pattern is inverted and the <string> is wrong} {
34 ly_cmd_err "-f $fdir/two_patterns_invert_match_err.txt" "does not conform to inverted"
35} {}
36
37cleanupTests