diff options
author | Teddy Wing | 2022-03-13 01:48:59 +0100 |
---|---|---|
committer | Teddy Wing | 2022-03-13 01:54:17 +0100 |
commit | 306dec4c599736ecffef321fc419e3fa7bec77a3 (patch) | |
tree | 106d1e03ed927d02ebb0b51bce2cacb7cc29cc04 | |
parent | 336d2d0246407b596760fdb9e5c2a9bc46c8f29a (diff) | |
download | yaqlite-306dec4c599736ecffef321fc419e3fa7bec77a3.tar.bz2 |
insert(): Add a test for nonexistent column handling
Check that nonexistent columns are ignored from the input YAML.
-rw-r--r-- | src/lib.rs | 20 |
1 files changed, 20 insertions, 0 deletions
@@ -111,6 +111,26 @@ r#"- description: >- #[test] fn ignores_yaml_fields_that_are_not_column_names() { + let expected = TestRecord { + id: 1, + count: 55, + weight: 7.65, + description: "Some text content.".to_owned(), + }; + + let yaml_str = format!( +r#"- description: >- + {} + count: {} + weight: {} + nonexistent_column: Must not be inserted. +"#, + expected.description, + expected.count, + expected.weight, + ); + + test_yaml_insert(&yaml_str, &vec![expected]); } #[test] |