MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / test_ignore_rules_glob_patterns

Function test_ignore_rules_glob_patterns

atomic-repository/src/ignore.rs:635–648  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

633
634 #[test]
635 fn test_ignore_rules_glob_patterns() {
636 let temp = TempDir::new().unwrap();
637 let ignore_path = temp.path().join(".atomicignore");
638 std::fs::write(&ignore_path, "**/*.pyc\nsrc/**/*.bak\n").unwrap();
639
640 let rules = IgnoreRules::load(temp.path());
641
642 assert!(rules.is_ignored(Path::new("module.pyc"), false));
643 assert!(rules.is_ignored(Path::new("lib/module.pyc"), false));
644 assert!(rules.is_ignored(Path::new("lib/sub/module.pyc"), false));
645 assert!(rules.is_ignored(Path::new("src/file.bak"), false));
646 assert!(rules.is_ignored(Path::new("src/sub/file.bak"), false));
647 assert!(!rules.is_ignored(Path::new("other/file.bak"), false));
648 }
649
650 #[test]
651 fn test_ignore_rules_directory_only() {

Callers

nothing calls this directly

Calls 3

writeFunction · 0.50
unwrapMethod · 0.45
pathMethod · 0.45

Tested by

no test coverage detected