diff options
author | Lars Wirzenius <liw@liw.fi> | 2019-09-21 19:51:32 +0300 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2019-09-21 19:51:32 +0300 |
commit | 07e49973baac0e9db3ee5b1deffb0224aca5c915 (patch) | |
tree | bea52707745ad5a8f7bf8c1939cd94f2ee861c70 /src/lib.rs | |
parent | 842f41c5c8f188cad1e21551c7330b2d4ab8069b (diff) | |
download | roadmap-07e49973baac0e9db3ee5b1deffb0224aca5c915.tar.gz |
Change: docstrings
Diffstat (limited to 'src/lib.rs')
-rw-r--r-- | src/lib.rs | 35 |
1 files changed, 13 insertions, 22 deletions
@@ -11,29 +11,20 @@ //! ``` //! # use roadmap::Step; //! # fn main() -> std::result::Result<(), Box<dyn std::error::Error>> { -//! let mut r = roadmap::Roadmap::new(); -//! assert_eq!(r.step_names().len(), 0); +//! let mut r = roadmap::Roadmap::from_yaml(" +//! endgoal: +//! label: The end goal +//! depends: +//! - first +//! first: +//! label: The first step +//! ").unwrap(); //! -//! let mut endgoal = roadmap::Step::new("endgoal", "the end goal"); -//! endgoal.add_dependency("first"); -//! assert_eq!(endgoal.name(), "endgoal"); -//! assert_eq!(endgoal.label(), "the end goal"); -//! let deps: Vec<&String> = endgoal.dependencies().collect(); -//! assert_eq!(deps, vec!["first"]); -//! -//! let first = roadmap::Step::new("first", "the first step"); -//! -//! r.add_step(&endgoal)?; -//! assert_eq!(r.step_names().len(), 1); -//! r.add_step(&first)?; -//! assert_eq!(r.step_names().len(), 2); -//! -//! assert_eq!(r.as_dot()?, r#"digraph "roadmap" { -//! endgoal [label="the end goal"]; -//! first [label="the first step"]; -//! first -> endgoal; -//! } -//! "#.to_string()); +//! let n = r.step_names(); +//! assert_eq!(n.len(), 2); +//! assert!(n.contains(&"first")); +//! assert!(n.contains(&"endgoal")); +//! //! # Ok(()) //! # } //! ``` |