Skip to content

Commit

Permalink
Fixing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
bee committed Jul 30, 2022
1 parent f7a834a commit 3e1d083
Show file tree
Hide file tree
Showing 7 changed files with 141 additions and 21 deletions.
126 changes: 123 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions src/api_library_input_struct.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use crate::checkers::{
checker_type::{Check, Checker},
default_checker::DefaultChecker,
};
use lemmeknow::Identify;
use lemmeknow::Identifier;

/// Library input is the default API input
/// The CLI turns its arguments into a LibraryInput struct
Expand All @@ -17,13 +17,13 @@ pub struct LibraryInput<Type> {
/// The checker to use
pub checker: Checker<Type>,
/// The lemmeknow config to use
pub lemmeknow_config: Identify,
pub lemmeknow_config: Identifier,
}

/// Creates a default lemmeknow config
const LEMMEKNOW_DEFAULT_CONFIG: Identify = Identify {
min_rarity: None,
max_rarity: None,
const LEMMEKNOW_DEFAULT_CONFIG: Identifier = Identifier {
min_rarity: 0.0,
max_rarity: 0.0,
tags: vec![],
exclude_tags: vec![],
file_support: false,
Expand Down
4 changes: 2 additions & 2 deletions src/checkers/athena.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use crate::checkers::checker_result::CheckResult;
use lemmeknow::Identify;
use lemmeknow::Identifier;

use super::{
checker_type::{Check, Checker},
Expand All @@ -21,7 +21,7 @@ impl Check for Checker<Athena> {
tags: vec!["athena", "all"],
expected_runtime: 0.01,
popularity: 1.0,
lemmeknow_config: Identify::default(),
lemmeknow_config: Identifier::default(),
_phantom: std::marker::PhantomData,
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/checkers/checker_type.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/// Checker_type is a type used to define checkers
/// This means that we can standardise the way we check for plaintext
use crate::checkers::checker_result::CheckResult;
use lemmeknow::Identify;
use lemmeknow::Identifier;

/// Every checker is of type CheckerType
/// This will let us pick & choose which checkers to use
Expand All @@ -24,7 +24,7 @@ pub struct Checker<Type> {
/// The popularity of the checker
pub popularity: f32,
/// lemmeknow config object
pub lemmeknow_config: Identify,
pub lemmeknow_config: Identifier,
/// https://doc.rust-lang.org/std/marker/struct.PhantomData.html
/// Let's us save memory by telling the compiler that our type
/// acts like a type <T> even though it doesn't.
Expand Down
4 changes: 2 additions & 2 deletions src/checkers/default_checker.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use lemmeknow::Identify;
use lemmeknow::Identifier;

use super::{
checker_result::CheckResult,
Expand All @@ -19,7 +19,7 @@ impl Check for Checker<DefaultChecker> {
tags: vec![],
expected_runtime: 0.0,
popularity: 0.0,
lemmeknow_config: Identify::default(),
lemmeknow_config: Identifier::default(),
_phantom: std::marker::PhantomData,
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/checkers/english.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use crate::checkers::checker_result::CheckResult;
use crate::storage;
use lemmeknow::Identify;
use lemmeknow::Identifier;
use log::{debug, trace};

use crate::checkers::checker_type::{Check, Checker};
Expand All @@ -19,7 +19,7 @@ impl Check for Checker<EnglishChecker> {
expected_runtime: 0.1,
/// English is the most popular language
popularity: 1.0,
lemmeknow_config: Identify::default(),
lemmeknow_config: Identifier::default(),
_phantom: std::marker::PhantomData,
}
}
Expand Down
10 changes: 5 additions & 5 deletions src/checkers/lemmeknow_checker.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
use crate::checkers::checker_result::CheckResult;
use lemmeknow::{Data, Identify};
use lemmeknow::{Data, Identifier};

use super::checker_type::{Check, Checker};

/// The Lemmeknow checker configuration struct
const IDENTIFIER: Identify = Identify {
min_rarity: Some(0.1),
max_rarity: None,
const IDENTIFIER: Identifier = Identifier {
min_rarity: 0.1,
max_rarity: 1.0,
tags: vec![],
exclude_tags: vec![],
file_support: false,
Expand All @@ -27,7 +27,7 @@ impl Check for Checker<LemmeKnow> {
tags: vec!["lemmeknow", "regex"],
expected_runtime: 0.01,
popularity: 1.0,
lemmeknow_config: Identify::default(),
lemmeknow_config: Identifier::default(),
_phantom: std::marker::PhantomData,
}
}
Expand Down

0 comments on commit 3e1d083

Please sign in to comment.