MCPcopy Create free account
hub / github.com/douchuan/algorithm / count

Function count

tests/test_alphabet.rs:25–37  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

23
24#[test]
25fn count() {
26 use std::convert::TryFrom;
27
28 let alphabet = Alphabet::try_from("ABCDR").unwrap();
29 let r = Count::compute(&alphabet, ABRA);
30 assert_eq!(vec![5, 2, 1, 1, 2], r);
31
32 let r = Count::compute(&alphabet::DECIMAL, PI);
33 assert_eq!(
34 vec![9999, 10137, 9908, 10026, 9971, 10026, 10028, 10025, 9978, 9902],
35 r
36 );
37}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected