Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
fabianbees committed Feb 4, 2025
1 parent 1e64c97 commit b21dd2a
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 2 deletions.
2 changes: 2 additions & 0 deletions benches/benchmark_portscan.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ fn criterion_benchmark(c: &mut Criterion) {
true,
vec![],
false,
false,
);

c.bench_function("portscan tcp", |b| {
Expand All @@ -61,6 +62,7 @@ fn criterion_benchmark(c: &mut Criterion) {
true,
vec![],
true,
false,
);

let mut udp_group = c.benchmark_group("portscan udp");
Expand Down
1 change: 1 addition & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
//! true, // accessible, should the output be A11Y compliant?
//! vec![9000], // What ports should RustScan exclude?
//! false, // is this a UDP scan?
//! false, // Output closed ports?
//! );
//!
//! let scan_result = block_on(scanner.run());
Expand Down
3 changes: 1 addition & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ use std::string::ToString;
use std::time::Duration;

use rustscan::address::parse_addresses;
use rustscan::scanner::PortStatus;

extern crate colorful;
extern crate dirs;
Expand All @@ -35,8 +36,6 @@ extern crate log;
/// Faster Nmap scanning with Rust
/// If you're looking for the actual scanning, check out the module Scanner
fn main() {
use rustscan::scanner::PortStatus;

#[cfg(not(unix))]
let _ = ansi_term::enable_ansi_support();

Expand Down
9 changes: 9 additions & 0 deletions src/scanner/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,7 @@ mod tests {
true,
vec![9000],
false,
false,
);
block_on(scanner.run());
// if the scan fails, it wouldn't be able to assert_eq! as it panicked!
Expand All @@ -375,6 +376,7 @@ mod tests {
true,
vec![9000],
false,
false,
);
block_on(scanner.run());
// if the scan fails, it wouldn't be able to assert_eq! as it panicked!
Expand All @@ -398,6 +400,7 @@ mod tests {
true,
vec![9000],
false,
false,
);
block_on(scanner.run());
assert_eq!(1, 1);
Expand All @@ -420,6 +423,7 @@ mod tests {
true,
vec![9000],
false,
false,
);
block_on(scanner.run());
assert_eq!(1, 1);
Expand All @@ -445,6 +449,7 @@ mod tests {
true,
vec![9000],
false,
false,
);
block_on(scanner.run());
assert_eq!(1, 1);
Expand All @@ -469,6 +474,7 @@ mod tests {
true,
vec![9000],
true,
false,
);
block_on(scanner.run());
// if the scan fails, it wouldn't be able to assert_eq! as it panicked!
Expand All @@ -493,6 +499,7 @@ mod tests {
true,
vec![9000],
true,
false,
);
block_on(scanner.run());
// if the scan fails, it wouldn't be able to assert_eq! as it panicked!
Expand All @@ -516,6 +523,7 @@ mod tests {
true,
vec![9000],
true,
false,
);
block_on(scanner.run());
assert_eq!(1, 1);
Expand All @@ -538,6 +546,7 @@ mod tests {
true,
vec![9000],
true,
false,
);
block_on(scanner.run());
assert_eq!(1, 1);
Expand Down

0 comments on commit b21dd2a

Please sign in to comment.