css_ast 0.0.21

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

	#[test]
	fn size_test() {
		assert_eq!(std::mem::size_of::<AlignContentStyleValue>(), 32);
		assert_eq!(std::mem::size_of::<JustifyContentStyleValue>(), 32);
		assert_eq!(std::mem::size_of::<PlaceContentStyleValue>(), 64);
		assert_eq!(std::mem::size_of::<JustifySelfStyleValue>(), 32);
		assert_eq!(std::mem::size_of::<AlignSelfStyleValue>(), 32);
		assert_eq!(std::mem::size_of::<PlaceSelfStyleValue>(), 64);
		assert_eq!(std::mem::size_of::<JustifyItemsStyleValue>(), 32);
		assert_eq!(std::mem::size_of::<AlignItemsStyleValue>(), 32);
		assert_eq!(std::mem::size_of::<PlaceItemsStyleValue>(), 64);
		assert_eq!(std::mem::size_of::<RowGapStyleValue>(), 20);
		assert_eq!(std::mem::size_of::<ColumnGapStyleValue>(), 20);
		assert_eq!(std::mem::size_of::<GapStyleValue>(), 40);
	}

	#[test]
	fn test_writes() {
		assert_parse!(CssAtomSet::ATOMS, AlignContentStyleValue, "normal");
		assert_parse!(CssAtomSet::ATOMS, AlignContentStyleValue, "safe flex-end");
		assert_parse!(CssAtomSet::ATOMS, AlignContentStyleValue, "flex-end");
		// assert_parse!(CssAtomSet::ATOMS, PlaceContentStyleValue, "unsafe flex-end");
		// assert_parse!(CssAtomSet::ATOMS, PlaceContentStyleValue, "flex-end");
		assert_parse!(CssAtomSet::ATOMS, AlignSelfStyleValue, "normal");
		assert_parse!(CssAtomSet::ATOMS, AlignSelfStyleValue, "safe normal");
		assert_parse!(CssAtomSet::ATOMS, AlignSelfStyleValue, "safe end");
		assert_parse!(CssAtomSet::ATOMS, AlignSelfStyleValue, "safe flex-start");
		assert_parse!(CssAtomSet::ATOMS, AlignSelfStyleValue, "flex-start");
		assert_parse!(CssAtomSet::ATOMS, RowGapStyleValue, "normal");
		assert_parse!(CssAtomSet::ATOMS, ColumnGapStyleValue, "1px");
		assert_parse!(CssAtomSet::ATOMS, GapStyleValue, "normal 1px");
	}

	#[test]
	fn test_errors() {
		assert_parse_error!(CssAtomSet::ATOMS, AlignSelfStyleValue, "none");
	}
}