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:984–999  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

982
983 #[test]
984 fn test_detect_context_with_options() {
985 let txn = MockTxn;
986 let working_copy = Memory::new();
987 let change_store = MemoryChangeStore::new();
988
989 let options = DetectOptions::new()
990 .with_algorithm(Algorithm::Patience)
991 .with_check_mtime(false)
992 .with_prefix("src/");
993
994 let ctx = DetectContext::new(&txn, &working_copy, &change_store).with_options(options);
995
996 assert_eq!(ctx.algorithm(), Algorithm::Patience);
997 assert!(!ctx.check_mtime());
998 assert_eq!(ctx.prefix(), "src/");
999 }
1000
1001 #[test]
1002 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