```rust
pub fn testbase64encoder() { use iceyeeencoder::Base64Encoder; use iceyeeencoder::Encoder; println!(""); let table = [ ("hello world.", "aGVsbG8gd29ybGQu"), ("hello world", "aGVsbG8gd29ybGQ="), ("hello worl", "aGVsbG8gd29ybA=="), ("hello wor", "aGVsbG8gd29y"), ]; for (x, y) in table { assert!(Base64Encoder::encode(x.asbytes().tovec()).unwrap() == y); assert!(String::fromutf8(Base64Encoder::decode(y.tostring()).unwrap()).unwrap() == x); } return; }
pub fn testurlencoder() { use iceyeeencoder::Encoder; use iceyeeencoder::UrlEncoder; println!(""); assert!(UrlEncoder::encode(" 11 ".tostring()).unwrap() == "%2011%20"); assert!(UrlEncoder::decode("%2011%20".tostring()).unwrap() == " 11 "); assert!(UrlEncoder::decode("%201+1%20".to_string()).unwrap() == " 1 1 "); return; } ```