Skip to content

Commit 929f9fd

Browse files
authored
test(ilm): cover duplicate filter tag rejection (#376)
1 parent c97a418 commit 929f9fd

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

crates/core/tests/lifecycle_import_dialect.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,18 @@ fn s3_filter_and_combination_is_flattened() {
8484
assert_eq!(config.rules[0].object_size_less_than, Some(1000));
8585
}
8686

87+
#[test]
88+
fn s3_filter_and_rejects_duplicate_tag_keys() {
89+
let error = parse_error(
90+
r#"{"rules":[{"id":"r","status":"Enabled","filter":{"And":{"Tag":{"Key":"env","Value":"prod"},"Tags":[{"Key":"env","Value":"staging"}]}}}]}"#,
91+
);
92+
93+
assert!(
94+
error.contains("duplicate tag key in Filter.And: env"),
95+
"{error}"
96+
);
97+
}
98+
8799
#[test]
88100
fn s3_standalone_object_size_greater_than_filter_is_accepted() {
89101
let config = parse(

0 commit comments

Comments
 (0)