css_ast/types/
display_legacy.rs1use super::prelude::*;
2
3#[derive(
9 Parse, Peek, IntoCursor, ToSpan, SemanticEq, ToCursors, Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash,
10)]
11#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
12#[cfg_attr(feature = "visitable", derive(csskit_derives::Visitable), visit(skip))]
13pub enum DisplayLegacy {
14 #[atom(CssAtomSet::InlineBlock)]
15 InlineBlock(T![Ident]),
16 #[atom(CssAtomSet::InlineTable)]
17 InlineTable(T![Ident]),
18 #[atom(CssAtomSet::InlineFlex)]
19 InlineFlex(T![Ident]),
20 #[atom(CssAtomSet::InlineGrid)]
21 InlineGrid(T![Ident]),
22}
23
24#[cfg(test)]
25mod tests {
26 use super::*;
27 use crate::CssAtomSet;
28 use css_parse::{assert_parse, assert_peek_false};
29
30 #[test]
31 fn size_test() {
32 assert_eq!(std::mem::size_of::<DisplayLegacy>(), 16);
33 }
34
35 #[test]
36 fn test_writes() {
37 assert_parse!(CssAtomSet::ATOMS, DisplayLegacy, "inline-block");
38 assert_parse!(CssAtomSet::ATOMS, DisplayLegacy, "inline-table");
39 assert_parse!(CssAtomSet::ATOMS, DisplayLegacy, "inline-flex");
40 assert_parse!(CssAtomSet::ATOMS, DisplayLegacy, "inline-grid");
41 }
42
43 #[test]
44 fn test_errors() {
45 assert_peek_false!(CssAtomSet::ATOMS, DisplayLegacy, "foo");
46 }
47}