Skip to content

Commit

Permalink
add bytes_le roundtrip test
Browse files Browse the repository at this point in the history
  • Loading branch information
dfaust committed May 11, 2022
1 parent 9810dc8 commit b0ca5a0
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1405,6 +1405,23 @@ mod tests {
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]
#[cfg_attr(target_arch = "wasm32", wasm_bindgen_test)]
fn test_iterbytes_impl_for_uuid() {
Expand Down

0 comments on commit b0ca5a0

Please sign in to comment.