From 340c98f3876e1b227d0f551d12556e884a836ac0 Mon Sep 17 00:00:00 2001 From: Mingun Date: Sat, 30 Mar 2024 22:41:44 +0500 Subject: [PATCH] Rust: blank line between `from_file` and assertions --- spec/rust/test_expr_sizeof_type_0.rs | 1 + spec/rust/test_expr_sizeof_type_1.rs | 1 + spec/rust/test_expr_sizeof_value_0.rs | 1 + spec/rust/test_expr_sizeof_value_sized.rs | 1 + spec/rust/test_io_local_var.rs | 1 + spec/rust/test_meta_tags.rs | 1 + spec/rust/test_meta_xref.rs | 1 + spec/rust/test_params_call.rs | 1 + spec/rust/test_repeat_eos_bit.rs | 1 + 9 files changed, 9 insertions(+) diff --git a/spec/rust/test_expr_sizeof_type_0.rs b/spec/rust/test_expr_sizeof_type_0.rs index 3feedde45..b7d9ac449 100644 --- a/spec/rust/test_expr_sizeof_type_0.rs +++ b/spec/rust/test_expr_sizeof_type_0.rs @@ -9,6 +9,7 @@ use rust::ExprSizeofType0; #[test] fn test_expr_sizeof_type_0() { if let Ok(r) = ExprSizeofType0::from_file("src/fixed_struct.bin") { + assert_eq!(r.sizeof_block, (1 + 4) + 2); } } diff --git a/spec/rust/test_expr_sizeof_type_1.rs b/spec/rust/test_expr_sizeof_type_1.rs index 4b1d4f1bf..2b5ff65c1 100644 --- a/spec/rust/test_expr_sizeof_type_1.rs +++ b/spec/rust/test_expr_sizeof_type_1.rs @@ -9,6 +9,7 @@ use rust::ExprSizeofType1; #[test] fn test_expr_sizeof_type_1() { if let Ok(r) = ExprSizeofType1::from_file("src/fixed_struct.bin") { + assert_eq!(r.sizeof_block, ((1 + 4) + 2) + 4); assert_eq!(r.sizeof_subblock, 4); } diff --git a/spec/rust/test_expr_sizeof_value_0.rs b/spec/rust/test_expr_sizeof_value_0.rs index 787c41554..d6a576a6c 100644 --- a/spec/rust/test_expr_sizeof_value_0.rs +++ b/spec/rust/test_expr_sizeof_value_0.rs @@ -9,6 +9,7 @@ use rust::ExprSizeofValue0; #[test] fn test_expr_sizeof_value_0() { if let Ok(r) = ExprSizeofValue0::from_file("src/fixed_struct.bin") { + assert_eq!(r.self_sizeof, ((1 + 4) + 2) + 2); assert_eq!(r.sizeof_block, (1 + 4) + 2); assert_eq!(r.sizeof_block_a, 1); diff --git a/spec/rust/test_expr_sizeof_value_sized.rs b/spec/rust/test_expr_sizeof_value_sized.rs index 44282d867..7356d0431 100644 --- a/spec/rust/test_expr_sizeof_value_sized.rs +++ b/spec/rust/test_expr_sizeof_value_sized.rs @@ -9,6 +9,7 @@ use rust::ExprSizeofValueSized; #[test] fn test_expr_sizeof_value_sized() { if let Ok(r) = ExprSizeofValueSized::from_file("src/fixed_struct.bin") { + assert_eq!(r.self_sizeof, 12 + 2); assert_eq!(r.sizeof_block, 12); assert_eq!(r.sizeof_block_a, 1); diff --git a/spec/rust/test_io_local_var.rs b/spec/rust/test_io_local_var.rs index 3d861355c..891eeea9c 100644 --- a/spec/rust/test_io_local_var.rs +++ b/spec/rust/test_io_local_var.rs @@ -9,6 +9,7 @@ use rust::IoLocalVar; #[test] fn test_io_local_var() { if let Ok(r) = IoLocalVar::from_file("src/full256.bin") { + assert_eq!(r.skip, vec!([0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, 0xa, 0xb, 0xc, 0xd, 0xe, 0xf, 0x10, 0x11, 0x12, 0x13])); assert_eq!(r.followup, 20); } diff --git a/spec/rust/test_meta_tags.rs b/spec/rust/test_meta_tags.rs index 4978b9f09..b1da4ecc3 100644 --- a/spec/rust/test_meta_tags.rs +++ b/spec/rust/test_meta_tags.rs @@ -9,5 +9,6 @@ use rust::MetaTags; #[test] fn test_meta_tags() { if let Ok(r) = MetaTags::from_file("src/fixed_struct.bin") { + } } diff --git a/spec/rust/test_meta_xref.rs b/spec/rust/test_meta_xref.rs index 9f068b47a..5fb49dc70 100644 --- a/spec/rust/test_meta_xref.rs +++ b/spec/rust/test_meta_xref.rs @@ -9,5 +9,6 @@ use rust::MetaXref; #[test] fn test_meta_xref() { if let Ok(r) = MetaXref::from_file("src/fixed_struct.bin") { + } } diff --git a/spec/rust/test_params_call.rs b/spec/rust/test_params_call.rs index 16a05638d..1fca31f7e 100644 --- a/spec/rust/test_params_call.rs +++ b/spec/rust/test_params_call.rs @@ -9,6 +9,7 @@ use rust::ParamsCall; #[test] fn test_params_call() { if let Ok(r) = ParamsCall::from_file("src/term_strz.bin") { + assert_eq!(r.buf1.body, "foo|b"); assert_eq!(r.buf2.body, "ar|ba"); assert_eq!(r.buf2.trailer, 122); diff --git a/spec/rust/test_repeat_eos_bit.rs b/spec/rust/test_repeat_eos_bit.rs index a7518aade..0257df96b 100644 --- a/spec/rust/test_repeat_eos_bit.rs +++ b/spec/rust/test_repeat_eos_bit.rs @@ -9,6 +9,7 @@ use rust::RepeatEosBit; #[test] fn test_repeat_eos_bit() { if let Ok(r) = RepeatEosBit::from_file("src/enum_0.bin") { + assert_eq!(r.nibbles.len(), 16); } }