@@ -107,14 +107,14 @@ TEST_F(Test_Parse_Expression_JSX, self_closing_tag) {
107
107
Test_Parser p (u8" <div />" _sv, jsx_options);
108
108
Expression* ast = p.parse_expression ();
109
109
EXPECT_EQ (ast->kind (), Expression_Kind::JSX_Element);
110
- EXPECT_THAT (ast->span (), p. matches_offsets ( 0 , u8" <div />" _sv) );
110
+ p. assert_offsets (ast->span (), 0 , u8" <div />" _sv);
111
111
}
112
112
113
113
{
114
114
Test_Parser p (u8" <my-web-component/ >" _sv, jsx_options);
115
115
Expression* ast = p.parse_expression ();
116
116
EXPECT_EQ (ast->kind (), Expression_Kind::JSX_Element);
117
- EXPECT_THAT (ast->span (), p. matches_offsets ( 0 , u8" <my-web-component/ >" _sv) );
117
+ p. assert_offsets (ast->span (), 0 , u8" <my-web-component/ >" _sv);
118
118
}
119
119
}
120
120
@@ -123,16 +123,15 @@ TEST_F(Test_Parse_Expression_JSX, tag_with_no_children) {
123
123
Test_Parser p (u8" <div></div>" _sv, jsx_options);
124
124
Expression* ast = p.parse_expression ();
125
125
EXPECT_EQ (ast->kind (), Expression_Kind::JSX_Element);
126
- EXPECT_THAT (ast->span (), p. matches_offsets ( 0 , u8" <div></div>" _sv) );
126
+ p. assert_offsets (ast->span (), 0 , u8" <div></div>" _sv);
127
127
}
128
128
129
129
{
130
130
Test_Parser p (u8" <my-web-component>< / my-web-component>" _sv, jsx_options);
131
131
Expression* ast = p.parse_expression ();
132
132
EXPECT_EQ (ast->kind (), Expression_Kind::JSX_Element);
133
- EXPECT_THAT (
134
- ast->span (),
135
- p.matches_offsets (0 , u8" <my-web-component>< / my-web-component>" _sv));
133
+ p.assert_offsets (ast->span (), 0 ,
134
+ u8" <my-web-component>< / my-web-component>" _sv);
136
135
}
137
136
}
138
137
@@ -141,8 +140,7 @@ TEST_F(Test_Parse_Expression_JSX, tag_with_text_children) {
141
140
Test_Parser p (u8" <div>hello world</div>" _sv, jsx_options);
142
141
Expression* ast = p.parse_expression ();
143
142
EXPECT_EQ (summarize (ast), " jsxelement(div)" );
144
- EXPECT_THAT (ast->span (),
145
- p.matches_offsets (0 , u8" <div>hello world</div>" _sv));
143
+ p.assert_offsets (ast->span (), 0 , u8" <div>hello world</div>" _sv);
146
144
}
147
145
}
148
146
@@ -151,7 +149,7 @@ TEST_F(Test_Parse_Expression_JSX, fragment_with_no_children) {
151
149
Test_Parser p (u8" <></>" _sv, jsx_options);
152
150
Expression* ast = p.parse_expression ();
153
151
EXPECT_EQ (ast->kind (), Expression_Kind::JSX_Fragment);
154
- EXPECT_THAT (ast->span (), p. matches_offsets ( 0 , u8" <></>" _sv) );
152
+ p. assert_offsets (ast->span (), 0 , u8" <></>" _sv);
155
153
}
156
154
}
157
155
@@ -160,7 +158,7 @@ TEST_F(Test_Parse_Expression_JSX, fragment_with_text_children) {
160
158
Test_Parser p (u8" <>hello world</>" _sv, jsx_options);
161
159
Expression* ast = p.parse_expression ();
162
160
EXPECT_EQ (summarize (ast), " jsxfragment()" );
163
- EXPECT_THAT (ast->span (), p. matches_offsets ( 0 , u8" <>hello world</>" _sv) );
161
+ p. assert_offsets (ast->span (), 0 , u8" <>hello world</>" _sv);
164
162
}
165
163
}
166
164
@@ -169,12 +167,10 @@ TEST_F(Test_Parse_Expression_JSX, tag_with_element_children) {
169
167
Test_Parser p (u8" <div>hello <span>world</span>!</div>" _sv, jsx_options);
170
168
Expression* ast = p.parse_expression ();
171
169
ASSERT_EQ (summarize (ast), " jsxelement(div, jsxelement(span))" );
172
- EXPECT_THAT (ast->span (),
173
- p.matches_offsets (u8" " _sv.size (),
174
- u8" <div>hello <span>world</span>!</div>" _sv));
175
- EXPECT_THAT (ast->child_0 ()->span (),
176
- p.matches_offsets (u8" <div>hello " _sv.size (),
177
- u8" <span>world</span>" _sv));
170
+ p.assert_offsets (ast->span (), u8" " _sv.size (),
171
+ u8" <div>hello <span>world</span>!</div>" _sv);
172
+ p.assert_offsets (ast->child_0 ()->span (), u8" <div>hello " _sv.size (),
173
+ u8" <span>world</span>" _sv);
178
174
}
179
175
}
180
176
@@ -183,12 +179,10 @@ TEST_F(Test_Parse_Expression_JSX, tag_with_fragment_children) {
183
179
Test_Parser p (u8" <div>hello <>world</>!</div>" _sv, jsx_options);
184
180
Expression* ast = p.parse_expression ();
185
181
ASSERT_EQ (summarize (ast), " jsxelement(div, jsxfragment())" );
186
- EXPECT_THAT (
187
- ast->span (),
188
- p.matches_offsets (u8" " _sv.size (), u8" <div>hello <>world</>!</div>" _sv));
189
- EXPECT_THAT (
190
- ast->child_0 ()->span (),
191
- p.matches_offsets (u8" <div>hello " _sv.size (), u8" <>world</>" _sv));
182
+ p.assert_offsets (ast->span (), u8" " _sv.size (),
183
+ u8" <div>hello <>world</>!</div>" _sv);
184
+ p.assert_offsets (ast->child_0 ()->span (), u8" <div>hello " _sv.size (),
185
+ u8" <>world</>" _sv);
192
186
}
193
187
}
194
188
@@ -197,12 +191,10 @@ TEST_F(Test_Parse_Expression_JSX, fragment_with_element_children) {
197
191
Test_Parser p (u8" <>hello <span>world</span>!</>" _sv, jsx_options);
198
192
Expression* ast = p.parse_expression ();
199
193
ASSERT_EQ (summarize (ast), " jsxfragment(jsxelement(span))" );
200
- EXPECT_THAT (ast->span (),
201
- p.matches_offsets (u8" " _sv.size (),
202
- u8" <>hello <span>world</span>!</>" _sv));
203
- EXPECT_THAT (
204
- ast->child_0 ()->span (),
205
- p.matches_offsets (u8" <>hello " _sv.size (), u8" <span>world</span>" _sv));
194
+ p.assert_offsets (ast->span (), u8" " _sv.size (),
195
+ u8" <>hello <span>world</span>!</>" _sv);
196
+ p.assert_offsets (ast->child_0 ()->span (), u8" <>hello " _sv.size (),
197
+ u8" <span>world</span>" _sv);
206
198
}
207
199
208
200
{
@@ -228,10 +220,10 @@ TEST_F(Test_Parse_Expression_JSX, fragment_with_fragment_children) {
228
220
Test_Parser p (u8" <>hello <>world</>!</>" _sv, jsx_options);
229
221
Expression* ast = p.parse_expression ();
230
222
ASSERT_EQ (summarize (ast), " jsxfragment(jsxfragment())" );
231
- EXPECT_THAT (ast->span (), p. matches_offsets ( u8" " _sv.size (),
232
- u8" <>hello <>world</>!</>" _sv) );
233
- EXPECT_THAT (ast->child_0 ()->span (),
234
- p. matches_offsets ( u8" <>hello " _sv. size (), u8" <>world</>" _sv) );
223
+ p. assert_offsets (ast->span (), u8" " _sv.size (),
224
+ u8" <>hello <>world</>!</>" _sv);
225
+ p. assert_offsets (ast->child_0 ()->span (), u8" <>hello " _sv. size (),
226
+ u8" <>world</>" _sv);
235
227
}
236
228
}
237
229
@@ -240,8 +232,8 @@ TEST_F(Test_Parse_Expression_JSX, tag_with_expression_children) {
240
232
Test_Parser p (u8" <div>hello {name}!</div>" _sv, jsx_options);
241
233
Expression* ast = p.parse_expression ();
242
234
ASSERT_EQ (summarize (ast), " jsxelement(div, var name)" );
243
- EXPECT_THAT (ast->child_0 ()->span (),
244
- p. matches_offsets ( u8" <div>hello { " _sv. size (), u8" name" _sv) );
235
+ p. assert_offsets (ast->child_0 ()->span (), u8" <div>hello { " _sv. size (),
236
+ u8" name" _sv);
245
237
}
246
238
247
239
{
@@ -262,16 +254,15 @@ TEST_F(Test_Parse_Expression_JSX, tag_with_attributes) {
262
254
Test_Parser p (u8" <div className='header' />" _sv, jsx_options);
263
255
Expression* ast = p.parse_expression ();
264
256
ASSERT_EQ (summarize (ast), " jsxelement(div)" );
265
- EXPECT_THAT (ast->span (),
266
- p.matches_offsets (0 , u8" <div className='header' />" _sv));
257
+ p.assert_offsets (ast->span (), 0 , u8" <div className='header' />" _sv);
267
258
}
268
259
269
260
{
270
261
Test_Parser p (u8" <div className={expr} />" _sv, jsx_options);
271
262
Expression* ast = p.parse_expression ();
272
263
ASSERT_EQ (summarize (ast), " jsxelement(div, var expr)" );
273
- EXPECT_THAT (ast->child_0 ()->span (),
274
- p. matches_offsets ( u8" <div className={ " _sv. size (), u8" expr" _sv) );
264
+ p. assert_offsets (ast->child_0 ()->span (), u8" <div className={ " _sv. size (),
265
+ u8" expr" _sv);
275
266
}
276
267
277
268
{
0 commit comments