Skip to content

Commit a155c43

Browse files
committed
factor our MIRROR program, fix comments
This will allow more tests later, was the idea.
1 parent 6804280 commit a155c43

File tree

1 file changed

+13
-14
lines changed

1 file changed

+13
-14
lines changed

tests/associated_type_normalization.rs

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,19 @@
11
use formality::test_where_clause;
22

3+
const MIRROR: &str = "[
4+
crate core {
5+
trait Mirror<> where [] {
6+
type Assoc<> : [] where [];
7+
}
8+
9+
impl<ty T> Mirror<> for T where [] {
10+
type Assoc<> = T where [];
11+
}
12+
}
13+
]";
14+
315
#[test]
416
fn test_mirror_normalizes_u32_to_u32() {
5-
// Variant of test_foo_crate_cannot_assume_CoreStruct_does_not_impl_CoreTrait
6-
// where there is a negative impl, so it is accepted.
7-
817
expect_test::expect![[r#"
918
Ok(
1019
{
@@ -36,17 +45,7 @@ fn test_mirror_normalizes_u32_to_u32() {
3645
)
3746
"#]]
3847
.assert_debug_eq(&test_where_clause(
39-
"[
40-
crate core {
41-
trait Mirror<> where [] {
42-
type Assoc<> : [] where [];
43-
}
44-
45-
impl<ty T> Mirror<> for T where [] {
46-
type Assoc<> = T where [];
47-
}
48-
}
49-
]",
48+
MIRROR,
5049
"exists<ty T> {} => {<u32 as Mirror>::Assoc<> = T}",
5150
));
5251
}

0 commit comments

Comments
 (0)