diff --git a/src/banner.rs b/src/banner.rs index d2f0d6e..542ee34 100644 --- a/src/banner.rs +++ b/src/banner.rs @@ -241,10 +241,8 @@ by Ben "epi" Risher {} ver: {}"#, eprintln!("{}", bottom); } +#[cfg(test)] mod tests { - #[allow(unused)] - // not really sure why this shows an unused import warning, as i definitely need it to compile - // the test functions as they're written... use super::*; #[test] diff --git a/src/lib.rs b/src/lib.rs index 257c348..3d728ff 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -52,3 +52,26 @@ pub const DEFAULT_STATUS_CODES: [StatusCode; 9] = [ /// /// Expected location is in the same directory as the feroxbuster binary. pub const DEFAULT_CONFIG_NAME: &str = "ferox-config.toml"; + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + /// asserts default config name is correct + fn default_config_name() { + assert_eq!(DEFAULT_CONFIG_NAME, "ferox-config.toml"); + } + + #[test] + /// asserts default wordlist is correct + fn default_wordlist() { + assert_eq!(DEFAULT_WORDLIST, "/usr/share/seclists/Discovery/Web-Content/raft-medium-directories.txt"); + } + + #[test] + /// asserts default version is correct + fn default_version() { + assert_eq!(VERSION, env!("CARGO_PKG_VERSION")); + } +} \ No newline at end of file