Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions benches/binary.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use rand::rngs::SmallRng;
use rand::seq::SliceRandom as _;
use rand::{Rng, SeedableRng};
use test_results_parser::binary::*;
use test_results_parser::{Outcome, PropertiesValue, Testrun, ValidatedString};
use test_results_parser::{Outcome, PropertiesValue, Testrun};

criterion_group!(benches, binary);
criterion_main!(benches);
Expand Down Expand Up @@ -175,15 +175,15 @@ fn create_random_testcases(
let name = Alphanumeric.sample_string(rng, name_len);

Testrun {
name: name.try_into().unwrap(),
classname: ValidatedString::default(),
name: name,
classname: String::new(),
duration: Some(1.0),
outcome: Outcome::Pass,
testsuite: ValidatedString::default(),
testsuite: String::new(),
failure_message: None,
filename: None,
build_url: None,
computed_name: ValidatedString::default(),
computed_name: String::new(),
properties: PropertiesValue(None),
}
})
Expand Down
17 changes: 7 additions & 10 deletions src/binary/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,24 +18,21 @@ mod tests {
use raw::CommitHash;
use timestamps::DAY;

use crate::{
testrun::{Outcome, PropertiesValue, Testrun},
validated_string::ValidatedString,
};
use crate::testrun::{Outcome, PropertiesValue, Testrun};

use super::*;

fn test() -> Testrun {
Testrun {
name: "abc".try_into().unwrap(),
classname: ValidatedString::default(),
name: "abc".to_string(),
classname: String::new(),
duration: Some(1.0),
outcome: Outcome::Pass,
testsuite: ValidatedString::default(),
testsuite: String::new(),
failure_message: None,
filename: None,
build_url: None,
computed_name: ValidatedString::default(),
computed_name: String::new(),
properties: PropertiesValue(None),
}
}
Expand Down Expand Up @@ -64,7 +61,7 @@ mod tests {
test.duration = Some(2.0);
session.insert(&test);

test.name = "def".try_into().unwrap();
test.name = "def".into();
test.outcome = Outcome::Skip;
test.duration = Some(0.0);
session.insert(&test);
Expand Down Expand Up @@ -98,7 +95,7 @@ mod tests {
let mut session = writer.start_session(0, CommitHash::default(), &[]);

session.insert(&test);
test.testsuite = "some testsuite".try_into().unwrap();
test.testsuite = "some testsuite".into();
session.insert(&test);

let mut buf = vec![];
Expand Down
Loading
Loading