summaryrefslogtreecommitdiff
path: root/rust/crates/animation/src/path.rs
blob: 56256c61381d30f93881a5b143bb71c366f874a3 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
use crate::effect_param_channel::is_effect_param_path;
use crate::graphic_param_channel::is_graphic_param_path;
use crate::property_groups::is_animation_property_path;

pub fn is_animation_path(property_path: &str) -> bool {
    is_animation_property_path(property_path)
        || is_graphic_param_path(property_path)
        || is_effect_param_path(property_path)
}

#[cfg(test)]
mod tests {
    use super::*;

    #[test]
    fn classifies_animation_paths() {
        assert!(is_animation_path("opacity"));
        assert!(is_animation_path("params.blur"));
        assert!(is_animation_path("effects.glow.params.intensity"));
        assert!(!is_animation_path("transform"));
        assert!(!is_animation_path("bindings"));
    }
}