diff --git a/dwds/test/instances/common/patterns_inspection_common.dart b/dwds/test/instances/common/patterns_inspection_common.dart index 935ab91d8..5b1d68d6c 100644 --- a/dwds/test/instances/common/patterns_inspection_common.dart +++ b/dwds/test/instances/common/patterns_inspection_common.dart @@ -5,6 +5,7 @@ import 'package:test/test.dart'; import 'package:test_common/logging.dart'; import 'package:test_common/test_sdk_configuration.dart'; +import 'package:test_common/utilities.dart'; import 'package:vm_service/vm_service.dart'; import '../../fixtures/context.dart'; @@ -96,11 +97,24 @@ void runTests({ await onBreakPoint('testPatternCase2', (event) async { final frame = event.topFrame!; - expect(await getFrameVariables(frame), { - 'obj': matchListInstance(type: 'Object'), - 'a': matchPrimitiveInstance(kind: InstanceKind.kString, value: 'b'), - 'n': matchPrimitiveInstance(kind: InstanceKind.kDouble, value: 3.14), - }); + if (dartSdkIsAtLeast('3.7.0-246.0.dev')) { + expect(await getFrameVariables(frame), { + 'obj': matchListInstance(type: 'Object'), + // Renamed to avoid shadowing variables from previous case. + 'a\$': + matchPrimitiveInstance(kind: InstanceKind.kString, value: 'b'), + 'n\$': + matchPrimitiveInstance(kind: InstanceKind.kDouble, value: 3.14), + }); + } else { + expect(await getFrameVariables(frame), { + 'obj': matchListInstance(type: 'Object'), + // Renamed to avoid shadowing variables from previous case. + 'a': matchPrimitiveInstance(kind: InstanceKind.kString, value: 'b'), + 'n': + matchPrimitiveInstance(kind: InstanceKind.kDouble, value: 3.14), + }); + } }); });