diff options
| author | Teddy Wing | 2022-04-05 19:53:20 +0200 | 
|---|---|---|
| committer | Teddy Wing | 2022-04-05 19:53:20 +0200 | 
| commit | 5f8b19f73b1a506cdcc4a33113a10c470927d09d (patch) | |
| tree | 07fedac476590ac6d40c47770717e4b1da9c849d | |
| parent | bc0afe2353f925124c67bf5785813432de44af57 (diff) | |
| download | yaqlite-5f8b19f73b1a506cdcc4a33113a10c470927d09d.tar.bz2 | |
insert(): Add a test with YAML keys referring to nonexistent columnsupdate
| -rw-r--r-- | src/insert.rs | 24 | 
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]); +    }  } | 
