Skip to content

Commit aa0e9c1

Browse files
authored
Merge pull request #17 from ariel-miculas/fix_doctest
Fix doctest and run doctests in github CI
2 parents 658a0de + 9df6a22 commit aa0e9c1

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ jobs:
3737
run: cargo build --all-targets
3838
- name: cargo test
3939
run: cargo test --all-targets
40+
# https://github.com/rust-lang/cargo/issues/6669
41+
- name: cargo test --doc
42+
run: cargo test --doc
4043
linting:
4144
name: Lints, pinned toolchain
4245
runs-on: ubuntu-latest

Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,6 @@ serde_json = "1.0.64"
2020
tar = "0.4.38"
2121
thiserror = "1"
2222
oci-spec = "0.7.0"
23+
24+
[dev-dependencies]
25+
anyhow = "1.0.89"

src/lib.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,11 @@
1818
//!
1919
//! ```rust,no_run
2020
//! # use ocidir::cap_std;
21+
//! # use anyhow::{anyhow, Result};
2122
//! # fn main() -> anyhow::Result<()> {
2223
//! let d = cap_std::fs::Dir::open_ambient_dir("/path/to/ocidir", cap_std::ambient_authority())?;
2324
//! let d = ocidir::OciDir::open(&d)?;
24-
//! println!("{:?}", d.read_manifest()?);
25+
//! println!("{:?}", d.read_index()?.ok_or_else(|| anyhow!("missing Image Index"))?);
2526
//! # Ok(())
2627
//! # }
2728
//! ```

0 commit comments

Comments
 (0)