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