summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2019-09-20 09:15:49 +0300
committerLars Wirzenius <liw@liw.fi>2019-09-20 09:15:49 +0300
commit1df087c14691674449a34dbee96491e2089ffb82 (patch)
treec13bd2b4344859fbecc50800e55669bd1168fd04 /src
parentc0e0cc59b59d18b7304b616ad2805975469a40db (diff)
downloadroadmap-1df087c14691674449a34dbee96491e2089ffb82.tar.gz
Add: first step for parsing YAML
Diffstat (limited to 'src')
-rw-r--r--src/lib.rs8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/lib.rs b/src/lib.rs
index c73dde5..6886727 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -89,7 +89,7 @@ impl Roadmap {
}
/// Create a new roadmap from a YAML representation.
- pub fn from_yaml(_yaml: String) -> Result<Roadmap, Box<dyn std::error::Error>> {
+ pub fn from_yaml(_yaml: &str) -> Result<Roadmap, Box<dyn std::error::Error>> {
Ok(Roadmap::new())
}
@@ -225,4 +225,10 @@ first -> second;
}
");
}
+
+ #[test]
+ fn from_empty_yaml() {
+ let roadmap = Roadmap::from_yaml("{}").unwrap();
+ assert_eq!(roadmap.step_names().len(), 0);
+ }
}