Skip to content

Commit 1c4b1be

Browse files
Use expect! in tests
1 parent 3a9e568 commit 1c4b1be

33 files changed

+871
-871
lines changed

tests/test/arrays.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ fn arrays_are_sized() {
1313
[u32; N]: Sized
1414
}
1515
} yields {
16-
"Unique"
16+
expect![["Unique"]]
1717
}
1818

1919
}
@@ -35,7 +35,7 @@ fn arrays_are_copy_if_element_copy() {
3535
[Foo; N]: Copy
3636
}
3737
} yields {
38-
"Unique"
38+
expect![["Unique"]]
3939
}
4040
}
4141
}
@@ -55,7 +55,7 @@ fn arrays_are_not_copy_if_element_not_copy() {
5555
[Foo; N]: Copy
5656
}
5757
} yields {
58-
"No possible solution"
58+
expect![["No possible solution"]]
5959
}
6060
}
6161
}
@@ -76,7 +76,7 @@ fn arrays_are_clone_if_element_clone() {
7676
[Foo; N]: Clone
7777
}
7878
} yields {
79-
"Unique"
79+
expect![["Unique"]]
8080
}
8181
}
8282
}
@@ -96,7 +96,7 @@ fn arrays_are_not_clone_if_element_not_clone() {
9696
[Foo; N]: Clone
9797
}
9898
} yields {
99-
"No possible solution"
99+
expect![["No possible solution"]]
100100
}
101101
}
102102
}
@@ -116,23 +116,23 @@ fn arrays_are_well_formed_if_elem_sized() {
116116
}
117117
}
118118
} yields {
119-
"Unique"
119+
expect![["Unique"]]
120120
}
121121

122122
goal {
123123
forall<const N, T> {
124124
WellFormed([T; N])
125125
}
126126
} yields {
127-
"No possible solution"
127+
expect![["No possible solution"]]
128128
}
129129

130130
goal {
131131
exists<const N, T> {
132132
WellFormed([T; N])
133133
}
134134
} yields {
135-
"Ambiguous; no inference guidance"
135+
expect![["Ambiguous; no inference guidance"]]
136136
}
137137
}
138138
}

tests/test/auto_traits.rs

Lines changed: 40 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ fn auto_semantics() {
2525
List<T>: Send
2626
}
2727
} yields {
28-
"No possible solution"
28+
expect![["No possible solution"]]
2929
}
3030
goal {
3131
forall<T> {
@@ -34,21 +34,21 @@ fn auto_semantics() {
3434
}
3535
}
3636
} yields {
37-
"Unique"
37+
expect![["Unique"]]
3838
}
3939

4040
goal {
4141
List<TypeA>: Send
4242
} yields {
43-
"Unique"
43+
expect![["Unique"]]
4444
}
4545

4646
goal {
4747
exists<T> {
4848
T: Send
4949
}
5050
} yields {
51-
"Ambiguous"
51+
expect![["Ambiguous"]]
5252
}
5353
}
5454
}
@@ -71,7 +71,7 @@ fn auto_trait_without_impls() {
7171
goal {
7272
TypeA: Send
7373
} yields {
74-
"Unique"
74+
expect![["Unique"]]
7575
}
7676

7777
// No fields so `Useless<T>` is `Send`.
@@ -80,7 +80,7 @@ fn auto_trait_without_impls() {
8080
Useless<T>: Send
8181
}
8282
} yields {
83-
"Unique"
83+
expect![["Unique"]]
8484
}
8585

8686
goal {
@@ -90,7 +90,7 @@ fn auto_trait_without_impls() {
9090
}
9191
}
9292
} yields {
93-
"Unique"
93+
expect![["Unique"]]
9494
}
9595
}
9696
}
@@ -112,33 +112,33 @@ fn auto_trait_with_impls() {
112112
goal {
113113
TypeA: Send
114114
} yields {
115-
"No possible solution"
115+
expect![["No possible solution"]]
116116
}
117117

118118
goal {
119119
TypeB: Send
120120
} yields {
121-
"Unique"
121+
expect![["Unique"]]
122122
}
123123

124124
goal {
125125
Vec<TypeA>: Send
126126
} yields {
127-
"No possible solution"
127+
expect![["No possible solution"]]
128128
}
129129

130130
goal {
131131
Vec<TypeB>: Send
132132
} yields {
133-
"Unique"
133+
expect![["Unique"]]
134134
}
135135

136136
goal {
137137
forall<T> {
138138
Vec<T>: Send
139139
}
140140
} yields {
141-
"No possible solution"
141+
expect![["No possible solution"]]
142142
}
143143
}
144144
}
@@ -158,7 +158,7 @@ fn auto_traits_flounder() {
158158
goal {
159159
exists<A> { A: Send }
160160
} yields_first[SolverChoice::slg(3, None)] {
161-
"Floundered"
161+
expect![["Floundered"]]
162162
}
163163
}
164164
}
@@ -201,19 +201,19 @@ fn enum_auto_trait() {
201201
goal {
202202
A: Send
203203
} yields {
204-
"Unique; substitution [], lifetime constraints []"
204+
expect![["Unique; substitution [], lifetime constraints []"]]
205205
}
206206

207207
goal {
208208
B: Send
209209
} yields {
210-
"No possible solution"
210+
expect![["No possible solution"]]
211211
}
212212

213213
goal {
214214
C: Send
215215
} yields {
216-
"No possible solution"
216+
expect![["No possible solution"]]
217217
}
218218
}
219219
}
@@ -239,61 +239,61 @@ fn builtin_auto_trait() {
239239

240240
// The following types only contain AutoTrait-types, and thus implement AutoTrait themselves.
241241
goal { (i32, f32): AutoTrait }
242-
yields { "Unique; substitution [], lifetime constraints []" }
242+
yields { expect![["Unique; substitution [], lifetime constraints []"]] }
243243

244244
goal { [(); 1]: AutoTrait }
245-
yields { "Unique; substitution [], lifetime constraints []" }
245+
yields { expect![["Unique; substitution [], lifetime constraints []"]] }
246246

247247
goal { [()]: AutoTrait }
248-
yields { "Unique; substitution [], lifetime constraints []" }
248+
yields { expect![["Unique; substitution [], lifetime constraints []"]] }
249249

250250
goal { u32: AutoTrait }
251-
yields { "Unique; substitution [], lifetime constraints []" }
251+
yields { expect![["Unique; substitution [], lifetime constraints []"]] }
252252

253253
goal { *const (): AutoTrait }
254-
yields { "Unique; substitution [], lifetime constraints []" }
254+
yields { expect![["Unique; substitution [], lifetime constraints []"]] }
255255

256256
goal { *mut (): AutoTrait }
257-
yields { "Unique; substitution [], lifetime constraints []" }
257+
yields { expect![["Unique; substitution [], lifetime constraints []"]] }
258258

259259
goal { forall<'a> { &'a (): AutoTrait } }
260-
yields { "Unique; substitution [], lifetime constraints []" }
260+
yields { expect![["Unique; substitution [], lifetime constraints []"]] }
261261

262262
goal { forall<'a> { &'a mut (): AutoTrait } }
263-
yields { "Unique; substitution [], lifetime constraints []" }
263+
yields { expect![["Unique; substitution [], lifetime constraints []"]] }
264264

265265
goal { str: AutoTrait }
266-
yields { "Unique; substitution [], lifetime constraints []" }
266+
yields { expect![["Unique; substitution [], lifetime constraints []"]] }
267267

268268
goal { !: AutoTrait }
269-
yields { "Unique; substitution [], lifetime constraints []" }
269+
yields { expect![["Unique; substitution [], lifetime constraints []"]] }
270270

271271
goal { Enum: AutoTrait }
272-
yields { "Unique; substitution [], lifetime constraints []" }
272+
yields { expect![["Unique; substitution [], lifetime constraints []"]] }
273273

274274
goal { func: AutoTrait }
275-
yields { "Unique; substitution [], lifetime constraints []" }
275+
yields { expect![["Unique; substitution [], lifetime constraints []"]] }
276276

277277
goal { good_closure: AutoTrait }
278-
yields { "Unique; substitution [], lifetime constraints []" }
278+
yields { expect![["Unique; substitution [], lifetime constraints []"]] }
279279

280280
goal { fn(Marker) -> Marker: AutoTrait }
281-
yields { "Unique; substitution [], lifetime constraints []" }
281+
yields { expect![["Unique; substitution [], lifetime constraints []"]] }
282282

283283

284284
// foreign types do not implement AutoTraits automatically
285285
goal { Ext: AutoTrait }
286-
yields { "No possible solution" }
286+
yields { expect![["No possible solution"]] }
287287

288288
// The following types do contain non-AutoTrait types, and thus do not implement AutoTrait.
289289
goal { bad_closure: AutoTrait }
290-
yields { "No possible solution" }
290+
yields { expect![["No possible solution"]] }
291291

292292
goal { ExtEnum: AutoTrait }
293-
yields { "No possible solution" }
293+
yields { expect![["No possible solution"]] }
294294

295295
goal { (Struct, Marker): AutoTrait }
296-
yields { "No possible solution" }
296+
yields { expect![["No possible solution"]] }
297297
}
298298
}
299299

@@ -317,35 +317,35 @@ fn adt_auto_trait() {
317317
Yes: AutoTrait
318318
}
319319
yields {
320-
"Unique; substitution [], lifetime constraints []"
320+
expect![["Unique; substitution [], lifetime constraints []"]]
321321
}
322322

323323
goal {
324324
No: AutoTrait
325325
}
326326
yields {
327-
"No possible solution"
327+
expect![["No possible solution"]]
328328
}
329329

330330
goal {
331331
X: AutoTrait
332332
}
333333
yields {
334-
"Unique; substitution [], lifetime constraints []"
334+
expect![["Unique; substitution [], lifetime constraints []"]]
335335
}
336336

337337
goal {
338338
WrapperNo<Yes>: AutoTrait
339339
}
340340
yields {
341-
"No possible solution"
341+
expect![["No possible solution"]]
342342
}
343343

344344
goal {
345345
WrapperYes<No>: AutoTrait
346346
}
347347
yields {
348-
"No possible solution"
348+
expect![["No possible solution"]]
349349
}
350350
}
351351
}
@@ -364,7 +364,7 @@ fn phantom_auto_trait() {
364364
PhantomData<Bad>: AutoTrait
365365
}
366366
yields {
367-
"No possible solution"
367+
expect![["No possible solution"]]
368368
}
369369
}
370370
}

0 commit comments

Comments
 (0)