aPiecek | eebb14b | 2023-06-29 16:16:17 +0200 | [diff] [blame] | 1 | source [expr {[info exists ::env(TESTS_DIR)] ? "$env(TESTS_DIR)/ly.tcl" : "ly.tcl"}] |
| 2 | |
| 3 | set fdir "$::env(TESTS_DIR)/files" |
| 4 | |
| 5 | test file_empty {file is empty} { |
| 6 | ly_cmd "-f $fdir/empty.txt" |
| 7 | } {} |
| 8 | |
| 9 | test file_empty_str {<string> is empty} { |
| 10 | ly_cmd "-f $fdir/empty_str.txt" |
| 11 | } {} |
| 12 | |
| 13 | test file_empty_str_err {empty <string> is not allowed} { |
| 14 | ly_cmd_err "-f $fdir/empty_str_err.txt" "does not conform" |
| 15 | } {} |
| 16 | |
| 17 | test file_one_pattern {one pattern in the file} { |
| 18 | ly_cmd "-f $fdir/one_pattern.txt" |
| 19 | } {} |
| 20 | |
| 21 | test file_two_patterns {two patterns in the file} { |
| 22 | ly_cmd "-f $fdir/two_patterns.txt" |
| 23 | } {} |
| 24 | |
| 25 | test 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 | |
| 29 | test file_two_patterns_invert_match {one pattern is inverted} { |
| 30 | ly_cmd "-f $fdir/two_patterns_invert_match.txt" |
| 31 | } {} |
| 32 | |
| 33 | test 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 | |
| 37 | cleanupTests |