From ccc718231555a3b0c2a223f0ff1fb3c0219085af Mon Sep 17 00:00:00 2001 From: Joshua Goins Date: Tue, 25 Feb 2025 19:47:51 -0500 Subject: [PATCH] Fixup enum property test --- src/enum_property.rs | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/src/enum_property.rs b/src/enum_property.rs index cfa190c..0a779b6 100644 --- a/src/enum_property.rs +++ b/src/enum_property.rs @@ -22,7 +22,7 @@ mod tests { use std::io::Cursor; #[test] - fn read_zero() { + fn read_enum() { // Persistent.sav let data = [ 0x29, 0x00, 0x00, @@ -37,9 +37,24 @@ mod tests { 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x00, - 0x00 + 0x00, 0x25, 0x00, + 0x00, 0x00, 0x45, + 0x44, 0x41, 0x57, + 0x65, 0x61, 0x70, + 0x6f, 0x6e, 0x4d, + 0x6f, 0x64, 0x75, + 0x6c, 0x65, 0x50, + 0x6f, 0x73, 0x69, + 0x74, 0x69, 0x6f, + 0x6e, 0x3a, 0x3a, + 0x46, 0x72, 0x6f, + 0x6e, 0x74, 0x57, + 0x65, 0x61, 0x70, + 0x6f, 0x6e, 0x00 ]; let mut cursor = Cursor::new(data); let decoded = EnumProperty::read_le(&mut cursor).unwrap(); + assert_eq!(decoded.enum_type, "EDAWeaponModulePosition"); + assert_eq!(decoded.value, "EDAWeaponModulePosition::FrontWeapon"); } }