Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit b18adaf

Browse files
authored
Move most of the dart:ui tests to package:test. (#55090)
Work towards flutter/flutter#133569. There are a couple with custom matchers I'd like to migrate in a follow-up PR.
1 parent dd2a02f commit b18adaf

39 files changed

+86
-76
lines changed

testing/dart/assets_test.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import 'dart:convert';
77
import 'dart:typed_data';
88
import 'dart:ui';
99

10-
import 'package:litetest/litetest.dart';
10+
import 'package:test/test.dart';
1111

1212
void main() {
1313
test('Loading an asset that does not exist returns null', () async {
@@ -81,7 +81,7 @@ void main() {
8181
final List<int> bundledFontImage = await _createPictureFromFont('Roboto2');
8282
// Bundling fonts is disabled, so the font selected in both cases should be ahem.
8383
// Therefore each buffer will contain identical contents.
84-
expect(ahemImage, notEquals(bundledFontImage));
84+
expect(ahemImage, isNot(bundledFontImage));
8585
});
8686
}
8787

testing/dart/channel_buffers_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import 'dart:convert';
99
import 'dart:typed_data';
1010
import 'dart:ui' as ui;
1111

12-
import 'package:litetest/litetest.dart';
12+
import 'package:test/test.dart';
1313

1414
ByteData _makeByteData(String str) {
1515
final Uint8List list = utf8.encode(str);

testing/dart/codec_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ import 'dart:io';
66
import 'dart:typed_data';
77
import 'dart:ui' as ui;
88

9-
import 'package:litetest/litetest.dart';
109
import 'package:path/path.dart' as path;
10+
import 'package:test/test.dart';
1111

1212
import 'impeller_enabled.dart';
1313

testing/dart/color_filter_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import 'dart:typed_data';
66
import 'dart:ui';
77

8-
import 'package:litetest/litetest.dart';
8+
import 'package:test/test.dart';
99

1010
import 'impeller_enabled.dart';
1111

testing/dart/compositing_test.dart

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import 'dart:typed_data';
66
import 'dart:ui';
77

8-
import 'package:litetest/litetest.dart';
8+
import 'package:test/test.dart';
99

1010
void main() {
1111
test('Scene.toImageSync succeeds', () async {
@@ -76,7 +76,7 @@ void main() {
7676
if (assertsEnabled) {
7777
expect(
7878
() => builder.addPicture(Offset.zero, picture),
79-
throwsA(isInstanceOf<AssertionError>()),
79+
throwsA(const isInstanceOf<AssertionError>()),
8080
);
8181
} else {
8282
builder.addPicture(Offset.zero, picture);
@@ -105,7 +105,7 @@ void main() {
105105
assert(() {
106106
expect(
107107
() => builder.pushTransform(matrix4WrongLength),
108-
expectAssertion,
108+
throwsA(isA<AssertionError>()),
109109
);
110110
return true;
111111
}());
@@ -119,7 +119,7 @@ void main() {
119119
assert(() {
120120
expect(
121121
() => builder.pushTransform(matrix4NaN),
122-
expectAssertion,
122+
throwsA(isA<AssertionError>()),
123123
);
124124
return true;
125125
}());
@@ -133,7 +133,7 @@ void main() {
133133
assert(() {
134134
expect(
135135
() => builder.pushTransform(matrix4Infinity),
136-
expectAssertion,
136+
throwsA(isA<AssertionError>()),
137137
);
138138
return true;
139139
}());

testing/dart/dart_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
import 'dart:async';
66

7-
import 'package:litetest/litetest.dart';
7+
import 'package:test/test.dart';
88

99
/// Verifies Dart semantics governed by flags set by Flutter tooling.
1010
void main() {

testing/dart/encoding_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ import 'dart:io';
77
import 'dart:typed_data';
88
import 'dart:ui';
99

10-
import 'package:litetest/litetest.dart';
1110
import 'package:path/path.dart' as path;
11+
import 'package:test/test.dart';
1212

1313
import 'impeller_enabled.dart';
1414

testing/dart/geometry_test.dart

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import 'dart:math' as math show sqrt;
99
import 'dart:math' show pi;
1010
import 'dart:ui';
1111

12-
import 'package:litetest/litetest.dart';
12+
import 'package:test/test.dart';
1313

1414
void main() {
1515
test('OffsetBase.>=', () {
@@ -47,8 +47,8 @@ void main() {
4747

4848
test('OffsetBase.==', () {
4949
expect(const Offset(0, 0), equals(const Offset(0, 0)));
50-
expect(const Offset(0, 0), notEquals(const Offset(1, 0)));
51-
expect(const Offset(0, 0), notEquals(const Offset(0, 1)));
50+
expect(const Offset(0, 0), isNot(const Offset(1, 0)));
51+
expect(const Offset(0, 0), isNot(const Offset(0, 1)));
5252
});
5353

5454
test('Offset.direction', () {
@@ -392,28 +392,28 @@ void main() {
392392
const Rect.fromLTRB(10.0, 20.0, 30.0, 40.0),
393393
topLeft: const Radius.circular(-1),
394394
);
395-
}, throwsA(isInstanceOf<AssertionError>()));
395+
}, throwsA(const isInstanceOf<AssertionError>()));
396396

397397
expect(() {
398398
RRect.fromRectAndCorners(
399399
const Rect.fromLTRB(10.0, 20.0, 30.0, 40.0),
400400
topRight: const Radius.circular(-2),
401401
);
402-
}, throwsA(isInstanceOf<AssertionError>()));
402+
}, throwsA(const isInstanceOf<AssertionError>()));
403403

404404
expect(() {
405405
RRect.fromRectAndCorners(
406406
const Rect.fromLTRB(10.0, 20.0, 30.0, 40.0),
407407
bottomLeft: const Radius.circular(-3),
408408
);
409-
}, throwsA(isInstanceOf<AssertionError>()));
409+
}, throwsA(const isInstanceOf<AssertionError>()));
410410

411411
expect(() {
412412
RRect.fromRectAndCorners(
413413
const Rect.fromLTRB(10.0, 20.0, 30.0, 40.0),
414414
bottomRight: const Radius.circular(-4),
415415
);
416-
}, throwsA(isInstanceOf<AssertionError>()));
416+
}, throwsA(const isInstanceOf<AssertionError>()));
417417
});
418418

419419
test('RRect.inflate clamps when deflating past zero', () {

testing/dart/gesture_settings_test.dart

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
import 'dart:ui';
66

7-
import 'package:litetest/litetest.dart';
7+
import 'package:test/test.dart';
88

99
void main() {
1010
test('GestureSettings has a reasonable toString', () {
@@ -23,11 +23,11 @@ void main() {
2323
expect(settingsA, equals(settingsC));
2424
expect(settingsC, equals(settingsA));
2525

26-
expect(settingsA, notEquals(settingsB));
27-
expect(settingsC, notEquals(settingsB));
26+
expect(settingsA, isNot(settingsB));
27+
expect(settingsC, isNot(settingsB));
2828

29-
expect(settingsB, notEquals(settingsA));
30-
expect(settingsB, notEquals(settingsC));
29+
expect(settingsB, isNot(settingsA));
30+
expect(settingsB, isNot(settingsC));
3131
});
3232

3333
test('GestureSettings copyWith preserves already set values', () {

testing/dart/gpu_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
import 'dart:typed_data';
88
import 'dart:ui' as ui;
99

10-
import 'package:litetest/litetest.dart';
10+
import 'package:test/test.dart';
1111

1212
import '../../lib/gpu/lib/gpu.dart' as gpu;
1313
import 'impeller_enabled.dart';

0 commit comments

Comments
 (0)