added tests in lib.rs

This commit is contained in:
epi
2020-10-03 20:44:44 -05:00
parent c31cfe8673
commit 95dec44766
2 changed files with 24 additions and 3 deletions

View File

@@ -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]

View File

@@ -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"));
}
}