MCPcopy Create free account
hub / github.com/chanced/jsonptr / qc_intersection

Function qc_intersection

src/pointer.rs:2082–2093  ·  view source on GitHub ↗
(base: PointerBuf, suffix_0: PointerBuf, suffix_1: PointerBuf)

Source from the content-addressed store, hash-verified

2080
2081 #[quickcheck]
2082 fn qc_intersection(base: PointerBuf, suffix_0: PointerBuf, suffix_1: PointerBuf) -> TestResult {
2083 if suffix_0.first() == suffix_1.first() {
2084 // base must be the true intersection
2085 return TestResult::discard();
2086 }
2087 let mut a = base.clone();
2088 a.append(&suffix_0);
2089 let mut b = base.clone();
2090 b.append(&suffix_1);
2091 let isect = a.intersection(&b);
2092 TestResult::from_bool(isect == base)
2093 }
2094
2095 #[cfg(all(feature = "json", feature = "std", feature = "serde"))]
2096 #[test]

Callers

nothing calls this directly

Calls 3

firstMethod · 0.80
appendMethod · 0.80
intersectionMethod · 0.80

Tested by

no test coverage detected