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

Function test_rust_patterns

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

Source from the content-addressed store, hash-verified

849
850 #[test]
851 fn test_rust_patterns() {
852 let temp = TempDir::new().unwrap();
853 let ignore_path = temp.path().join(".atomicignore");
854 std::fs::write(
855 &ignore_path,
856 "target/\n**/*.rs.bk\nCargo.lock\n.idea/\n.vscode/\n",
857 )
858 .unwrap();
859
860 let rules = IgnoreRules::load(temp.path());
861
862 assert!(rules.is_ignored(Path::new("target"), true));
863 assert!(rules.is_ignored(Path::new("target/debug/main"), false));
864 assert!(rules.is_ignored(Path::new("src/main.rs.bk"), false));
865 assert!(rules.is_ignored(Path::new("Cargo.lock"), false));
866 assert!(rules.is_ignored(Path::new(".idea"), true));
867 assert!(rules.is_ignored(Path::new(".vscode"), true));
868 assert!(!rules.is_ignored(Path::new("src/main.rs"), false));
869 assert!(!rules.is_ignored(Path::new("Cargo.toml"), false));
870 }
871
872 #[test]
873 fn test_node_patterns() {

Callers

nothing calls this directly

Calls 3

writeFunction · 0.50
unwrapMethod · 0.45
pathMethod · 0.45

Tested by

no test coverage detected