Skip to content

Commit 2849c65

Browse files
committed
Add version guard around condition.
1 parent 4d8acf0 commit 2849c65

File tree

1 file changed

+20
-7
lines changed

1 file changed

+20
-7
lines changed

dwds/test/instances/common/patterns_inspection_common.dart

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import 'package:test/test.dart';
66
import 'package:test_common/logging.dart';
77
import 'package:test_common/test_sdk_configuration.dart';
8+
import 'package:test_common/utilities.dart';
89
import 'package:vm_service/vm_service.dart';
910

1011
import '../../fixtures/context.dart';
@@ -96,13 +97,25 @@ void runTests({
9697
await onBreakPoint('testPatternCase2', (event) async {
9798
final frame = event.topFrame!;
9899

99-
expect(await getFrameVariables(frame), {
100-
'obj': matchListInstance(type: 'Object'),
101-
// Renamed to avoid shadowing variables from previous case.
102-
'a\$': matchPrimitiveInstance(kind: InstanceKind.kString, value: 'b'),
103-
'n\$':
104-
matchPrimitiveInstance(kind: InstanceKind.kDouble, value: 3.14),
105-
});
100+
if (dartSdkIsAtLeast('3.7.0-246.0.dev')) {
101+
expect(await getFrameVariables(frame), {
102+
'obj': matchListInstance(type: 'Object'),
103+
// Renamed to avoid shadowing variables from previous case.
104+
'a\$':
105+
matchPrimitiveInstance(kind: InstanceKind.kString, value: 'b'),
106+
'n\$':
107+
matchPrimitiveInstance(kind: InstanceKind.kDouble, value: 3.14),
108+
});
109+
} else {
110+
expect(await getFrameVariables(frame), {
111+
'obj': matchListInstance(type: 'Object'),
112+
// Renamed to avoid shadowing variables from previous case.
113+
'a':
114+
matchPrimitiveInstance(kind: InstanceKind.kString, value: 'b'),
115+
'n':
116+
matchPrimitiveInstance(kind: InstanceKind.kDouble, value: 3.14),
117+
});
118+
}
106119
});
107120
});
108121

0 commit comments

Comments
 (0)