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

Source from the content-addressed store, hash-verified

963
964 #[test]
965 fn test_detect_context_with_options() {
966 let txn = MockTxn;
967 let working_copy = Memory::new();
968 let change_store = MemoryChangeStore::new();
969
970 let options = DetectOptions::new()
971 .with_algorithm(Algorithm::Patience)
972 .with_check_mtime(false)
973 .with_prefix("src/");
974
975 let ctx = DetectContext::new(&txn, &working_copy, &change_store).with_options(options);
976
977 assert_eq!(ctx.algorithm(), Algorithm::Patience);
978 assert!(!ctx.check_mtime());
979 assert_eq!(ctx.prefix(), "src/");
980 }
981
982 #[test]
983 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