| •1 |
use crate::{spec::BinarySubtype, tests::LOCK, Binary}; |
| 2 |
|
| 3 |
#[test] |
| 4 |
fn binary_from_base64() { |
| 5 |
let _guard = LOCK.run_concurrently(); |
| 6 |
|
| 7 |
let input = base64::encode("hello"); |
| 8 |
let produced = Binary::from_base64(input, None).unwrap(); |
| 9 |
let expected = Binary { |
| 10 |
bytes: "hello".as_bytes().to_vec(), |
| 11 |
subtype: BinarySubtype::Generic, |
| 12 |
}; |
| 13 |
assert_eq!(produced, expected); |
| 14 |
|
| 15 |
let produced = Binary::from_base64("", BinarySubtype::Uuid).unwrap(); |
| 16 |
let expected = Binary { |
| 17 |
bytes: "".as_bytes().to_vec(), |
| 18 |
subtype: BinarySubtype::Uuid, |
| 19 |
}; |
| 20 |
assert_eq!(produced, expected); |
| 21 |
} |