Skip to content

Commit 24156d0

Browse files
pqCommit Queue
authored and
Commit Queue
committed
[wildcards] code folding tests
Fixes: #56009 Change-Id: Iad1f197388d0b89e9bd9b31cc82a496cf578380b Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/371663 Auto-Submit: Phil Quitslund <[email protected]> Commit-Queue: Brian Wilkerson <[email protected]> Reviewed-by: Brian Wilkerson <[email protected]>
1 parent fa89a01 commit 24156d0

File tree

1 file changed

+43
-0
lines changed

1 file changed

+43
-0
lines changed

pkg/analysis_server/test/src/computer/folding_computer_test.dart

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -519,6 +519,49 @@ main2/*[1*/() {
519519
});
520520
}
521521

522+
Future<void> test_function_expression_underscore_preWildcards() async {
523+
var content = '''
524+
// /*[0*/
525+
// @dart = 3.4
526+
// (pre wildcard-variables)/*0]*/
527+
528+
// Content before
529+
530+
void f/*[1*/() {
531+
_/*[2*/(){
532+
}/*2]*/
533+
}/*1]*/
534+
535+
// Content after
536+
''';
537+
538+
await _computeRegions(content);
539+
expectRegions({
540+
0: FoldingKind.FILE_HEADER,
541+
1: FoldingKind.FUNCTION_BODY,
542+
2: FoldingKind.FUNCTION_BODY,
543+
});
544+
}
545+
546+
Future<void> test_function_expression_wildcard() async {
547+
var content = '''
548+
// Content before
549+
550+
void f/*[0*/() {
551+
_/*[1*/(){
552+
}/*1]*/
553+
}/*0]*/
554+
555+
// Content after
556+
''';
557+
558+
await _computeRegions(content);
559+
expectRegions({
560+
0: FoldingKind.FUNCTION_BODY,
561+
1: FoldingKind.FUNCTION_BODY,
562+
});
563+
}
564+
522565
Future<void> test_function_with_dart_doc() async {
523566
var content = '''
524567
// Content before

0 commit comments

Comments
 (0)