2
2
// for details. All rights reserved. Use of this source code is governed by a
3
3
// BSD-style license that can be found in the LICENSE file.
4
4
5
- import 'package:dwds/src/services/expression_compiler.dart' show ModuleFormat;
6
5
import 'package:path/path.dart' show basename;
7
6
import 'package:test/test.dart' ;
8
7
import 'package:test_common/logging.dart' ;
@@ -20,7 +19,7 @@ void runTests({
20
19
required bool canaryFeatures,
21
20
required bool debug,
22
21
}) {
23
- final context = TestContext (TestProject .testExperiment , provider);
22
+ final context = TestContext (TestProject .testDotShorthands , provider);
24
23
final testInspector = TestInspector (context);
25
24
26
25
late VmService service;
@@ -73,8 +72,8 @@ void runTests({
73
72
await context.tearDown ();
74
73
});
75
74
76
- test ('expression evaluation and single-stepping ' , () async {
77
- await onBreakpoint ('testDotShorthands' , (event) async {
75
+ test ('expression evaluation' , () async {
76
+ final bp = onBreakpoint ('testDotShorthands' , (event) async {
78
77
final frame = event.topFrame! .index! ;
79
78
80
79
var instanceRef = await getInstanceRef (frame, '(c = .two).value' );
@@ -86,22 +85,36 @@ void runTests({
86
85
instanceRef = await getInstanceRef (frame, '(c = .four()).value' );
87
86
expect (instanceRef.valueAsString, '4' );
88
87
88
+ await service.resume (isolateId);
89
+ });
90
+ final isolate = await service.getIsolate (isolateId);
91
+ await service.evaluate (
92
+ isolateId,
93
+ isolate.rootLib! .id! ,
94
+ 'testDotShorthands()' ,
95
+ );
96
+ await bp;
97
+ });
98
+
99
+ test ('single-stepping' , () async {
100
+ final bp = onBreakpoint ('testDotShorthands' , (event) async {
89
101
final scriptBasename = basename (mainScript.uri! );
90
102
91
- const lineA = 116 ;
92
- const lineB = 118 ;
93
- const lineC = 119 ;
94
- const lineD = 120 ;
95
- const lineE = 127 ;
96
- const lineF = 129 ;
97
- const lineG = 131 ;
98
- const lineH = 132 ;
103
+ const lineA = 11 ;
104
+ const lineB = 13 ;
105
+ const lineC = 14 ;
106
+ const lineD = 15 ;
107
+ const lineE = 22 ;
108
+ const lineF = 24 ;
109
+ const lineG = 26 ;
110
+ const lineH = 27 ;
99
111
100
112
final expected = [
101
113
'$scriptBasename :$lineE :3' , // on 'c'
102
- // TODO(2638): Investigate why this conditional exclusion is needed.
103
- if (provider.ddcModuleFormat == ModuleFormat .ddc)
104
- '$scriptBasename :$lineB :20' , // on '2'
114
+ '$scriptBasename :$lineB :15' , // on 'C'
115
+ '$scriptBasename :$lineA :10' , // on 'v' of 'value'
116
+ '$scriptBasename :$lineA :16' , // on ';'
117
+ '$scriptBasename :$lineB :20' , // on '2'
105
118
'$scriptBasename :$lineF :3' , // on 'c'
106
119
'$scriptBasename :$lineC :25' , // on 'C'
107
120
'$scriptBasename :$lineA :10' , // on 'v' of 'value'
@@ -119,11 +132,20 @@ void runTests({
119
132
await testInspector.runStepIntoThroughProgramRecordingStops (
120
133
isolateId,
121
134
stops,
122
- provider.ddcModuleFormat == ModuleFormat .ddc ? 13 : 12 ,
135
+ expected.length ,
123
136
);
124
137
125
138
expect (stops, expected);
139
+
140
+ await service.resume (isolateId);
126
141
});
142
+ final isolate = await service.getIsolate (isolateId);
143
+ await service.evaluate (
144
+ isolateId,
145
+ isolate.rootLib! .id! ,
146
+ 'testDotShorthands()' ,
147
+ );
148
+ await bp;
127
149
});
128
150
});
129
151
}
0 commit comments