Skip to content

Commit 203b108

Browse files
authored
test fixes (#600)
* test fixes * filter mac osx until stable pulls right crate
1 parent 3c32c84 commit 203b108

File tree

15 files changed

+42
-41
lines changed

15 files changed

+42
-41
lines changed

.travis.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ matrix:
2424
- rust: stable
2525
os: linux
2626
env: CONTENT_TESTS=1 CONTENT_TESTS_LINKS=1
27+
- rust: stable
28+
os: osx
2729

2830
addons:
2931
apt:

Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ data-encoding = "2.1.0"
2323
env_logger = "0.5"
2424
error-chain = "0.12"
2525
flate2 = "1.0"
26-
glob = "0.2"
26+
glob = "0.3"
2727
image = "0.20"
2828
lazy_static = "1.0"
2929
log = "0.4"
@@ -63,9 +63,9 @@ walkdir = "2.0"
6363
syslog = "5.0"
6464

6565
[build-dependencies]
66-
skeptic = "0.13"
66+
skeptic = { git = 'https://github.com/andygauge/rust-skeptic'}
6767
walkdir = "2.0"
6868

6969
[dev-dependencies]
70-
skeptic = "0.13"
70+
skeptic = { git = 'https://github.com/andygauge/rust-skeptic'}
7171
walkdir = "2.0"

src/algorithms/randomness/rand-custom.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
Randomly generates a tuple `(i32, bool, f64)` and variable of user defined type `Point`.
66
Implements the [`Distribution`] trait on type Point for [`Standard`] in order to allow random generation.
77

8-
```rust,edition2018,ignore
8+
```rust,edition2018
99
use rand::Rng;
1010
use rand::distributions::{Distribution, Standard};
1111

src/algorithms/randomness/rand-dist.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,10 @@ An example using the [`Normal`] distribution is shown below.
1414

1515
```rust,edition2018,ignore
1616
use rand_distr::{Distribution, Normal, NormalError};
17+
use rand::thread_rng;
1718
1819
fn main() -> Result<(), NormalError> {
19-
let mut rng = rand::thread_rng();
20+
let mut rng = thread_rng();
2021
let normal = Normal::new(2.0, 3.0)?;
2122
let v = normal.sample(&mut rng);
2223
println!("{} is from a N(2, 9) distribution", v);

src/algorithms/randomness/rand-passwd.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
Randomly generates a string of given length ASCII characters in the range `A-Z,
66
a-z, 0-9`, with [`Alphanumeric`] sample.
77

8-
```rust,edition2018,ignore
8+
```rust,edition2018
99
use rand::{thread_rng, Rng};
1010
use rand::distributions::Alphanumeric;
1111

src/algorithms/randomness/rand-range.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
Generates a random value within half-open `[0, 10)` range (not including `10`) with [`Rng::gen_range`].
66

7-
```rust,edition2018,ignore
7+
```rust,edition2018
88
use rand::Rng;
99
1010
fn main() {
@@ -18,7 +18,7 @@ fn main() {
1818
This has the same effect, but may be faster when repeatedly generating numbers
1919
in the same range.
2020

21-
```rust,edition2018,ignore
21+
```rust,edition2018
2222
2323
use rand::distributions::{Distribution, Uniform};
2424

src/concurrency/parallel/rayon-parallel-sort.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ values in parallel. Although [multiple options]
99
exist to sort an enumerable data type, [`par_sort_unstable`]
1010
is usually faster than [stable sorting] algorithms.
1111

12-
```rust,edition2018,ignore
12+
```rust,edition2018
1313
1414
use rand::{Rng, thread_rng};
1515
use rand::distributions::Alphanumeric;

src/concurrency/parallel/rayon-thumbnails.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ use rayon::prelude::*;
2929
3030
fn main() -> Result<()> {
3131
let options: MatchOptions = Default::default();
32-
let files: Vec<_> = glob_with("*.jpg", &options)?
32+
let files: Vec<_> = glob_with("*.jpg", options)?
3333
.filter_map(|x| x.ok())
3434
.collect();
3535

src/cryptography/encryption/pbkdf2.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ function [`pbkdf2::derive`]. Verifies the hash is correct with
99
[`SecureRandom::fill`], which fills the salt byte array with
1010
securely generated random numbers.
1111

12-
```rust,edition2018,ignore
12+
```rust,edition2018
1313
1414
use data_encoding::HEXUPPER;
1515
use ring::error::Unspecified;

src/development_tools/build_tools/cc-bundled-static.md

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -56,24 +56,24 @@ void greet(const char* name) {
5656
### `src/main.rs`
5757
5858
```rust,edition2018,ignore
59+
use error_chain::error_chain;
5960
use std::ffi::CString;
6061
use std::os::raw::c_char;
61-
#
62-
# error_chain! {
63-
# foreign_links {
64-
# NulError(::std::ffi::NulError);
65-
# Io(::std::io::Error);
66-
# }
67-
# }
68-
#
69-
# fn prompt(s: &str) -> Result<String> {
70-
# use std::io::Write;
71-
# print!("{}", s);
72-
# std::io::stdout().flush()?;
73-
# let mut input = String::new();
74-
# std::io::stdin().read_line(&mut input)?;
75-
# Ok(input.trim().to_string())
76-
# }
62+
63+
error_chain! {
64+
foreign_links {
65+
NulError(::std::ffi::NulError);
66+
Io(::std::io::Error);
67+
}
68+
}
69+
fn prompt(s: &str) -> Result<String> {
70+
use std::io::Write;
71+
print!("{}", s);
72+
std::io::stdout().flush()?;
73+
let mut input = String::new();
74+
std::io::stdin().read_line(&mut input)?;
75+
Ok(input.trim().to_string())
76+
}
7777
7878
extern {
7979
fn hello();

src/encoding/string/percent-encode.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Encode an input string with [percent-encoding] using the [`utf8_percent_encode`]
66
function from the `percent-encoding` crate. Then decode using the [`percent_decode`]
77
function.
88

9-
```rust,edition2018,ignore
9+
```rust,edition2018
1010
use percent_encoding::{utf8_percent_encode, percent_decode, AsciiSet, CONTROLS};
1111
use std::str::Utf8Error;
1212

src/file/dir/ignore-case.md

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,24 +7,23 @@ Find all image files in the `/media/` directory matching the `img_[0-9]*.png` pa
77
A custom [`MatchOptions`] struct is passed to the [`glob_with`] function making the glob pattern case insensitive while keeping the other options [`Default`].
88

99
```rust,edition2018,no_run
10-
# use error_chain::error_chain;
11-
10+
use error_chain::error_chain;
1211
use glob::{glob_with, MatchOptions};
13-
#
14-
# error_chain! {
15-
# foreign_links {
16-
# Glob(glob::GlobError);
17-
# Pattern(glob::PatternError);
18-
# }
19-
# }
12+
13+
error_chain! {
14+
foreign_links {
15+
Glob(glob::GlobError);
16+
Pattern(glob::PatternError);
17+
}
18+
}
2019
2120
fn main() -> Result<()> {
2221
let options = MatchOptions {
2322
case_sensitive: false,
2423
..Default::default()
2524
};
2625
27-
for entry in glob_with("/media/img_[0-9]*.png", &options)? {
26+
for entry in glob_with("/media/img_[0-9]*.png", options)? {
2827
println!("{}", entry?.display());
2928
}
3029

src/web/clients/api/rate-limited.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ handle remote server errors. This example uses the [`hyper::header!`] macro
77
to parse the response header and checks for [`reqwest::StatusCode::Forbidden`].
88
If the response exceeds the rate limit, the example waits and retries.
99

10-
```rust,edition2018,no_run,ignore
10+
```rust,edition2018,no_run
1111
# use error_chain::error_chain;
1212
1313
use std::time::{Duration, UNIX_EPOCH};

src/web/clients/requests/header.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ with [`RequestBuilder::header`] then makes the request with
1414
The request targets <http://httpbin.org/headers> service which responds with
1515
a JSON dict containing all request headers for easy verification.
1616

17-
```rust,edition2018,no_run,ignore
17+
```rust,edition2018,no_run
1818
# use error_chain::error_chain;
1919
use serde::Deserialize;
2020

src/web/scraping/broken.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ use reqwest::StatusCode;
1717
use select::document::Document;
1818
use select::predicate::Name;
1919
use std::collections::HashSet;
20-
use tokio::stream::{self, StreamExt};
2120
use url::{Position, Url};
2221
2322
error_chain! {

0 commit comments

Comments
 (0)