mirror of
https://github.com/epi052/feroxbuster.git
synced 2026-05-28 01:11:12 -03:00
added tests in lib.rs
This commit is contained in:
@@ -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]
|
||||
|
||||
23
src/lib.rs
23
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"));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user