Skip to content

Commit a16b766

Browse files
committed
add tests
1 parent 98596d3 commit a16b766

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

src/property.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -543,4 +543,18 @@ mod tests {
543543
assert_eq!(result[0].condition, "id > 5");
544544
assert_eq!(result[1].condition, "id < 3");
545545
}
546+
547+
#[test]
548+
fn test_property_enum_value_from_odd_elements() {
549+
let source = vec!["HIGH".to_string(), "red".to_string(), "orphan".to_string()];
550+
let result = PropertyEnumValue::from(source);
551+
assert_eq!(result.len(), 1, "Odd trailing element should be ignored without panic");
552+
}
553+
554+
#[test]
555+
fn test_property_cond_format_from_odd_elements() {
556+
let source = vec!["id > 5".to_string(), "red".to_string(), "orphan".to_string()];
557+
let result = PropertyCondFormat::from(source);
558+
assert_eq!(result.len(), 1, "Odd trailing element should be ignored without panic");
559+
}
546560
}

0 commit comments

Comments
 (0)