Skip to content

rustfix: Fix ignored tests #13034

Closed
@ehuss

Description

@ehuss

For some reason, several tests in rustfix are ignored:

  • edition tests: https://github.com/rust-lang/cargo/blob/65d0eb536dd4a7ae6ddc50ca14556896e450c4ff/crates/rustfix/tests/parse_and_replace.rs#L242C1-L247. There don't appear to be any edition tests, so I think all of that should just be removed.
  • These two proptests:
    proptest! {
    #[test]
    #[ignore]
    fn new_to_vec_roundtrip(ref s in "\\PC*") {
    assert_eq!(s.as_bytes(), Data::new(s.as_bytes()).to_vec().as_slice());
    }
    #[test]
    #[ignore]
    fn replace_random_chunks(
    ref data in "\\PC*",
    ref replacements in prop::collection::vec(
    (any::<::std::ops::Range<usize>>(), any::<Vec<u8>>()),
    1..1337,
    )
    ) {
    let mut d = Data::new(data.as_bytes());
    for &(ref range, ref bytes) in replacements {
    let _ = d.replace_range(range.clone(), bytes);
    }
    }
    }
    }
    . I'm guessing that these are ignored because they were either slow, or had errors. However, in my testing they seem to run pretty fast, so I'm guessing we could just remove the #[ignore]. This needs a little investigation, just to make sure these tests aren't flaky or anything.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-testing-cargo-itselfArea: cargo's testsCommand-fixS-acceptedStatus: Issue or feature is accepted, and has a team member available to help mentor or review

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions