aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/insert.rs24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/insert.rs b/src/insert.rs
index 59c8850..0c9f45e 100644
--- a/src/insert.rs
+++ b/src/insert.rs
@@ -205,4 +205,28 @@ weight: {}
test_yaml_insert(&yaml_str, &vec![expected]);
}
+
+ #[test]
+ fn insert_ignores_non_column_yaml_fields() {
+ let expected = TestRecord {
+ id: 1,
+ count: 102,
+ weight: 79.4,
+ description: "Some text content.".to_owned(),
+ };
+
+ let yaml_str = format!(
+r#"description: {}
+count: {}
+weight: {}
+key_is_not_a_column: 44
+not-a-column: Text that shouldn't be inserted.
+"#,
+ expected.description,
+ expected.count,
+ expected.weight,
+ );
+
+ test_yaml_insert(&yaml_str, &vec![expected]);
+ }
}