From e008fff340574ad675070f5a56b586575a003aed Mon Sep 17 00:00:00 2001 From: Nicholas Shahan Date: Thu, 29 May 2025 15:44:05 -0700 Subject: [PATCH 1/2] 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. --- webdev/test/e2e_test.dart | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/webdev/test/e2e_test.dart b/webdev/test/e2e_test.dart index fe7100efe..102d3f3ff 100644 --- a/webdev/test/e2e_test.dart +++ b/webdev/test/e2e_test.dart @@ -382,15 +382,15 @@ void main() { 'valueAsString', 'Hello World!!')); - result = - await vmService.evaluate(isolateId, libraryId, 'main.toString()'); + result = await vmService.evaluate( + isolateId, libraryId, 'topLevelMethod()'); expect( result, const TypeMatcher().having( (instance) => instance.valueAsString, 'valueAsString', - contains('Closure: () => void'))); + equals('verify this!'))); } finally { await vmService?.dispose(); await exitWebdev(process); @@ -555,7 +555,7 @@ void main() { expect( () => - vmService!.evaluate(isolateId, libraryId, 'main.toString()'), + vmService!.evaluate(isolateId, libraryId, 'topLevelMethod()'), throwsRPCError); } finally { await vmService?.dispose(); From 5915e5f875e6514e6e6f153c6b9dd693eb51b48a Mon Sep 17 00:00:00 2001 From: Nicholas Shahan Date: Thu, 29 May 2025 15:55:28 -0700 Subject: [PATCH 2/2] oops forgot to include the updated test fixture --- fixtures/_webdevSoundSmoke/web/main.dart | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fixtures/_webdevSoundSmoke/web/main.dart b/fixtures/_webdevSoundSmoke/web/main.dart index a8be53f93..8e3be2873 100644 --- a/fixtures/_webdevSoundSmoke/web/main.dart +++ b/fixtures/_webdevSoundSmoke/web/main.dart @@ -23,3 +23,5 @@ void main() { print('Counter is: ${++count}'); // Breakpoint: printCounter }); } + +String topLevelMethod() => 'verify this!';