Skip to content

Commit 80b1686

Browse files
authored
Fix e2e_test to work with current DDC output (#2626)
Fix e2e_test to work with current DDC output Add a top level method and expect the result of calling that method in an expression evaluation. The existing test for expression evaluation in the context of a library relied on the output of the `.toString()` of a top level method tearoff. This representation changed recently causing the test to fail.
1 parent 64492b2 commit 80b1686

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

fixtures/_webdevSoundSmoke/web/main.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,5 @@ void main() {
2323
print('Counter is: ${++count}'); // Breakpoint: printCounter
2424
});
2525
}
26+
27+
String topLevelMethod() => 'verify this!';

webdev/test/e2e_test.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -382,15 +382,15 @@ void main() {
382382
'valueAsString',
383383
'Hello World!!'));
384384

385-
result =
386-
await vmService.evaluate(isolateId, libraryId, 'main.toString()');
385+
result = await vmService.evaluate(
386+
isolateId, libraryId, 'topLevelMethod()');
387387

388388
expect(
389389
result,
390390
const TypeMatcher<InstanceRef>().having(
391391
(instance) => instance.valueAsString,
392392
'valueAsString',
393-
contains('Closure: () => void')));
393+
equals('verify this!')));
394394
} finally {
395395
await vmService?.dispose();
396396
await exitWebdev(process);
@@ -555,7 +555,7 @@ void main() {
555555

556556
expect(
557557
() =>
558-
vmService!.evaluate(isolateId, libraryId, 'main.toString()'),
558+
vmService!.evaluate(isolateId, libraryId, 'topLevelMethod()'),
559559
throwsRPCError);
560560
} finally {
561561
await vmService?.dispose();

0 commit comments

Comments
 (0)