mirror of
https://github.com/bybrooklyn/openbitdo.git
synced 2026-03-19 12:12:57 -04:00
Bootstrap OpenBitdo clean-room SDK and reliability milestone
This commit is contained in:
17
sdk/tests/profile_serialization.rs
Normal file
17
sdk/tests/profile_serialization.rs
Normal file
@@ -0,0 +1,17 @@
|
||||
use bitdo_proto::ProfileBlob;
|
||||
use std::fs;
|
||||
use std::path::PathBuf;
|
||||
|
||||
#[test]
|
||||
fn golden_profile_fixture_roundtrips() {
|
||||
let manifest = PathBuf::from(env!("CARGO_MANIFEST_DIR"));
|
||||
let path = manifest.join("../../../harness/golden/profile_fixture.bin");
|
||||
let fixture = fs::read(path).expect("read fixture");
|
||||
|
||||
let blob = ProfileBlob::from_bytes(&fixture).expect("parse fixture");
|
||||
assert_eq!(blob.slot, 2);
|
||||
assert_eq!(blob.payload.len(), 16);
|
||||
|
||||
let serialized = blob.to_bytes();
|
||||
assert_eq!(serialized, fixture);
|
||||
}
|
||||
Reference in New Issue
Block a user