Skip to content

Commit

Permalink
Merge remote-tracking branch 'dwijnand/fix-type-mismatch' into 0.9.1-…
Browse files Browse the repository at this point in the history
…changes
  • Loading branch information
AltSysrq committed Feb 11, 2019
2 parents 76d11f7 + 1ba7f28 commit 78af8fb
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
6 changes: 3 additions & 3 deletions book/src/proptest/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ use proptest::prelude::*;
proptest! {
#[test]
fn doesnt_crash(s in "\\PC*") {
parse_date(s);
parse_date(&s);
}
}
```
Expand Down Expand Up @@ -141,7 +141,7 @@ proptest! {
#[test]
fn parses_all_valid_dates(s in "[0-9]{4}-[0-9]{2}-[0-9]{2}") {
parse_date(s).unwrap();
parse_date(&s).unwrap();
}
}
```
Expand Down Expand Up @@ -250,7 +250,7 @@ $ git add proptest-regressions
```rust,ignore
#[test]
fn test_october_first() {
assert_eq!(Some(0, 10, 1), parse_date("0000-10-01"));
assert_eq!(Some((0, 10, 1)), parse_date("0000-10-01"));
}
```

Expand Down
6 changes: 3 additions & 3 deletions proptest/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ use proptest::prelude::*;
proptest! {
#[test]
fn doesnt_crash(s in "\\PC*") {
parse_date(s);
parse_date(&s);
}
}
```
Expand Down Expand Up @@ -184,7 +184,7 @@ proptest! {
#[test]
fn parses_all_valid_dates(s in "[0-9]{4}-[0-9]{2}-[0-9]{2}") {
parse_date(s).unwrap();
parse_date(&s).unwrap();
}
}
```
Expand Down Expand Up @@ -293,7 +293,7 @@ $ git add proptest-regressions
```rust,ignore
#[test]
fn test_october_first() {
assert_eq!(Some(0, 10, 1), parse_date("0000-10-01"));
assert_eq!(Some((0, 10, 1)), parse_date("0000-10-01"));
}
```

Expand Down
4 changes: 2 additions & 2 deletions proptest/examples/dateparser_v1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ fn parse_date(s: &str) -> Option<(u32, u32, u32)> {

// NB We omit #[test] on these functions so that main() can call them.
proptest! {
fn doesnt_crash(ref s in "\\PC*") {
parse_date(s);
fn doesnt_crash(s in "\\PC*") {
parse_date(&s);
}
}

Expand Down
8 changes: 4 additions & 4 deletions proptest/examples/dateparser_v2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,12 @@ fn parse_date(s: &str) -> Option<(u32, u32, u32)> {

// NB We omit #[test] on these functions so that main() can call them.
proptest! {
fn doesnt_crash(ref s in "\\PC*") {
parse_date(s);
fn doesnt_crash(s in "\\PC*") {
parse_date(&s);
}

fn parses_all_valid_dates(ref s in "[0-9]{4}-[0-9]{2}-[0-9]{2}") {
parse_date(s).unwrap();
fn parses_all_valid_dates(s in "[0-9]{4}-[0-9]{2}-[0-9]{2}") {
parse_date(&s).unwrap();
}

fn parses_date_back_to_original(y in 0u32..10_000,
Expand Down

0 comments on commit 78af8fb

Please sign in to comment.