css_ast 0.0.31

CSS Abstract Syntax Trees with visitable nodes and style value types.
Documentation
#[cfg(test)]
mod tests {
	use super::super::*;
	use crate::CssAtomSet;
	use css_parse::{assert_parse, assert_parse_error, assert_peek_false};

	#[test]
	fn test_counter_reset() {
		assert_parse!(CssAtomSet::ATOMS, CounterResetStyleValue, "none");
		assert_parse!(CssAtomSet::ATOMS, CounterResetStyleValue, "my-counter");
		assert_parse!(CssAtomSet::ATOMS, CounterResetStyleValue, "my-counter 5");
		assert_parse!(CssAtomSet::ATOMS, CounterResetStyleValue, "a 1 b 2");
		assert_parse!(CssAtomSet::ATOMS, CounterResetStyleValue, "reversed(foo)");
		assert_parse!(CssAtomSet::ATOMS, CounterResetStyleValue, "reversed(foo) 3");
		assert_parse!(CssAtomSet::ATOMS, CounterResetStyleValue, "my-counter reversed(foo)");
		assert_peek_false!(CssAtomSet::ATOMS, CounterResetStyleValue, "123");
	}

	#[test]
	fn test_counter_increment_parses() {
		assert_parse!(CssAtomSet::ATOMS, CounterIncrementStyleValue, "none");
		assert_parse!(CssAtomSet::ATOMS, CounterIncrementStyleValue, "my-counter");
		assert_parse!(CssAtomSet::ATOMS, CounterIncrementStyleValue, "my-counter 2");
		assert_parse!(CssAtomSet::ATOMS, CounterIncrementStyleValue, "a b c");
	}

	#[test]
	fn test_counter_increment_errors() {
		assert_peek_false!(CssAtomSet::ATOMS, CounterIncrementStyleValue, "123");
	}

	#[test]
	fn test_counter_set_parses() {
		assert_parse!(CssAtomSet::ATOMS, CounterSetStyleValue, "none");
		assert_parse!(CssAtomSet::ATOMS, CounterSetStyleValue, "foo");
		assert_parse!(CssAtomSet::ATOMS, CounterSetStyleValue, "foo 5");
		assert_parse!(CssAtomSet::ATOMS, CounterSetStyleValue, "a 1 b 2");
	}

	#[test]
	fn test_counter_set_errors() {
		assert_peek_false!(CssAtomSet::ATOMS, CounterSetStyleValue, "123");
	}
}