Skip to content

Commit 83a488b

Browse files
authored
Merge pull request #597 from k-nasa/fix_doc_test
Fix failed doc test and enable doc test on CI
2 parents 2f09077 + c85e249 commit 83a488b

File tree

4 files changed

+12
-4
lines changed

4 files changed

+12
-4
lines changed

.github/workflows/ci.yml

+7-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,13 @@ jobs:
6363
uses: actions-rs/cargo@v1
6464
with:
6565
command: test
66-
args: --all --features unstable attributes
66+
args: --all --features "unstable attributes"
67+
68+
- name: documentation test
69+
uses: actions-rs/cargo@v1
70+
with:
71+
command: test
72+
args: --doc --features "unstable attributes"
6773

6874
check_fmt_and_docs:
6975
name: Checking fmt and docs

src/lib.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,8 @@
152152
//! Await two futures concurrently, and return a tuple of their output:
153153
//!
154154
//! ```
155+
//! use async_std::prelude::*;
156+
//!
155157
//! #[async_std::main]
156158
//! async fn main() {
157159
//! let a = async { 1u8 };
@@ -167,7 +169,7 @@
167169
//!
168170
//! #[async_std::main]
169171
//! async fn main() -> std::io::Result<()> {
170-
//! let mut socket = UdpSocket::bind("127.0.0.1:8080")?;
172+
//! let socket = UdpSocket::bind("127.0.0.1:8080").await?;
171173
//! println!("Listening on {}", socket.local_addr()?);
172174
//!
173175
//! let mut buf = vec![0u8; 1024];

src/stream/stream/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,7 @@ extension_trait! {
350350
assert!(start.elapsed().as_millis() >= 15);
351351
352352
s.next().await;
353-
assert!(start.elapsed().as_millis() >= 35);
353+
assert!(start.elapsed().as_millis() >= 25);
354354
#
355355
# }) }
356356
```

tests/verbose_errors.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ fn open_file() {
88
match res {
99
Ok(_) => panic!("Found file with random name: We live in a simulation"),
1010
Err(e) => assert_eq!(
11-
"Could not open `/ashjudlkahasdasdsikdhajik/asdasdasdasdasdasd/fjuiklashdbflasas`",
11+
"could not open `/ashjudlkahasdasdsikdhajik/asdasdasdasdasdasd/fjuiklashdbflasas`",
1212
&format!("{}", e)
1313
),
1414
}

0 commit comments

Comments
 (0)