From bd6089f7c9f1f02a6f7f8fca506954f0db1dbfa3 Mon Sep 17 00:00:00 2001 From: Gwilym Kuiper Date: Thu, 4 Aug 2022 21:14:47 +0100 Subject: [PATCH] Add some tests for tools --- tools/src/publish.rs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/tools/src/publish.rs b/tools/src/publish.rs index 41c85ffc..6911ad75 100644 --- a/tools/src/publish.rs +++ b/tools/src/publish.rs @@ -132,4 +132,20 @@ mod test { ) } } + + #[test] + fn should_find_root_directory() -> Result<(), Error> { + assert_ne!(find_agb_root_directory()?.to_string_lossy(), ""); + + Ok(()) + } + + #[test] + fn should_read_version() -> Result<(), Error> { + let root_directory = find_agb_root_directory()?; + let my_version = read_cargo_toml_version(&root_directory.join("tools"))?; + + assert_eq!(my_version, "0.1.0"); + Ok(()) + } }