Skip to content

Commit 1b58bb0

Browse files
committed
Expand test with multiple sections
1 parent 9271c48 commit 1b58bb0

File tree

2 files changed

+71
-5
lines changed

2 files changed

+71
-5
lines changed

crates/ark/src/lsp/snapshots/ark__lsp__symbols__tests__symbol_call_test_that.snap

Lines changed: 66 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
source: crates/ark/src/lsp/symbols.rs
3-
expression: "test_symbol(\"\ntest_that_not('foo', {\n 1\n})\n\n# title ----\n\ntest_that('foo', {\n # title1 ----\n 1\n # title2 ----\n foo <- function() {\n 2\n }\n})\n\")"
3+
expression: "test_symbol(\"\ntest_that_not('foo', {\n 1\n})\n\n# title ----\n\ntest_that('foo', {\n # title1 ----\n 1\n # title2 ----\n foo <- function() {\n 2\n }\n})\n\n# title2 ----\ntest_that('bar', {\n 1\n})\n\")"
44
---
55
[
66
DocumentSymbol {
@@ -15,8 +15,8 @@ expression: "test_symbol(\"\ntest_that_not('foo', {\n 1\n})\n\n# title ----\n\n
1515
character: 0,
1616
},
1717
end: Position {
18-
line: 14,
19-
character: 2,
18+
line: 15,
19+
character: 0,
2020
},
2121
},
2222
selection_range: Range {
@@ -25,8 +25,8 @@ expression: "test_symbol(\"\ntest_that_not('foo', {\n 1\n})\n\n# title ----\n\n
2525
character: 0,
2626
},
2727
end: Position {
28-
line: 14,
29-
character: 2,
28+
line: 15,
29+
character: 0,
3030
},
3131
},
3232
children: Some(
@@ -158,4 +158,65 @@ expression: "test_symbol(\"\ntest_that_not('foo', {\n 1\n})\n\n# title ----\n\n
158158
],
159159
),
160160
},
161+
DocumentSymbol {
162+
name: "title2",
163+
detail: None,
164+
kind: String,
165+
tags: None,
166+
deprecated: None,
167+
range: Range {
168+
start: Position {
169+
line: 16,
170+
character: 0,
171+
},
172+
end: Position {
173+
line: 19,
174+
character: 2,
175+
},
176+
},
177+
selection_range: Range {
178+
start: Position {
179+
line: 16,
180+
character: 0,
181+
},
182+
end: Position {
183+
line: 19,
184+
character: 2,
185+
},
186+
},
187+
children: Some(
188+
[
189+
DocumentSymbol {
190+
name: "Test: bar",
191+
detail: None,
192+
kind: Function,
193+
tags: None,
194+
deprecated: None,
195+
range: Range {
196+
start: Position {
197+
line: 17,
198+
character: 0,
199+
},
200+
end: Position {
201+
line: 19,
202+
character: 2,
203+
},
204+
},
205+
selection_range: Range {
206+
start: Position {
207+
line: 17,
208+
character: 0,
209+
},
210+
end: Position {
211+
line: 19,
212+
character: 2,
213+
},
214+
},
215+
children: Some(
216+
[],
217+
),
218+
},
219+
],
220+
),
221+
},
161222
]

crates/ark/src/lsp/symbols.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -676,6 +676,11 @@ test_that('foo', {
676676
2
677677
}
678678
})
679+
680+
# title2 ----
681+
test_that('bar', {
682+
1
683+
})
679684
"
680685
));
681686
}

0 commit comments

Comments
 (0)