css_ast/types/
fixed_repeat.rs1use crate::{FixedSize, NamedRepeatItems, RepeatFunction};
2
3pub type FixedRepeat<'a> = RepeatFunction<NamedRepeatItems<'a, FixedSize<'a>>>;
9
10#[cfg(test)]
11mod tests {
12 use super::*;
13 use crate::CssAtomSet;
14 use css_parse::{assert_parse, assert_parse_error};
15
16 #[test]
17 fn test_writes() {
18 assert_parse!(CssAtomSet::ATOMS, FixedRepeat, "repeat(2,10px)");
19 assert_parse!(CssAtomSet::ATOMS, FixedRepeat, "repeat(3,[a] 10px)");
20 assert_parse!(CssAtomSet::ATOMS, FixedRepeat, "repeat(3,10px [a])");
21 }
22
23 #[test]
24 fn test_errors() {
25 assert_parse_error!(CssAtomSet::ATOMS, FixedRepeat, "repeat(2,)");
26 assert_parse_error!(CssAtomSet::ATOMS, FixedRepeat, "repeat(2,1fr)");
27 }
28}