Skip to content

Commit

Permalink
refactor: improved code, removed warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
m62624 committed Nov 5, 2023
1 parent af384ce commit 03c1a59
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
1 change: 0 additions & 1 deletion flexible_inspect_rs/src/rules/common_elements/mod.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
use std::marker::PhantomData;

use self::range::RangeFormat;
use super::{traits::IntoSpecificCaptureType, *};
pub mod range;
Expand Down
1 change: 1 addition & 0 deletions flexible_inspect_rs/src/rules/rule_bytes/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
mod another_traits;
mod base;
mod captures;
#[cfg(not(tarpaulin_include))]
pub mod convert;
mod init;
mod modifiers;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,3 +112,19 @@ pub fn test_number_range_t_6() {

assert!(validator_numbers.validate(text.as_slice()).is_ok());
}

#[test]
pub fn test_number_range_t_7() {
let text = [1, 0, 0, 0, 4, 0, 0, 0, 3, 0, 0, 0];
let validator_numbers = TemplateValidator::new([Cartridge::new(
0,
"error message from cartridge 1",
[RuleBytes::new(
r"\x01\x00\x00\x00|\x02\x01\x00\x00|\x03\x00\x00\x00",
MatchRequirement::MustBeFound,
)
.number_range(1..=3, ReadMode::FromLeBytes, RangeMode::Exactly(1))],
)]);

assert!(validator_numbers.validate(text.as_slice()).is_err());
}

0 comments on commit 03c1a59

Please sign in to comment.