File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ pub const CONFIG_FILE_PATH: &str = "rust-bors.toml";
11
11
/// Configuration of a repository loaded from a `rust-bors.toml`
12
12
/// file located in the root of the repository file tree.
13
13
#[ derive( serde:: Deserialize , Debug ) ]
14
+ #[ serde( deny_unknown_fields) ]
14
15
pub struct RepositoryConfig {
15
16
/// Maximum duration (in seconds) to wait for CI checks to complete before timing out.
16
17
/// Defaults to 3600 seconds (1 hour).
@@ -268,6 +269,13 @@ try = ["foo"]
268
269
"# ) ;
269
270
}
270
271
272
+ #[ test]
273
+ #[ should_panic( expected = "unknown field `labels-blocking-approval`" ) ]
274
+ fn deserialize_unknown_key_fail ( ) {
275
+ let content = r#"labels-blocking-approval = ["foo", "bar"]"# ;
276
+ load_config ( content) ;
277
+ }
278
+
271
279
fn load_config ( config : & str ) -> RepositoryConfig {
272
280
toml:: from_str ( config) . unwrap ( )
273
281
}
You can’t perform that action at this time.
0 commit comments