diff options
| author | Teddy Wing | 2022-03-18 20:53:15 +0100 | 
|---|---|---|
| committer | Teddy Wing | 2022-03-18 20:53:15 +0100 | 
| commit | 052e0e9639e15a4cce5cb5f0ec6399ed195ebb90 (patch) | |
| tree | e705dad983f1cd8c79b626ee2a654e1f15038d0c /src | |
| parent | bab9dffa1ec169965f21c99e84b47166c1247eb9 (diff) | |
| download | yaqlite-052e0e9639e15a4cce5cb5f0ec6399ed195ebb90.tar.bz2 | |
select(): Add and check expected value in test
Diffstat (limited to 'src')
| -rw-r--r-- | src/select.rs | 14 | 
1 files changed, 14 insertions, 0 deletions
| 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(); | 
