MCPcopy Create free account
hub / github.com/davidblewett/rure-python / p

Function p

regex/src/dfa.rs:1926–1938  ·  view source on GitHub ↗
(ips: Vec<u32>, flags: u8)

Source from the content-addressed store, hash-verified

1924 #[test]
1925 fn prop_state_encode_decode() {
1926 fn p(ips: Vec<u32>, flags: u8) -> bool {
1927 let mut data = vec![flags];
1928 let mut prev = 0;
1929 for &ip in ips.iter() {
1930 push_inst_ptr(&mut data, &mut prev, ip);
1931 }
1932 let state = State { data: Arc::from(&data[..]) };
1933
1934 let expected: Vec<usize> =
1935 ips.into_iter().map(|ip| ip as usize).collect();
1936 let got: Vec<usize> = state.inst_ptrs().collect();
1937 expected == got && state.flags() == StateFlags(flags)
1938 }
1939 QuickCheck::new()
1940 .gen(StdGen::new(self::rand::thread_rng(), 10_000))
1941 .quickcheck(p as fn(Vec<u32>, u8) -> bool);

Callers

nothing calls this directly

Calls 12

push_inst_ptrFunction · 0.85
StateFlagsClass · 0.85
write_varu32Function · 0.85
read_varu32Function · 0.85
write_vari32Function · 0.85
read_vari32Function · 0.85
mapMethod · 0.80
inst_ptrsMethod · 0.80
iterMethod · 0.45
into_iterMethod · 0.45
flagsMethod · 0.45
lenMethod · 0.45

Tested by

no test coverage detected