Lines Matching refs:parse

5 use parsing::{parse, parse_entirely};
15 assert_roundtrip_with_context!(Position::parse, "center", "center center"); in test_position()
16 assert_roundtrip_with_context!(Position::parse, "top left", "left top"); in test_position()
17 assert_roundtrip_with_context!(Position::parse, "left top", "left top"); in test_position()
18 assert_roundtrip_with_context!(Position::parse, "top right", "right top"); in test_position()
19 assert_roundtrip_with_context!(Position::parse, "right top", "right top"); in test_position()
20 assert_roundtrip_with_context!(Position::parse, "bottom left", "left bottom"); in test_position()
21 assert_roundtrip_with_context!(Position::parse, "left bottom", "left bottom"); in test_position()
22 assert_roundtrip_with_context!(Position::parse, "left center", "left center"); in test_position()
23 assert_roundtrip_with_context!(Position::parse, "right center", "right center"); in test_position()
24 assert_roundtrip_with_context!(Position::parse, "center top", "center top"); in test_position()
25 assert_roundtrip_with_context!(Position::parse, "center bottom", "center bottom"); in test_position()
26 assert_roundtrip_with_context!(Position::parse, "center 10px", "center 10px"); in test_position()
27 assert_roundtrip_with_context!(Position::parse, "center 10%", "center 10%"); in test_position()
28 assert_roundtrip_with_context!(Position::parse, "right 10%", "right 10%"); in test_position()
31 assert!(parse_entirely(Position::parse, "top 40%").is_err()); in test_position()
32 assert!(parse_entirely(Position::parse, "40% left").is_err()); in test_position()
35 assert_roundtrip_with_context!(Position::parse, "left 10px top 15px", "left 10px top 15px"); in test_position()
36 assert_roundtrip_with_context!(Position::parse, "top 15px left 10px", "left 10px top 15px"); in test_position()
37 assert_roundtrip_with_context!(Position::parse, "left 10% top 15px", "left 10% top 15px"); in test_position()
38 assert_roundtrip_with_context!(Position::parse, "top 15px left 10%", "left 10% top 15px"); in test_position()
39 assert_roundtrip_with_context!(Position::parse, "left top 15px", "left top 15px"); in test_position()
40 assert_roundtrip_with_context!(Position::parse, "top 15px left", "left top 15px"); in test_position()
41 assert_roundtrip_with_context!(Position::parse, "left 10px top", "left 10px top"); in test_position()
42 assert_roundtrip_with_context!(Position::parse, "top left 10px", "left 10px top"); in test_position()
43 assert_roundtrip_with_context!(Position::parse, "right 10px bottom", "right 10px bottom"); in test_position()
44 assert_roundtrip_with_context!(Position::parse, "bottom right 10px", "right 10px bottom"); in test_position()
45 assert_roundtrip_with_context!(Position::parse, "center right 10px", "right 10px center"); in test_position()
46 assert_roundtrip_with_context!(Position::parse, "center bottom 10px", "center bottom 10px"); in test_position()
49 assert!(parse_entirely(Position::parse, "20px 30px 20px").is_err()); in test_position()
50 assert!(parse_entirely(Position::parse, "top 30px 20px").is_err()); in test_position()
51 assert!(parse_entirely(Position::parse, "50% bottom 20%").is_err()); in test_position()
54 assert!(parse_entirely(Position::parse, "center 10px left 15px").is_err()); in test_position()
55 assert!(parse_entirely(Position::parse, "center 10px 15px").is_err()); in test_position()
56 assert!(parse_entirely(Position::parse, "center 10px bottom").is_err()); in test_position()
59 assert!(parse_entirely(Position::parse, "left right").is_err()); in test_position()
60 assert!(parse_entirely(Position::parse, "left 10px right").is_err()); in test_position()
61 assert!(parse_entirely(Position::parse, "left 10px right 15%").is_err()); in test_position()
62 assert!(parse_entirely(Position::parse, "top bottom").is_err()); in test_position()
63 assert!(parse_entirely(Position::parse, "top 10px bottom").is_err()); in test_position()
64 assert!(parse_entirely(Position::parse, "top 10px bottom 15%").is_err()); in test_position()
67 assert!(parse(Position::parse, "x-start").is_err()); in test_position()
68 assert!(parse(Position::parse, "y-end").is_err()); in test_position()
69 assert!(parse(Position::parse, "x-start y-end").is_err()); in test_position()
70 assert!(parse(Position::parse, "x-end 10px").is_err()); in test_position()
71 assert!(parse(Position::parse, "y-start 20px").is_err()); in test_position()
72 assert!(parse(Position::parse, "x-start bottom 10%").is_err()); in test_position()
73 assert!(parse_entirely(Position::parse, "left y-start 10%").is_err()); in test_position()
74 assert!(parse(Position::parse, "x-start 20px y-end 10%").is_err()); in test_position()
80 assert_roundtrip_with_context!(HorizontalPosition::parse, "20px", "20px"); in test_horizontal_position()
81 assert_roundtrip_with_context!(HorizontalPosition::parse, "25%", "25%"); in test_horizontal_position()
82 assert_roundtrip_with_context!(HorizontalPosition::parse, "center", "center"); in test_horizontal_position()
83 assert_roundtrip_with_context!(HorizontalPosition::parse, "left", "left"); in test_horizontal_position()
84 assert_roundtrip_with_context!(HorizontalPosition::parse, "right", "right"); in test_horizontal_position()
87 assert_roundtrip_with_context!(HorizontalPosition::parse, "right 10px", "right 10px"); in test_horizontal_position()
90 assert!(parse(HorizontalPosition::parse, "top").is_err()); in test_horizontal_position()
91 assert!(parse(HorizontalPosition::parse, "bottom").is_err()); in test_horizontal_position()
92 assert!(parse(HorizontalPosition::parse, "y-start").is_err()); in test_horizontal_position()
93 assert!(parse(HorizontalPosition::parse, "y-end").is_err()); in test_horizontal_position()
94 assert!(parse(HorizontalPosition::parse, "y-end 20px ").is_err()); in test_horizontal_position()
95 assert!(parse(HorizontalPosition::parse, "bottom 20px").is_err()); in test_horizontal_position()
96 assert!(parse(HorizontalPosition::parse, "bottom top").is_err()); in test_horizontal_position()
97 assert!(parse_entirely(HorizontalPosition::parse, "20px y-end").is_err()); in test_horizontal_position()
98 assert!(parse_entirely(HorizontalPosition::parse, "20px top").is_err()); in test_horizontal_position()
99 assert!(parse_entirely(HorizontalPosition::parse, "left center").is_err()); in test_horizontal_position()
100 assert!(parse_entirely(HorizontalPosition::parse, "left top").is_err()); in test_horizontal_position()
101 assert!(parse_entirely(HorizontalPosition::parse, "left right").is_err()); in test_horizontal_position()
102 assert!(parse_entirely(HorizontalPosition::parse, "20px 30px").is_err()); in test_horizontal_position()
103 assert!(parse_entirely(HorizontalPosition::parse, "10px left").is_err()); in test_horizontal_position()
104 assert!(parse_entirely(HorizontalPosition::parse, "x-end 20%").is_err()); in test_horizontal_position()
105 assert!(parse_entirely(HorizontalPosition::parse, "20px x-start").is_err()); in test_horizontal_position()
108 assert!(parse(HorizontalPosition::parse, "x-start").is_err()); in test_horizontal_position()
109 assert!(parse(HorizontalPosition::parse, "x-end").is_err()); in test_horizontal_position()
115 assert_roundtrip_with_context!(VerticalPosition::parse, "20px", "20px"); in test_vertical_position()
116 assert_roundtrip_with_context!(VerticalPosition::parse, "25%", "25%"); in test_vertical_position()
117 assert_roundtrip_with_context!(VerticalPosition::parse, "center", "center"); in test_vertical_position()
118 assert_roundtrip_with_context!(VerticalPosition::parse, "top", "top"); in test_vertical_position()
119 assert_roundtrip_with_context!(VerticalPosition::parse, "bottom", "bottom"); in test_vertical_position()
122 assert_roundtrip_with_context!(VerticalPosition::parse, "bottom 10px", "bottom 10px"); in test_vertical_position()
125 assert!(parse(VerticalPosition::parse, "left").is_err()); in test_vertical_position()
126 assert!(parse(VerticalPosition::parse, "right").is_err()); in test_vertical_position()
127 assert!(parse(VerticalPosition::parse, "x-start").is_err()); in test_vertical_position()
128 assert!(parse(VerticalPosition::parse, "x-end").is_err()); in test_vertical_position()
129 assert!(parse(VerticalPosition::parse, "x-end 20px").is_err()); in test_vertical_position()
130 assert!(parse(VerticalPosition::parse, "left 20px").is_err()); in test_vertical_position()
131 assert!(parse(VerticalPosition::parse, "left center").is_err()); in test_vertical_position()
132 assert!(parse(VerticalPosition::parse, "left top").is_err()); in test_vertical_position()
133 assert!(parse(VerticalPosition::parse, "left right").is_err()); in test_vertical_position()
134 assert!(parse_entirely(VerticalPosition::parse, "20px x-end").is_err()); in test_vertical_position()
135 assert!(parse_entirely(VerticalPosition::parse, "20px right").is_err()); in test_vertical_position()
136 assert!(parse_entirely(VerticalPosition::parse, "bottom top").is_err()); in test_vertical_position()
137 assert!(parse_entirely(VerticalPosition::parse, "20px 30px").is_err()); in test_vertical_position()
138 assert!(parse_entirely(VerticalPosition::parse, "10px top").is_err()); in test_vertical_position()
139 assert!(parse_entirely(VerticalPosition::parse, "y-end 20%").is_err()); in test_vertical_position()
140 assert!(parse_entirely(VerticalPosition::parse, "20px y-start").is_err()); in test_vertical_position()
143 assert!(parse(VerticalPosition::parse, "y-start").is_err()); in test_vertical_position()
144 assert!(parse(VerticalPosition::parse, "y-end").is_err()); in test_vertical_position()