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

Function test_detect_context_with_options

atomic-core/src/record/context.rs:980–995  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

978
979 #[test]
980 fn test_detect_context_with_options() {
981 let txn = MockTxn;
982 let working_copy = Memory::new();
983 let change_store = MemoryChangeStore::new();
984
985 let options = DetectOptions::new()
986 .with_algorithm(Algorithm::Patience)
987 .with_check_mtime(false)
988 .with_prefix("src/");
989
990 let ctx = DetectContext::new(&txn, &working_copy, &change_store).with_options(options);
991
992 assert_eq!(ctx.algorithm(), Algorithm::Patience);
993 assert!(!ctx.check_mtime());
994 assert_eq!(ctx.prefix(), "src/");
995 }
996
997 #[test]
998 fn test_detect_context_clone() {

Callers

nothing calls this directly

Calls 4

with_prefixMethod · 0.45
with_check_mtimeMethod · 0.45
with_algorithmMethod · 0.45
with_optionsMethod · 0.45

Tested by

no test coverage detected