Skip to content

Conversation

@emallson
Copy link
Contributor

@emallson emallson commented Dec 7, 2016

I wanted to be able to #[ignore] some of my quickcheck tests defined with quickcheck! because they're expensive and I don't want to run them every time in dev. This (short) PR adds that ability.

I don't have tests for this, because I wasn't sure how to go about doing so. All existing tests pass, however.

quickcheck! {
    #[ignore]
    fn prop(...) -> bool {
        ...
    }
}

This means it is now possible to do things like:

    quickcheck! {
        #[ignore]
        fn prop(...) -> bool {
            ...
        }
    }
@BurntSushi
Copy link
Owner

Ah this sounds like a good change! I don't think it's a breaking change. cc @bluss

I think if you just add a test like this one that uses the #[ignore] attribute, then that should be sufficient. I think that if you did that without this change, then tests would fail to compile, right?

This is done by writing a test with `assert!(false)` with the
`#[should_panic]` attr attached. If the macro is working correctly, this
test passes. If not, it fails.
@emallson
Copy link
Contributor Author

emallson commented Dec 7, 2016

@BurntSushi I had forgotten about the #[should_panic] attribute. I used that with a test containing assert!(false). As long as the attributes work, it will pass.

@BurntSushi
Copy link
Owner

Ooo good idea! I'll wait a bit and see if @bluss wants to chime in but I think this otherwise good to go! Thanks so much!

@bluss
Copy link
Contributor

bluss commented Dec 7, 2016

The macro changes look good, I think it's a good idea too!

@BurntSushi BurntSushi merged commit bf08249 into BurntSushi:master Dec 7, 2016
@BurntSushi
Copy link
Owner

Sweet off we go!

@BurntSushi
Copy link
Owner

0.4.1 is on crates.io.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants