diff --git a/flexible_inspect_rs/tests/api.rs b/flexible_inspect_rs/tests/api.rs index eda1320..30adcb0 100644 --- a/flexible_inspect_rs/tests/api.rs +++ b/flexible_inspect_rs/tests/api.rs @@ -1,22 +1,19 @@ use flexible_inspect_rs::prelude::*; #[test] -fn main_rust() { - let text = b"0x0E 0x0F 0x10 0x11"; +fn test_range_from_le_bytes() { + // number is 10 + let text = [10, 0, 0, 0]; let cartr_1 = Cartridge::new( 0, "not converted to number", - [ - RuleBytes::new(r"0x..", MatchRequirement::MustBeFound).number_range( - 0..=100, - ReadMode::FromBeBytes, - RangeMode::Any, - ), - ], + [RuleBytes::new( + r"\x0A\x00\x00\x00|\x0C\x00\x00\x00|\x50\x00\x00\x00|\x5A\x00\x00\x00", + MatchRequirement::MustBeFound, + ) + .number_range(0..=2500, ReadMode::FromLeBytes, RangeMode::Any)], ); - // dbg!(&cartr_1); - let validator = TemplateValidator::new([cartr_1]); dbg!(validator.validate(text.as_ref())); }