From 61a1a241c82c79baa8b2a6dbb03fb70b49cca5ea Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Sun, 13 Oct 2019 10:11:59 +0200 Subject: [PATCH] Add test: imag-ids reports id after it was created Signed-off-by: Matthias Beyer --- tests/ui/src/imag_ids.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/ui/src/imag_ids.rs b/tests/ui/src/imag_ids.rs index cc6ead25..2c38906e 100644 --- a/tests/ui/src/imag_ids.rs +++ b/tests/ui/src/imag_ids.rs @@ -57,3 +57,14 @@ fn test_no_ids_after_init() { .stdout(predicate::eq(b"" as &[u8])); } +#[test] +fn test_one_id_after_creating_one_entry() { + crate::setup_logging(); + let imag_home = crate::imag::make_temphome(); + crate::imag_init::call(&imag_home); + crate::imag_create::call(&imag_home, &["test"]); + let ids = call(&imag_home); + + assert_eq!(ids.len(), 1); + assert_eq!(ids[0], "test"); +}