Skip to content

Commit 524bc0e

Browse files
committed
test: add test on derive impls of types in boreal-cli
1 parent 082b4ee commit 524bc0e

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

boreal-cli/src/main.rs

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ fn main() -> ExitCode {
217217
}
218218
}
219219

220-
#[derive(Copy, Clone)]
220+
#[derive(Copy, Clone, Debug)]
221221
struct ScanOptions {
222222
print_module_data: bool,
223223
no_mmap: bool,
@@ -437,8 +437,24 @@ impl std::fmt::Debug for ByteString<'_> {
437437

438438
#[cfg(test)]
439439
mod tests {
440+
use super::*;
441+
440442
#[test]
441443
fn verify_cli() {
442-
super::build_command().debug_assert();
444+
build_command().debug_assert();
445+
}
446+
447+
#[test]
448+
fn test_types() {
449+
fn test<T: Clone + std::fmt::Debug + Send + Sync>(t: T) {
450+
#[allow(clippy::redundant_clone)]
451+
let _r = t.clone();
452+
let _r = format!("{:?}", &t);
453+
}
454+
455+
test(ScanOptions {
456+
print_module_data: false,
457+
no_mmap: false,
458+
});
443459
}
444460
}

0 commit comments

Comments
 (0)