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

Function alphabet

tests/test_alphabet.rs:7–22  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

5
6#[test]
7fn alphabet() {
8 let s = "NowIsTheTimeForAllGoodMen";
9 let encoded = alphabet::BASE64.to_indices(s);
10 let decoded = alphabet::BASE64.to_chars(&encoded);
11 assert_eq!(s, decoded);
12
13 let s = "AACGAACGGTTTACCCCG";
14 let encoded = alphabet::DNA.to_indices(s);
15 let decoded = alphabet::DNA.to_chars(&encoded);
16 assert_eq!(s, decoded);
17
18 let s = "01234567890123456789";
19 let encoded = alphabet::DECIMAL.to_indices(s);
20 let decoded = alphabet::DECIMAL.to_chars(&encoded);
21 assert_eq!(s, decoded);
22}
23
24#[test]
25fn count() {

Callers

nothing calls this directly

Calls 2

to_indicesMethod · 0.80
to_charsMethod · 0.80

Tested by

no test coverage detected