Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pull] master from proptest-rs:master #25

Merged
merged 26 commits into from
Apr 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
a6afbe0
SM: update proptest dep to latest
tzemanovic Nov 22, 2023
f896843
SM/test: update number of expected simplifications
tzemanovic Nov 22, 2023
3b44d44
SM: bump minor version
tzemanovic Nov 22, 2023
01d92e2
SM: update changelog
tzemanovic Nov 22, 2023
8f1b35e
Fix re-complication of initial state
timstobal Jan 13, 2024
f0d55f7
Fix hygiene issues with prop_state_machine macro
timstobal Sep 19, 2023
a16f6c3
Merge pull request #420 from timstobal/tc/sm-macro-hygiene
rexmas Feb 5, 2024
c1bf635
Merge pull request #418 from timstobal/recomplicate-initial
rexmas Feb 5, 2024
b712538
cleanup some compiler warnings/errors (#422)
rexmas Feb 12, 2024
1bec308
[Fix] Derive : fix compiletest (#426)
matthew-russo Feb 19, 2024
91549b7
[Fix] fix clippies (#425)
matthew-russo Feb 19, 2024
d1c9b84
[Fix] Config : don't clobber existing failure-persistence config duri…
matthew-russo Feb 19, 2024
b1be99d
fix: use anon-const for wrapping expanded impls (#427)
shekhirin Mar 4, 2024
1b7c426
Fix feature = "cargo-clippy" deprecation (#429)
rex4539 Mar 4, 2024
72ce2f1
Use `array::from_fn` instead of `unarray::build_array` (#432)
DaniPopes Mar 6, 2024
5b1931a
Merge pull request #401 from tzemanovic/tomas/sm-prep-for-release
rexmas Mar 8, 2024
923d50f
chore: fix some typos
tgolang Mar 11, 2024
2efefa8
Merge pull request #433 from tgolang/master
rexmas Mar 17, 2024
2f1b673
delete unseen transitions in state machine test
henriiik Oct 19, 2023
bd4fc66
add fallback to avoid panic
henriiik Oct 19, 2023
7634f32
panic on misuse
henriiik Oct 20, 2023
c7d383f
changelog: add #388
tzemanovic Mar 21, 2024
418c912
Merge branch 'hs/simplify-unseen' (#388)
tzemanovic Mar 21, 2024
fdde49b
SM: bump minor version
tzemanovic Mar 21, 2024
6916045
SM: update changelog for v0.3.0
tzemanovic Mar 21, 2024
b449b1e
Merge branch 'tomas/sm-prep-for-release' (#435)
tzemanovic Mar 22, 2024
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
4 changes: 1 addition & 3 deletions proptest-derive/src/ast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,6 @@ impl Impl {

let _top = call_site_ident(TOP_PARAM_NAME);

let _const = call_site_ident(&format!("_IMPL_ARBITRARY_FOR_{}", typ));

// Linearise everything. We're done after this.
//
// NOTE: The clippy::arc_with_non_send_sync lint is disabled here because the strategies
Expand All @@ -118,7 +116,7 @@ impl Impl {
let q = quote! {
#[allow(non_upper_case_globals)]
#[allow(clippy::arc_with_non_send_sync)]
const #_const: () = {
const _: () = {
extern crate proptest as _proptest;

impl #impl_generics _proptest::arbitrary::Arbitrary
Expand Down
4 changes: 0 additions & 4 deletions proptest-derive/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -505,10 +505,6 @@ error!(
in Rust. An example: `#[proptest(params = \"ComplexType<Foo>\")]`."
);

// Happens when syn can't interpret <tts> in `#[proptest <tts>]`.
error!(no_interp_meta, E0024,
"The tokens `<tts>` in #[proptest <tts>] do not make for a valid attribute.");

// Happens when more than one of `#[proptest(strategy..)]`,
// `#[proptest(value..)]`, or `#[proptest(regex..)]` were specified.
// They are mutually exclusive choices.
Expand Down
6 changes: 3 additions & 3 deletions proptest-derive/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ test! {
} expands to {
#[allow(non_upper_case_globals)]
#[allow(clippy::arc_with_non_send_sync)]
const _IMPL_ARBITRARY_FOR_MyUnitStruct : () = {
const _: () = {
extern crate proptest as _proptest;
impl _proptest::arbitrary::Arbitrary for MyUnitStruct {
type Parameters = ();
Expand All @@ -101,7 +101,7 @@ test! {
} expands to {
#[allow(non_upper_case_globals)]
#[allow(clippy::arc_with_non_send_sync)]
const _IMPL_ARBITRARY_FOR_MyTupleUnitStruct : () = {
const _: () = {
extern crate proptest as _proptest;
impl _proptest::arbitrary::Arbitrary for MyTupleUnitStruct {
type Parameters = ();
Expand All @@ -122,7 +122,7 @@ test! {
} expands to {
#[allow(non_upper_case_globals)]
#[allow(clippy::arc_with_non_send_sync)]
const _IMPL_ARBITRARY_FOR_MyNamedUnitStruct : () = {
const _: () = {
extern crate proptest as _proptest;
impl _proptest::arbitrary::Arbitrary for MyNamedUnitStruct {
type Parameters = ();
Expand Down
1 change: 1 addition & 0 deletions proptest-derive/tests/compile-fail/E0025-overspec-strat.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

#[macro_use]
extern crate proptest_derive;
use proptest_derive::Arbitrary;

fn main() {}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

#[macro_use]
extern crate proptest_derive;
use proptest_derive::Arbitrary;

fn main() {}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

#[macro_use]
extern crate proptest_derive;
use proptest_derive::Arbitrary;

fn main() {}

Expand Down Expand Up @@ -153,4 +154,4 @@ enum T19 {
V1(
u8,
),
}
}
3 changes: 2 additions & 1 deletion proptest-derive/tests/compile-fail/E0027-filter-malformed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

#[macro_use]
extern crate proptest_derive;
use proptest_derive::Arbitrary;

fn main() {}

Expand Down Expand Up @@ -81,4 +82,4 @@ struct T8(u8);

#[derive(Debug, Arbitrary)] //~ ERROR: [proptest_derive, E0027]
#[proptest(filter(1))]
struct T9(u8);
struct T9(u8);
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@

#[macro_use]
extern crate proptest_derive;
use proptest_derive::Arbitrary;

fn main() {}

#[derive(Debug, Arbitrary)] //~ ERROR: 2 errors
#[derive(Debug, Arbitrary)] //~ ERROR: 2 errors
//~| [proptest_derive, E0028]
//~| [proptest_derive, E0006]
enum NonFatal {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@

#[macro_use]
extern crate proptest_derive;
use proptest_derive::Arbitrary;

fn main() {}

#[derive(Debug, Arbitrary)] //~ ERROR: 2 errors
#[derive(Debug, Arbitrary)] //~ ERROR: 2 errors
//~| [proptest_derive, E0028]
//~| [proptest_derive, E0006]
enum NonFatal {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@

#[macro_use]
extern crate proptest_derive;
use proptest_derive::Arbitrary;

fn main() {}

#[derive(Debug, Arbitrary)] //~ ERROR: 2 errors
#[derive(Debug, Arbitrary)] //~ ERROR: 2 errors
//~| [proptest_derive, E0028]
//~| [proptest_derive, E0006]
enum NonFatal {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@

#[macro_use]
extern crate proptest_derive;
use proptest_derive::Arbitrary;

fn main() {}

#[derive(Debug, Arbitrary)] //~ ERROR: 2 errors
#[derive(Debug, Arbitrary)] //~ ERROR: 2 errors
//~| [proptest_derive, E0028]
//~| [proptest_derive, E0006]
enum NonFatal {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

#[macro_use]
extern crate proptest_derive;
use proptest_derive::Arbitrary;

fn main() {}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

#[macro_use]
extern crate proptest_derive;
use proptest_derive::Arbitrary;

fn main() {}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

#[macro_use]
extern crate proptest_derive;
use proptest_derive::Arbitrary;

fn main() {}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

#[macro_use]
extern crate proptest_derive;
use proptest_derive::Arbitrary;

fn main() {}

Expand Down Expand Up @@ -51,4 +52,4 @@ struct T7();

#[derive(Debug, Arbitrary)] //~ ERROR: [proptest_derive, E0030]
#[proptest(filter(foo))]
struct T8 {}
struct T8 {}
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

#[macro_use]
extern crate proptest_derive;
use proptest_derive::Arbitrary;

fn main() {}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

#[macro_use]
extern crate proptest_derive;
use proptest_derive::Arbitrary;

fn main() {}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

#[macro_use]
extern crate proptest_derive;
use proptest_derive::Arbitrary;

fn main() {}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

#[macro_use]
extern crate proptest_derive;
use proptest_derive::Arbitrary;

fn main() {}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

#[macro_use]
extern crate proptest_derive;
use proptest_derive::Arbitrary;

fn main() {}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ extern crate proptest_derive;
extern crate proptest;

use proptest::prelude::*;
use proptest_derive::Arbitrary;

fn main() {}

Expand Down
7 changes: 6 additions & 1 deletion proptest-derive/tests/compile-fail/must-be-debug.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,13 @@

#[macro_use]
extern crate proptest_derive;
use proptest_derive::Arbitrary;

fn main() {}


#[derive(Arbitrary)] //~ `Foo` doesn't implement `Debug` [E0277]
struct Foo { x: usize } //~ `Foo` doesn't implement `Debug` [E0277]
struct Foo { //~^ `Foo` doesn't implement `Debug` [E0277]
//~^ `Foo` doesn't implement `Debug` [E0277]
x: usize
}
7 changes: 6 additions & 1 deletion proptest-derive/tests/compile-fail/no-arbitrary.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,15 @@

#[macro_use]
extern crate proptest_derive;
use proptest_derive::Arbitrary;

fn main() {}

#[derive(Debug)]
struct T0;

#[derive(Debug, Arbitrary)] //~ the trait bound `T0: Arbitrary` is not satisfied [E0277]
struct T1 { f0: T0, } //~ the trait bound `T0: Arbitrary` is not satisfied [E0277]
struct T1 {
f0: T0, //~ the trait bound `T0: Arbitrary` is not satisfied [E0277]
//~^ the trait bound `T0: Arbitrary` is not satisfied [E0277]
}
25 changes: 13 additions & 12 deletions proptest-derive/tests/compile-fail/regex_wrong_type.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

#[macro_use]
extern crate proptest_derive;
use proptest_derive::Arbitrary;

fn main() {}

Expand All @@ -20,37 +21,37 @@ fn make_regex() -> &'static str {
#[derive(Debug, Arbitrary)] //~ StrategyFromRegex` is not satisfied [E0277]
struct T0 {
#[proptest(regex = "a+")]
f0: (),
f0: (), //~ StrategyFromRegex` is not satisfied [E0277]
}

#[derive(Debug, Arbitrary)] //~ StrategyFromRegex` is not satisfied [E0277]
struct T1 {
#[proptest(regex("a*"))]
f0: u8,
f0: u8, //~ StrategyFromRegex` is not satisfied [E0277]
}

#[derive(Debug, Arbitrary)] //~ StrategyFromRegex` is not satisfied [E0277]
struct T2 {
#[proptest(regex(make_regex))]
f0: Vec<u16>,
f0: Vec<u16>, //~ StrategyFromRegex` is not satisfied [E0277]
}

#[derive(Debug, Arbitrary)] //~ StrategyFromRegex` is not satisfied [E0277]
struct T3(
#[proptest(regex = "a+")]
(),
(), //~ StrategyFromRegex` is not satisfied [E0277]
);

#[derive(Debug, Arbitrary)] //~ StrategyFromRegex` is not satisfied [E0277]
struct T4(
#[proptest(regex("a*"))]
u8,
u8, //~ StrategyFromRegex` is not satisfied [E0277]
);

#[derive(Debug, Arbitrary)] //~ StrategyFromRegex` is not satisfied [E0277]
struct T5(
#[proptest(regex(make_regex))]
Vec<u16>,
Vec<u16>, //~ StrategyFromRegex` is not satisfied [E0277]
);

// enum:
Expand All @@ -59,46 +60,46 @@ struct T5(
enum T6 {
V0 {
#[proptest(regex = "a+")]
f0: (),
f0: (), //~ StrategyFromRegex` is not satisfied [E0277]
}
}

#[derive(Debug, Arbitrary)] //~ StrategyFromRegex` is not satisfied [E0277]
enum T7 {
V0 {
#[proptest(regex("a*"))]
f0: u8,
f0: u8, //~ StrategyFromRegex` is not satisfied [E0277]
}
}

#[derive(Debug, Arbitrary)] //~ StrategyFromRegex` is not satisfied [E0277]
enum T8 {
V0 {
#[proptest(regex(make_regex))]
f0: Vec<u16>,
f0: Vec<u16>, //~ StrategyFromRegex` is not satisfied [E0277]
}
}

#[derive(Debug, Arbitrary)] //~ StrategyFromRegex` is not satisfied [E0277]
enum T9 {
V0(
#[proptest(regex = "a+")]
(),
(), //~ StrategyFromRegex` is not satisfied [E0277]
)
}

#[derive(Debug, Arbitrary)] //~ StrategyFromRegex` is not satisfied [E0277]
enum T10 {
V0(
#[proptest(regex("a*"))]
u8,
u8, //~ StrategyFromRegex` is not satisfied [E0277]
)
}

#[derive(Debug, Arbitrary)] //~ StrategyFromRegex` is not satisfied [E0277]
enum T11 {
V0(
#[proptest(regex(make_regex))]
Vec<u16>,
Vec<u16>, //~ StrategyFromRegex` is not satisfied [E0277]
)
}
1 change: 1 addition & 0 deletions proptest-derive/tests/compiletest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ fn run_mode(src: &'static str, mode: &'static str) {
config.filters = vec![name];
}
config.src_base = format!("tests/{}", src).into();
config.clean_rmeta();

ct::run_tests(&config);
}
Expand Down
Loading
Loading