Skip to content

Commit 36f6f02

Browse files
committed
Add coverage for infix and derive
1 parent 6731a9f commit 36f6f02

File tree

4 files changed

+63
-1
lines changed

4 files changed

+63
-1
lines changed

crates/indexing/tests/indexing.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,9 @@ fn duplicate_expr_item() {
9090
"ord = ordImpl",
9191
"data Data = Id Int",
9292
"newtype Newtype = Id Int",
93+
"infix 5 eq as ==",
94+
"infix 5 eq as ==",
95+
"derive instance eq :: Eq a",
9396
]);
9497
insta::assert_debug_snapshot!(errors);
9598
}
@@ -106,7 +109,9 @@ fn duplicate_type_item() {
106109
"data Newtype = Constructor3",
107110
"data Newtype :: Type",
108111
"data Id = Constructor4",
109-
"data Id = Constructor5"
112+
"data Id = Constructor5",
113+
"infix 5 type Eq as ==",
114+
"infix 5 type Eq as ==",
110115
]);
111116
insta::assert_debug_snapshot!(errors);
112117
}

crates/indexing/tests/snapshots/indexing__duplicate_expr_item.snap

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,4 +64,24 @@ snapshot_kind: text
6464
),
6565
),
6666
},
67+
DuplicateExprItem {
68+
item_id: Id(
69+
3,
70+
),
71+
duplicate: Declaration(
72+
Id(
73+
10,
74+
),
75+
),
76+
},
77+
DuplicateExprItem {
78+
item_id: Id(
79+
0,
80+
),
81+
duplicate: Declaration(
82+
Id(
83+
11,
84+
),
85+
),
86+
},
6787
]

crates/indexing/tests/snapshots/indexing__duplicate_type_item.snap

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,4 +72,14 @@ snapshot_kind: text
7272
9,
7373
),
7474
},
75+
DuplicateTypeItem {
76+
item_id: Id(
77+
3,
78+
),
79+
duplicate: Declaration(
80+
Id(
81+
11,
82+
),
83+
),
84+
},
7585
]
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
---
2+
source: crates/indexing/tests/indexing.rs
3+
expression: errors
4+
snapshot_kind: text
5+
---
6+
[
7+
DuplicateExprItem {
8+
item_id: Id(
9+
0,
10+
),
11+
duplicate: Declaration(
12+
Id(
13+
2,
14+
),
15+
),
16+
},
17+
DuplicateTypeItem {
18+
item_id: Id(
19+
0,
20+
),
21+
duplicate: Declaration(
22+
Id(
23+
3,
24+
),
25+
),
26+
},
27+
]

0 commit comments

Comments
 (0)