aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTeddy Wing2022-03-13 01:55:25 +0100
committerTeddy Wing2022-03-13 01:55:25 +0100
commitde7c2af3414cf686165efd933b61da4e4527cf77 (patch)
treefd7d8b2b8d28e6691bd150606e0f550f6471a648 /src
parent306dec4c599736ecffef321fc419e3fa7bec77a3 (diff)
downloadyaqlite-de7c2af3414cf686165efd933b61da4e4527cf77.tar.bz2
insert(): Add test for non-array YAML hash
Test that a plain YAML hash gets inserted even when not wrapped in an array.
Diffstat (limited to 'src')
-rw-r--r--src/lib.rs18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/lib.rs b/src/lib.rs
index 5ee5b8e..f8d0032 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -139,5 +139,23 @@ r#"- description: >-
#[test]
fn inserts_yaml_hash() {
+ let expected = TestRecord {
+ id: 1,
+ count: 255,
+ weight: 86.6,
+ description: "Some text content.".to_owned(),
+ };
+
+ let yaml_str = format!(
+r#"description: {}
+count: {}
+weight: {}
+"#,
+ expected.description,
+ expected.count,
+ expected.weight,
+ );
+
+ test_yaml_insert(&yaml_str, &vec![expected]);
}
}