Skip to content

Commit

Permalink
Bless updated tests
Browse files Browse the repository at this point in the history
We no longer rely on suffix matching,
  • Loading branch information
ecstatic-morse committed Dec 22, 2021
1 parent edca2ac commit 529fea5
Show file tree
Hide file tree
Showing 28 changed files with 366 additions and 463 deletions.
8 changes: 4 additions & 4 deletions tests/test/arrays.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ fn arrays_are_sized() {
[u32; N]: Sized
}
} yields {
expect![["Unique"]]
expect![[r#"Unique; substitution [], lifetime constraints []"#]]
}

}
Expand All @@ -35,7 +35,7 @@ fn arrays_are_copy_if_element_copy() {
[Foo; N]: Copy
}
} yields {
expect![["Unique"]]
expect![[r#"Unique; substitution [], lifetime constraints []"#]]
}
}
}
Expand Down Expand Up @@ -76,7 +76,7 @@ fn arrays_are_clone_if_element_clone() {
[Foo; N]: Clone
}
} yields {
expect![["Unique"]]
expect![[r#"Unique; substitution [], lifetime constraints []"#]]
}
}
}
Expand Down Expand Up @@ -116,7 +116,7 @@ fn arrays_are_well_formed_if_elem_sized() {
}
}
} yields {
expect![["Unique"]]
expect![[r#"Unique; substitution [], lifetime constraints []"#]]
}

goal {
Expand Down
16 changes: 8 additions & 8 deletions tests/test/auto_traits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,21 +34,21 @@ fn auto_semantics() {
}
}
} yields {
expect![["Unique"]]
expect![[r#"Unique; substitution [], lifetime constraints []"#]]
}

goal {
List<TypeA>: Send
} yields {
expect![["Unique"]]
expect![[r#"Unique; substitution [], lifetime constraints []"#]]
}

goal {
exists<T> {
T: Send
}
} yields {
expect![["Ambiguous"]]
expect![[r#"Ambiguous; no inference guidance"#]]
}
}
}
Expand All @@ -71,7 +71,7 @@ fn auto_trait_without_impls() {
goal {
TypeA: Send
} yields {
expect![["Unique"]]
expect![[r#"Unique; substitution [], lifetime constraints []"#]]
}

// No fields so `Useless<T>` is `Send`.
Expand All @@ -80,7 +80,7 @@ fn auto_trait_without_impls() {
Useless<T>: Send
}
} yields {
expect![["Unique"]]
expect![[r#"Unique; substitution [], lifetime constraints []"#]]
}

goal {
Expand All @@ -90,7 +90,7 @@ fn auto_trait_without_impls() {
}
}
} yields {
expect![["Unique"]]
expect![[r#"Unique; substitution [], lifetime constraints []"#]]
}
}
}
Expand Down Expand Up @@ -118,7 +118,7 @@ fn auto_trait_with_impls() {
goal {
TypeB: Send
} yields {
expect![["Unique"]]
expect![[r#"Unique; substitution [], lifetime constraints []"#]]
}

goal {
Expand All @@ -130,7 +130,7 @@ fn auto_trait_with_impls() {
goal {
Vec<TypeB>: Send
} yields {
expect![["Unique"]]
expect![[r#"Unique; substitution [], lifetime constraints []"#]]
}

goal {
Expand Down
52 changes: 26 additions & 26 deletions tests/test/closures.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,17 @@ fn closure_is_well_formed() {
goal {
WellFormed(foo)
} yields {
expect![["Unique"]]
expect![[r#"Unique; substitution [], lifetime constraints []"#]]
}
goal {
WellFormed(bar)
} yields {
expect![["Unique"]]
expect![[r#"Unique; substitution [], lifetime constraints []"#]]
}
goal {
WellFormed(baz)
} yields {
expect![["Unique"]]
expect![[r#"Unique; substitution [], lifetime constraints []"#]]
}
}
}
Expand All @@ -40,7 +40,7 @@ fn closure_is_sized() {
goal {
foo: Sized
} yields {
expect![["Unique"]]
expect![[r#"Unique; substitution [], lifetime constraints []"#]]
}
}
}
Expand Down Expand Up @@ -76,17 +76,17 @@ fn closure_is_copy() {
goal {
foo: Copy
} yields {
expect![["Unique"]]
expect![[r#"Unique; substitution [], lifetime constraints []"#]]
}
goal {
bar: Copy
} yields {
expect![["Unique"]]
expect![[r#"Unique; substitution [], lifetime constraints []"#]]
}
goal {
baz: Copy
} yields {
expect![["Unique"]]
expect![[r#"Unique; substitution [], lifetime constraints []"#]]
}

// A closure with non-Copy upvars is not copy
Expand All @@ -103,7 +103,7 @@ fn closure_is_copy() {
foobar<'a>: Copy
}
} yields {
expect![["Unique"]]
expect![[r#"Unique; substitution [], lifetime constraints []"#]]
}
goal {
forall<T> { with_ty<T>: Copy }
Expand All @@ -113,7 +113,7 @@ fn closure_is_copy() {
goal {
forall<T> { if (T: Copy) { with_ty<T>: Copy } }
} yields {
expect![["Unique"]]
expect![[r#"Unique; substitution [], lifetime constraints []"#]]
}
}
}
Expand All @@ -132,17 +132,17 @@ fn closure_is_clone() {
goal {
foo: Clone
} yields {
expect![["Unique"]]
expect![[r#"Unique; substitution [], lifetime constraints []"#]]
}
goal {
bar: Clone
} yields {
expect![["Unique"]]
expect![[r#"Unique; substitution [], lifetime constraints []"#]]
}
goal {
baz: Clone
} yields {
expect![["Unique"]]
expect![[r#"Unique; substitution [], lifetime constraints []"#]]
}
}
}
Expand Down Expand Up @@ -191,34 +191,34 @@ fn closure_implements_fn_traits() {
goal {
foo: FnOnce<()>
} yields {
expect![["Unique"]]
expect![[r#"Unique; substitution [], lifetime constraints []"#]]
}
goal {
Normalize(<foo as FnOnce<()>>::Output -> ())
} yields {
expect![["Unique"]]
expect![[r#"Unique; substitution [], lifetime constraints []"#]]
}

// A closure with kind `Fn` implements all `Fn` traits
goal {
bar: Fn<()>
} yields {
expect![["Unique"]]
expect![[r#"Unique; substitution [], lifetime constraints []"#]]
}
goal {
bar: FnMut<()>
} yields {
expect![["Unique"]]
expect![[r#"Unique; substitution [], lifetime constraints []"#]]
}
goal {
bar: FnOnce<()>
} yields {
expect![["Unique"]]
expect![[r#"Unique; substitution [], lifetime constraints []"#]]
}
goal {
Normalize(<bar as FnOnce<()>>::Output -> ())
} yields {
expect![["Unique"]]
expect![[r#"Unique; substitution [], lifetime constraints []"#]]
}

// A closure with kind `FnMut` implements `FnMut` and `FnOnce`
Expand All @@ -230,53 +230,53 @@ fn closure_implements_fn_traits() {
goal {
baz: FnMut<()>
} yields {
expect![["Unique"]]
expect![[r#"Unique; substitution [], lifetime constraints []"#]]
}
goal {
baz: FnOnce<()>
} yields {
expect![["Unique"]]
expect![[r#"Unique; substitution [], lifetime constraints []"#]]
}
goal {
Normalize(<baz as FnOnce<()>>::Output -> ())
} yields {
expect![["Unique"]]
expect![[r#"Unique; substitution [], lifetime constraints []"#]]
}
// A closure also implements the `Fn` traits regardless of upvars
goal {
forall<'a> {
foobar<'a>: FnOnce<(u8, f32)>
}
} yields {
expect![["Unique"]]
expect![[r#"Unique; substitution [], lifetime constraints []"#]]
}
goal {
forall<'a> {
Normalize(<foobar<'a> as FnOnce<(u8, f32)>>::Output -> u32)
}
} yields {
expect![["Unique"]]
expect![[r#"Unique; substitution [], lifetime constraints []"#]]
}
goal {
forall<'a> {
Normalize(<foobar<'a> as FnOnce<(u8, f32)>>::Output -> u32)
}
} yields {
expect![["Unique"]]
expect![[r#"Unique; substitution [], lifetime constraints []"#]]
}
goal {
forall<'a> {
foobuzz<'a>: FnOnce<(u8, f32)>
}
} yields {
expect![["Unique"]]
expect![[r#"Unique; substitution [], lifetime constraints []"#]]
}
goal {
forall<'a> {
Normalize(<foobuzz<'a> as FnOnce<(u8, f32)>>::Output -> u32)
}
} yields {
expect![["Unique"]]
expect![[r#"Unique; substitution [], lifetime constraints []"#]]
}
}
}
Loading

0 comments on commit 529fea5

Please sign in to comment.