use super::clips::CT_Clip;
#[allow(non_camel_case_types)]
#[derive(Debug, Clone, Default)]
pub struct Clips {
pub clips: Vec<CT_Clip>,
}
impl Clips {
#[must_use]
pub fn new() -> Self {
Self::default()
}
pub fn add(&mut self, clip: CT_Clip) {
self.clips.push(clip);
}
#[must_use]
pub fn len(&self) -> usize {
self.clips.len()
}
#[must_use]
pub fn is_empty(&self) -> bool {
self.clips.is_empty()
}
#[must_use]
pub fn items(&self) -> &[CT_Clip] {
&self.clips
}
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn test_clips_new() {
let clips = Clips::new();
assert!(clips.is_empty());
assert_eq!(clips.len(), 0);
}
#[test]
fn test_clips_add() {
let mut clips = Clips::new();
clips.add(CT_Clip::new());
assert_eq!(clips.len(), 1);
assert!(!clips.is_empty());
}
#[test]
fn test_clips_items() {
let mut clips = Clips::new();
clips.add(CT_Clip::new());
clips.add(CT_Clip::new());
assert_eq!(clips.items().len(), 2);
}
}