()
| 819 | |
| 820 | #[test] |
| 821 | fn test_pattern_leading_slash() { |
| 822 | let temp = TempDir::new().unwrap(); |
| 823 | let ignore_path = temp.path().join(".atomicignore"); |
| 824 | std::fs::write(&ignore_path, "/root_only.txt\n").unwrap(); |
| 825 | |
| 826 | let rules = IgnoreRules::load(temp.path()); |
| 827 | |
| 828 | assert!(rules.is_ignored(Path::new("root_only.txt"), false)); |
| 829 | assert!(!rules.is_ignored(Path::new("sub/root_only.txt"), false)); |
| 830 | } |
| 831 | |
| 832 | #[test] |
| 833 | fn test_pattern_bracket_range() { |