Skip to content

Commit

Permalink
issue #86
Browse files Browse the repository at this point in the history
  • Loading branch information
dsietz committed May 21, 2020
1 parent b1d02bc commit 9110157
Showing 1 changed file with 15 additions and 11 deletions.
26 changes: 15 additions & 11 deletions src/engine/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -286,18 +286,20 @@ impl PatternDefinition {
///
/// # Example
///
/// ```
/// ```rust
/// extern crate test_data_generation;
///
/// use test_data_generation::engine::PatternDefinition;
///
/// fn main() {
/// let mut pttrn_def = PatternDefinition::new();
///
/// assert_eq!(pttrn_def.analyze("Hello World").0, "CvccvSCvccc");
/// async {
/// let rslt = pttrn_def.analyze("Hello World").await;
/// assert_eq!(rslt.0, "CvccvSCvccc");
/// };
/// }
/// ```
pub fn analyze(&mut self, entity: &str) -> (String, Vec<Fact>) {
pub async fn analyze(&mut self, entity: &str) -> (String, Vec<Fact>) {
// record the length of the passed value
//self.size = entity.len() as u32;

Expand Down Expand Up @@ -328,7 +330,7 @@ impl PatternDefinition {
///
/// # Example
///
/// ```
/// ```rust
/// extern crate test_data_generation;
///
/// use test_data_generation::engine::PatternDefinition;
Expand Down Expand Up @@ -384,7 +386,7 @@ impl PatternDefinition {
///
/// # Example
///
/// ```
/// ```rust
/// extern crate test_data_generation;
///
/// use test_data_generation::engine::PatternDefinition;
Expand Down Expand Up @@ -514,10 +516,12 @@ mod tests {

#[test]
fn test_pattern_definition_analyze(){
let mut pttrn_def = PatternDefinition::new();
let word = pttrn_def.analyze("HELlo0?^@");

assert_eq!(word.0, "CVCcv#pp@");
assert_eq!(word.1.len(), 9);
let mut pttrn_def = PatternDefinition::new();
async {
let word = pttrn_def.analyze("HELlo0?^@").await;

assert_eq!(word.0, "CVCcv#pp@");
assert_eq!(word.1.len(), 9);
};
}
}

0 comments on commit 9110157

Please sign in to comment.