mirror of
https://github.com/uuid-rs/uuid.git
synced 2025-10-02 15:24:57 +00:00
add bytes_le roundtrip test
This commit is contained in:
parent
9810dc89b2
commit
b0ca5a0157
17
src/lib.rs
17
src/lib.rs
@ -1405,6 +1405,23 @@ mod tests {
|
|||||||
assert_eq!(&b_in, b_out);
|
assert_eq!(&b_in, b_out);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
#[cfg_attr(target_arch = "wasm32", wasm_bindgen_test)]
|
||||||
|
fn test_bytes_le_roundtrip() {
|
||||||
|
let b = [
|
||||||
|
0xa1, 0xa2, 0xa3, 0xa4, 0xb1, 0xb2, 0xc1, 0xc2, 0xd1, 0xd2, 0xd3,
|
||||||
|
0xd4, 0xd5, 0xd6, 0xd7, 0xd8,
|
||||||
|
];
|
||||||
|
|
||||||
|
let u1 = Uuid::from_bytes(b);
|
||||||
|
|
||||||
|
let b_le = u1.to_bytes_le();
|
||||||
|
|
||||||
|
let u2 = Uuid::from_bytes_le(b_le);
|
||||||
|
|
||||||
|
assert_eq!(u1, u2);
|
||||||
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg_attr(target_arch = "wasm32", wasm_bindgen_test)]
|
#[cfg_attr(target_arch = "wasm32", wasm_bindgen_test)]
|
||||||
fn test_iterbytes_impl_for_uuid() {
|
fn test_iterbytes_impl_for_uuid() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user