From 052e0e9639e15a4cce5cb5f0ec6399ed195ebb90 Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Fri, 18 Mar 2022 20:53:15 +0100 Subject: select(): Add and check expected value in test --- src/select.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src') diff --git a/src/select.rs b/src/select.rs index 5e67bc1..6f82727 100644 --- a/src/select.rs +++ b/src/select.rs @@ -77,6 +77,18 @@ mod tests { With multiple paragraphs.".to_owned(), }; + let mut yaml_hash = yaml_rust::yaml::Hash::new(); + yaml_hash.insert( + yaml_rust::Yaml::String("count".to_owned()), + yaml_rust::Yaml::Integer(record.count.into()), + ); + yaml_hash.insert( + yaml_rust::Yaml::String("description".to_owned()), + yaml_rust::Yaml::String(record.description.clone()), + ); + + let expected = yaml_rust::Yaml::Hash(yaml_hash); + let conn = rusqlite::Connection::open_in_memory().unwrap(); conn.execute( @@ -105,6 +117,8 @@ With multiple paragraphs.".to_owned(), let got = select(&conn, "test", "1"); dbg!(&got); + + assert_eq!(expected, got); } conn.close().unwrap(); -- cgit v1.2.3