Skip to content

Commit d398e2f

Browse files
JBYoshiroypat
authored andcommitted
Add tests for more complicated expressions as the array size
Signed-off-by: JBYoshi <[email protected]>
1 parent 1a13ba8 commit d398e2f

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

tests/test.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -485,6 +485,7 @@ fn test_nested_structs_deserialization() {
485485
}
486486

487487
pub const SIZE: usize = 10;
488+
pub const SIZE_U8: u8 = 15;
488489

489490
pub mod dummy_mod {
490491
pub const SIZE: usize = 20;
@@ -497,12 +498,14 @@ fn test_versionize_struct_with_array() {
497498
a: [u32; SIZE],
498499
b: [u8; dummy_mod::SIZE],
499500
c: Option<[i16; SIZE]>,
501+
d: [u8; SIZE_U8 as usize],
500502
}
501503

502504
let test_struct = TestStruct {
503505
a: [1; SIZE],
504506
b: [2; dummy_mod::SIZE],
505507
c: Some([3; SIZE]),
508+
d: [4; SIZE_U8 as usize],
506509
};
507510

508511
let mut mem = vec![0; 4096];

0 commit comments

Comments
 (0)