Skip to content

Commit

Permalink
Fix some typos in resolver tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dwijnand committed Feb 19, 2019
1 parent 55895e7 commit fae4dce
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
30 changes: 15 additions & 15 deletions tests/testsuite/resolve.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use crate::support::resolver::{

use proptest::{prelude::*, *};

/// NOTE: proptest is a form of fuzz testing. It generates random input and makes shore that
/// NOTE: proptest is a form of fuzz testing. It generates random input and makes sure that
/// certain universal truths are upheld. Therefore, it can pass when there is a problem,
/// but if it fails then there really is something wrong. When testing something as
/// complicated as the resolver, the problems can be very subtle and hard to generate.
Expand All @@ -41,7 +41,7 @@ proptest! {
PrettyPrintRegistry(input) in registry_strategy(50, 20, 60)
) {
let reg = registry(input.clone());
// there is only a small chance that eny one
// there is only a small chance that any one
// crate will be interesting.
// So we try some of the most complicated.
for this in input.iter().rev().take(20) {
Expand Down Expand Up @@ -74,7 +74,7 @@ proptest! {
.unwrap();

let reg = registry(input.clone());
// there is only a small chance that eny one
// there is only a small chance that any one
// crate will be interesting.
// So we try some of the most complicated.
for this in input.iter().rev().take(10) {
Expand Down Expand Up @@ -105,13 +105,13 @@ proptest! {

/// NOTE: if you think this test has failed spuriously see the note at the top of this macro.
#[test]
fn removing_a_dep_cant_brake(
fn removing_a_dep_cant_break(
PrettyPrintRegistry(input) in registry_strategy(50, 20, 60),
indexs_to_remove in collection::vec((any::<prop::sample::Index>(), any::<prop::sample::Index>()), ..10)
indexes_to_remove in collection::vec((any::<prop::sample::Index>(), any::<prop::sample::Index>()), ..10)
) {
let reg = registry(input.clone());
let mut removed_input = input.clone();
for (summery_idx, dep_idx) in indexs_to_remove {
for (summery_idx, dep_idx) in indexes_to_remove {
if removed_input.len() > 0 {
let summery_idx = summery_idx.index(removed_input.len());
let deps = removed_input[summery_idx].dependencies();
Expand All @@ -122,7 +122,7 @@ proptest! {
}
}
let removed_reg = registry(removed_input);
// there is only a small chance that eny one
// there is only a small chance that any one
// crate will be interesting.
// So we try some of the most complicated.
for this in input.iter().rev().take(10) {
Expand All @@ -149,10 +149,10 @@ proptest! {
#[test]
fn limited_independence_of_irrelevant_alternatives(
PrettyPrintRegistry(input) in registry_strategy(50, 20, 60),
indexs_to_unpublish in collection::vec(any::<prop::sample::Index>(), ..10)
indexes_to_unpublish in collection::vec(any::<prop::sample::Index>(), ..10)
) {
let reg = registry(input.clone());
// there is only a small chance that eny one
// there is only a small chance that any one
// crate will be interesting.
// So we try some of the most complicated.
for this in input.iter().rev().take(10) {
Expand All @@ -172,13 +172,13 @@ proptest! {
.filter(|x| !r.contains(&x.package_id()))
.collect();
if !not_selected.is_empty() {
let indexs_to_unpublish: Vec<_> = indexs_to_unpublish.iter().map(|x| x.get(&not_selected)).collect();
let indexes_to_unpublish: Vec<_> = indexes_to_unpublish.iter().map(|x| x.get(&not_selected)).collect();

let new_reg = registry(
input
.iter()
.cloned()
.filter(|x| !indexs_to_unpublish.contains(&x))
.filter(|x| !indexes_to_unpublish.contains(&x))
.collect(),
);

Expand All @@ -196,7 +196,7 @@ proptest! {
prop_assert!(
res.is_ok(),
"unpublishing {:?} stopped `{} = \"={}\"` from working",
indexs_to_unpublish.iter().map(|x| x.package_id()).collect::<Vec<_>>(),
indexes_to_unpublish.iter().map(|x| x.package_id()).collect::<Vec<_>>(),
this.name(),
this.version()
)
Expand All @@ -206,13 +206,13 @@ proptest! {
Err(_) => {
// If resolution was unsuccessful, then it should stay unsuccessful
// even if any version of a crate is unpublished.
let indexs_to_unpublish: Vec<_> = indexs_to_unpublish.iter().map(|x| x.get(&input)).collect();
let indexes_to_unpublish: Vec<_> = indexes_to_unpublish.iter().map(|x| x.get(&input)).collect();

let new_reg = registry(
input
.iter()
.cloned()
.filter(|x| !indexs_to_unpublish.contains(&x))
.filter(|x| !indexes_to_unpublish.contains(&x))
.collect(),
);

Expand All @@ -227,7 +227,7 @@ proptest! {
"full index did not work for `{} = \"={}\"` but unpublishing {:?} fixed it!",
this.name(),
this.version(),
indexs_to_unpublish.iter().map(|x| x.package_id()).collect::<Vec<_>>(),
indexes_to_unpublish.iter().map(|x| x.package_id()).collect::<Vec<_>>(),
)
}
}
Expand Down
2 changes: 1 addition & 1 deletion tests/testsuite/support/resolver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,7 @@ pub fn registry_strategy(
/// that it makes registries with large dependency trees
///
/// This is a form of randomized testing, if you are unlucky it can fail.
/// A failure on it's own is not a big dael. If you did not change the
/// A failure on its own is not a big deal. If you did not change the
/// `registry_strategy` then feel free to retry without concern.
#[test]
fn meta_test_deep_trees_from_strategy() {
Expand Down

0 comments on commit fae4dce

Please sign in to comment.