parent
0cf1007276
commit
f3c25fa07a
@ -61,9 +61,6 @@ Future<void> run(List<String> arguments) async {
|
|||||||
print('$clock Test imports...');
|
print('$clock Test imports...');
|
||||||
await verifyNoTestImports(flutterRoot);
|
await verifyNoTestImports(flutterRoot);
|
||||||
|
|
||||||
print('$clock Test package imports...');
|
|
||||||
await verifyNoTestPackageImports(flutterRoot);
|
|
||||||
|
|
||||||
print('$clock Bad imports (framework)...');
|
print('$clock Bad imports (framework)...');
|
||||||
await verifyNoBadImportsInFlutter(flutterRoot);
|
await verifyNoBadImportsInFlutter(flutterRoot);
|
||||||
|
|
||||||
@ -299,79 +296,6 @@ Future<void> verifyNoTestImports(String workingDirectory) async {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> verifyNoTestPackageImports(String workingDirectory) async {
|
|
||||||
// TODO(ianh): Remove this whole test once https://github.com/dart-lang/matcher/issues/98 is fixed.
|
|
||||||
final List<String> shims = <String>[];
|
|
||||||
final List<String> errors = (await _allFiles(workingDirectory, 'dart', minimumMatches: 2000).toList())
|
|
||||||
.map<String>((File file) {
|
|
||||||
final String name = Uri.file(path.relative(file.path,
|
|
||||||
from: workingDirectory)).toFilePath(windows: false);
|
|
||||||
if (name.startsWith('bin/cache') ||
|
|
||||||
name == 'dev/bots/test.dart' ||
|
|
||||||
name.startsWith('.pub-cache'))
|
|
||||||
return null;
|
|
||||||
final String data = file.readAsStringSync();
|
|
||||||
if (data.contains("import 'package:test/test.dart'")) {
|
|
||||||
if (data.contains("// Defines a 'package:test' shim.")) {
|
|
||||||
shims.add(' $name');
|
|
||||||
if (!data.contains('https://github.com/dart-lang/matcher/issues/98'))
|
|
||||||
return ' $name: Shims must link to the isInstanceOf issue.';
|
|
||||||
if (data.contains("import 'package:test/test.dart' hide TypeMatcher, isInstanceOf;") &&
|
|
||||||
data.contains("export 'package:test/test.dart' hide TypeMatcher, isInstanceOf;"))
|
|
||||||
return null;
|
|
||||||
return ' $name: Shim seems to be missing the expected import/export lines.';
|
|
||||||
}
|
|
||||||
final int count = 'package:test'.allMatches(data).length;
|
|
||||||
if (path.split(file.path).contains('test_driver') ||
|
|
||||||
name.startsWith('dev/missing_dependency_tests/') ||
|
|
||||||
name.startsWith('dev/automated_tests/') ||
|
|
||||||
name.startsWith('dev/snippets/') ||
|
|
||||||
name.startsWith('packages/flutter/test/engine/') ||
|
|
||||||
name.startsWith('examples/layers/test/smoketests/raw/') ||
|
|
||||||
name.startsWith('examples/layers/test/smoketests/rendering/') ||
|
|
||||||
name.startsWith('dev/integration_tests/flutter_gallery/test/calculator')) {
|
|
||||||
// We only exempt driver tests, some of our special trivial tests.
|
|
||||||
// Driver tests aren't typically expected to use TypeMatcher and company.
|
|
||||||
// The trivial tests don't typically do anything at all and it would be
|
|
||||||
// a pain to have to give them a shim.
|
|
||||||
if (!data.contains("import 'package:test/test.dart' hide TypeMatcher, isInstanceOf;"))
|
|
||||||
return ' $name: test does not hide TypeMatcher and isInstanceOf from package:test; consider using a shim instead.';
|
|
||||||
assert(count > 0);
|
|
||||||
if (count == 1)
|
|
||||||
return null;
|
|
||||||
return " $name: uses 'package:test' $count times.";
|
|
||||||
}
|
|
||||||
if (name.startsWith('packages/flutter_test/')) {
|
|
||||||
// flutter_test has deep ties to package:test
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
if (data.contains("import 'package:test/test.dart' as test_package;") ||
|
|
||||||
data.contains("import 'package:test/test.dart' as test_package show ")) {
|
|
||||||
if (count == 1)
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
return " $name: uses 'package:test' directly";
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
})
|
|
||||||
.where((String line) => line != null)
|
|
||||||
.toList()
|
|
||||||
..sort();
|
|
||||||
|
|
||||||
// Fail if any errors
|
|
||||||
if (errors.isNotEmpty) {
|
|
||||||
final String s1 = errors.length == 1 ? 's' : '';
|
|
||||||
final String s2 = errors.length == 1 ? '' : 's';
|
|
||||||
exitWithError(<String>[
|
|
||||||
"${bold}The following file$s2 use$s1 'package:test' incorrectly:$reset",
|
|
||||||
...errors,
|
|
||||||
"Rather than depending on 'package:test' directly, use one of the shims:",
|
|
||||||
...shims,
|
|
||||||
"This insulates us from breaking changes in 'package:test'."
|
|
||||||
]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Future<void> verifyNoBadImportsInFlutter(String workingDirectory) async {
|
Future<void> verifyNoBadImportsInFlutter(String workingDirectory) async {
|
||||||
final List<String> errors = <String>[];
|
final List<String> errors = <String>[];
|
||||||
final String libPath = path.join(workingDirectory, 'packages', 'flutter', 'lib');
|
final String libPath = path.join(workingDirectory, 'packages', 'flutter', 'lib');
|
||||||
|
@ -4,16 +4,12 @@
|
|||||||
|
|
||||||
import 'dart:io';
|
import 'dart:io';
|
||||||
|
|
||||||
import 'package:test/test.dart' hide TypeMatcher, isInstanceOf;
|
import 'package:test/test.dart';
|
||||||
import 'package:test/test.dart' as test_package show TypeMatcher;
|
|
||||||
|
|
||||||
export 'package:test/test.dart' hide TypeMatcher, isInstanceOf;
|
export 'package:test/test.dart' hide isInstanceOf;
|
||||||
|
|
||||||
// Defines a 'package:test' shim.
|
|
||||||
// TODO(ianh): Remove this file once https://github.com/dart-lang/matcher/issues/98 is fixed
|
|
||||||
|
|
||||||
/// A matcher that compares the type of the actual value to the type argument T.
|
/// A matcher that compares the type of the actual value to the type argument T.
|
||||||
test_package.TypeMatcher<T> isInstanceOf<T>() => isA<T>();
|
TypeMatcher<T> isInstanceOf<T>() => isA<T>();
|
||||||
|
|
||||||
void tryToDelete(Directory directory) {
|
void tryToDelete(Directory directory) {
|
||||||
// This should not be necessary, but it turns out that
|
// This should not be necessary, but it turns out that
|
||||||
|
@ -2,13 +2,9 @@
|
|||||||
// Use of this source code is governed by a BSD-style license that can be
|
// Use of this source code is governed by a BSD-style license that can be
|
||||||
// found in the LICENSE file.
|
// found in the LICENSE file.
|
||||||
|
|
||||||
import 'package:test/test.dart' hide TypeMatcher, isInstanceOf;
|
import 'package:test/test.dart' hide isInstanceOf;
|
||||||
import 'package:test/test.dart' as test_package show TypeMatcher;
|
|
||||||
|
|
||||||
export 'package:test/test.dart' hide TypeMatcher, isInstanceOf;
|
export 'package:test/test.dart' hide isInstanceOf;
|
||||||
|
|
||||||
// Defines a 'package:test' shim.
|
|
||||||
// TODO(ianh): Remove this file once https://github.com/dart-lang/matcher/issues/98 is fixed
|
|
||||||
|
|
||||||
/// A matcher that compares the type of the actual value to the type argument T.
|
/// A matcher that compares the type of the actual value to the type argument T.
|
||||||
test_package.TypeMatcher<T> isInstanceOf<T>() => isA<T>();
|
TypeMatcher<T> isInstanceOf<T>() => isA<T>();
|
||||||
|
@ -2,13 +2,9 @@
|
|||||||
// Use of this source code is governed by a BSD-style license that can be
|
// Use of this source code is governed by a BSD-style license that can be
|
||||||
// found in the LICENSE file.
|
// found in the LICENSE file.
|
||||||
|
|
||||||
import 'package:test/test.dart' hide TypeMatcher, isInstanceOf;
|
import 'package:test/test.dart';
|
||||||
import 'package:test/test.dart' as test_package show TypeMatcher;
|
|
||||||
|
|
||||||
export 'package:test/test.dart' hide TypeMatcher, isInstanceOf;
|
export 'package:test/test.dart' hide isInstanceOf;
|
||||||
|
|
||||||
// Defines a 'package:test' shim.
|
|
||||||
// TODO(ianh): Remove this file once https://github.com/dart-lang/matcher/issues/98 is fixed
|
|
||||||
|
|
||||||
/// A matcher that compares the type of the actual value to the type argument T.
|
/// A matcher that compares the type of the actual value to the type argument T.
|
||||||
test_package.TypeMatcher<T> isInstanceOf<T>() => isA<T>();
|
TypeMatcher<T> isInstanceOf<T>() => isA<T>();
|
||||||
|
@ -5,6 +5,7 @@
|
|||||||
import 'dart:convert';
|
import 'dart:convert';
|
||||||
|
|
||||||
import 'package:meta/meta.dart';
|
import 'package:meta/meta.dart';
|
||||||
|
|
||||||
import 'constants.dart';
|
import 'constants.dart';
|
||||||
|
|
||||||
/// A semantics node created from Android accessibility information.
|
/// A semantics node created from Android accessibility information.
|
||||||
|
@ -1,14 +0,0 @@
|
|||||||
// Copyright 2014 The Flutter Authors. All rights reserved.
|
|
||||||
// Use of this source code is governed by a BSD-style license that can be
|
|
||||||
// found in the LICENSE file.
|
|
||||||
|
|
||||||
// Defines a 'package:test' shim.
|
|
||||||
// TODO(ianh): Remove this file once https://github.com/dart-lang/matcher/issues/98 is fixed
|
|
||||||
|
|
||||||
import 'package:test/test.dart' hide TypeMatcher, isInstanceOf;
|
|
||||||
import 'package:test/test.dart' as test_package show TypeMatcher;
|
|
||||||
|
|
||||||
export 'package:test/test.dart' hide TypeMatcher, isInstanceOf;
|
|
||||||
|
|
||||||
/// A matcher that compares the type of the actual value to the type argument T.
|
|
||||||
test_package.TypeMatcher<T> isInstanceOf<T>() => isA<T>();
|
|
@ -2,9 +2,10 @@
|
|||||||
// Use of this source code is governed by a BSD-style license that can be
|
// Use of this source code is governed by a BSD-style license that can be
|
||||||
// found in the LICENSE file.
|
// found in the LICENSE file.
|
||||||
|
|
||||||
|
import 'package:test/test.dart' hide isInstanceOf;
|
||||||
|
|
||||||
import 'common.dart';
|
import 'common.dart';
|
||||||
import 'constants.dart';
|
import 'constants.dart';
|
||||||
import 'flutter_test_alternative.dart';
|
|
||||||
|
|
||||||
/// Matches an [AndroidSemanticsNode].
|
/// Matches an [AndroidSemanticsNode].
|
||||||
///
|
///
|
||||||
|
@ -4,12 +4,11 @@
|
|||||||
|
|
||||||
import 'dart:io' as io;
|
import 'dart:io' as io;
|
||||||
|
|
||||||
import 'package:android_semantics_testing/test_constants.dart';
|
|
||||||
import 'package:android_semantics_testing/android_semantics_testing.dart';
|
import 'package:android_semantics_testing/android_semantics_testing.dart';
|
||||||
|
import 'package:android_semantics_testing/test_constants.dart';
|
||||||
import 'package:test/test.dart' hide TypeMatcher, isInstanceOf;
|
|
||||||
import 'package:flutter_driver/flutter_driver.dart';
|
import 'package:flutter_driver/flutter_driver.dart';
|
||||||
import 'package:path/path.dart' as path;
|
import 'package:path/path.dart' as path;
|
||||||
|
import 'package:test/test.dart' hide isInstanceOf;
|
||||||
|
|
||||||
String adbPath() {
|
String adbPath() {
|
||||||
final String androidHome = io.Platform.environment['ANDROID_HOME'] ?? io.Platform.environment['ANDROID_SDK_ROOT'];
|
final String androidHome = io.Platform.environment['ANDROID_HOME'] ?? io.Platform.environment['ANDROID_SDK_ROOT'];
|
||||||
|
@ -4,21 +4,15 @@
|
|||||||
|
|
||||||
import 'dart:io';
|
import 'dart:io';
|
||||||
|
|
||||||
import 'package:file/file.dart';
|
|
||||||
import 'package:test/test.dart' hide TypeMatcher, isInstanceOf;
|
|
||||||
import 'package:test/test.dart' as test_package show TypeMatcher;
|
|
||||||
|
|
||||||
import 'package:dev_tools/stdio.dart';
|
|
||||||
|
|
||||||
import 'package:args/args.dart';
|
import 'package:args/args.dart';
|
||||||
|
import 'package:dev_tools/stdio.dart';
|
||||||
|
import 'package:file/file.dart';
|
||||||
|
import 'package:test/test.dart';
|
||||||
|
|
||||||
export 'package:test/test.dart' hide TypeMatcher, isInstanceOf;
|
export 'package:test/test.dart' hide isInstanceOf;
|
||||||
|
|
||||||
// Defines a 'package:test' shim.
|
|
||||||
// TODO(ianh): Remove this file once https://github.com/dart-lang/matcher/issues/98 is fixed
|
|
||||||
|
|
||||||
/// A matcher that compares the type of the actual value to the type argument T.
|
/// A matcher that compares the type of the actual value to the type argument T.
|
||||||
test_package.TypeMatcher<T> isInstanceOf<T>() => isA<T>();
|
TypeMatcher<T> isInstanceOf<T>() => isA<T>();
|
||||||
|
|
||||||
void tryToDelete(Directory directory) {
|
void tryToDelete(Directory directory) {
|
||||||
// This should not be necessary, but it turns out that
|
// This should not be necessary, but it turns out that
|
||||||
|
@ -1,19 +0,0 @@
|
|||||||
// Copyright 2014 The Flutter Authors. All rights reserved.
|
|
||||||
// Use of this source code is governed by a BSD-style license that can be
|
|
||||||
// found in the LICENSE file.
|
|
||||||
|
|
||||||
// Defines a 'package:test' shim.
|
|
||||||
// TODO(ianh): Remove this file once https://github.com/dart-lang/matcher/issues/98 is fixed
|
|
||||||
|
|
||||||
import 'package:test_api/test_api.dart' hide TypeMatcher, isInstanceOf; // ignore: deprecated_member_use
|
|
||||||
import 'package:test_api/test_api.dart' as test_package show TypeMatcher; // ignore: deprecated_member_use
|
|
||||||
|
|
||||||
export 'package:test_api/test_api.dart' hide TypeMatcher, isInstanceOf; // ignore: deprecated_member_use
|
|
||||||
export 'package:test_api/fake.dart'; // ignore: deprecated_member_use
|
|
||||||
export 'package:flutter_test/flutter_test.dart' show createTestImage;
|
|
||||||
|
|
||||||
/// A matcher that compares the type of the actual value to the type argument T.
|
|
||||||
test_package.TypeMatcher<T> isInstanceOf<T>() => isA<T>();
|
|
||||||
|
|
||||||
/// Whether we are running in a web browser.
|
|
||||||
const bool isBrowser = identical(0, 0.0);
|
|
@ -3,7 +3,7 @@
|
|||||||
// found in the LICENSE file.
|
// found in the LICENSE file.
|
||||||
|
|
||||||
import 'package:flutter/foundation.dart';
|
import 'package:flutter/foundation.dart';
|
||||||
import '../flutter_test_alternative.dart';
|
import 'package:flutter_test/flutter_test.dart';
|
||||||
|
|
||||||
import 'capture_output.dart';
|
import 'capture_output.dart';
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
// found in the LICENSE file.
|
// found in the LICENSE file.
|
||||||
|
|
||||||
import 'package:flutter/foundation.dart';
|
import 'package:flutter/foundation.dart';
|
||||||
import '../flutter_test_alternative.dart';
|
import 'package:flutter_test/flutter_test.dart';
|
||||||
|
|
||||||
// ignore: unused_field
|
// ignore: unused_field
|
||||||
enum _TestEnum { a, b, c, d, e, f, g, h }
|
enum _TestEnum { a, b, c, d, e, f, g, h }
|
||||||
|
@ -3,8 +3,7 @@
|
|||||||
// found in the LICENSE file.
|
// found in the LICENSE file.
|
||||||
|
|
||||||
import 'package:flutter/foundation.dart';
|
import 'package:flutter/foundation.dart';
|
||||||
|
import 'package:flutter_test/flutter_test.dart';
|
||||||
import '../flutter_test_alternative.dart';
|
|
||||||
|
|
||||||
int yieldCount = 0;
|
int yieldCount = 0;
|
||||||
|
|
||||||
|
@ -3,16 +3,17 @@
|
|||||||
// found in the LICENSE file.
|
// found in the LICENSE file.
|
||||||
|
|
||||||
@TestOn('!chrome')
|
@TestOn('!chrome')
|
||||||
|
|
||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
import 'dart:io';
|
import 'dart:io';
|
||||||
import 'dart:typed_data';
|
import 'dart:typed_data';
|
||||||
|
|
||||||
import 'package:flutter/foundation.dart';
|
import 'package:flutter/foundation.dart';
|
||||||
|
import 'package:flutter_test/flutter_test.dart';
|
||||||
import '../flutter_test_alternative.dart';
|
|
||||||
|
|
||||||
final Uint8List chunkOne = Uint8List.fromList(<int>[0, 1, 2, 3, 4, 5]);
|
final Uint8List chunkOne = Uint8List.fromList(<int>[0, 1, 2, 3, 4, 5]);
|
||||||
final Uint8List chunkTwo = Uint8List.fromList(<int>[6, 7, 8, 9, 10]);
|
final Uint8List chunkTwo = Uint8List.fromList(<int>[6, 7, 8, 9, 10]);
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
group(consolidateHttpClientResponseBytes, () {
|
group(consolidateHttpClientResponseBytes, () {
|
||||||
late MockHttpClientResponse response;
|
late MockHttpClientResponse response;
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
// found in the LICENSE file.
|
// found in the LICENSE file.
|
||||||
|
|
||||||
import 'package:flutter/foundation.dart';
|
import 'package:flutter/foundation.dart';
|
||||||
import '../flutter_test_alternative.dart';
|
import 'package:flutter_test/flutter_test.dart';
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
test('isWeb is false for flutter tester', () {
|
test('isWeb is false for flutter tester', () {
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
// found in the LICENSE file.
|
// found in the LICENSE file.
|
||||||
|
|
||||||
import 'package:flutter/foundation.dart';
|
import 'package:flutter/foundation.dart';
|
||||||
import '../flutter_test_alternative.dart';
|
import 'package:flutter_test/flutter_test.dart';
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
test('debugFormatDouble formats doubles', () {
|
test('debugFormatDouble formats doubles', () {
|
||||||
|
@ -3,8 +3,9 @@
|
|||||||
// found in the LICENSE file.
|
// found in the LICENSE file.
|
||||||
|
|
||||||
@TestOn('!chrome')
|
@TestOn('!chrome')
|
||||||
|
|
||||||
import 'package:flutter/foundation.dart';
|
import 'package:flutter/foundation.dart';
|
||||||
import '../flutter_test_alternative.dart';
|
import 'package:flutter_test/flutter_test.dart';
|
||||||
|
|
||||||
Object getAssertionErrorWithMessage() {
|
Object getAssertionErrorWithMessage() {
|
||||||
try {
|
try {
|
||||||
|
@ -3,8 +3,7 @@
|
|||||||
// found in the LICENSE file.
|
// found in the LICENSE file.
|
||||||
|
|
||||||
import 'package:flutter/foundation.dart';
|
import 'package:flutter/foundation.dart';
|
||||||
|
import 'package:flutter_test/flutter_test.dart';
|
||||||
import '../flutter_test_alternative.dart';
|
|
||||||
|
|
||||||
int test1(int value) {
|
int test1(int value) {
|
||||||
return value + 1;
|
return value + 1;
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
// found in the LICENSE file.
|
// found in the LICENSE file.
|
||||||
|
|
||||||
import 'package:flutter/foundation.dart';
|
import 'package:flutter/foundation.dart';
|
||||||
import '../flutter_test_alternative.dart';
|
import 'package:flutter_test/flutter_test.dart';
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
test('LicenseEntryWithLineBreaks - most cases', () {
|
test('LicenseEntryWithLineBreaks - most cases', () {
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
import 'package:flutter/foundation.dart';
|
import 'package:flutter/foundation.dart';
|
||||||
import 'package:fake_async/fake_async.dart';
|
import 'package:fake_async/fake_async.dart';
|
||||||
import '../flutter_test_alternative.dart';
|
import 'package:flutter_test/flutter_test.dart';
|
||||||
|
|
||||||
import 'capture_output.dart';
|
import 'capture_output.dart';
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
// found in the LICENSE file.
|
// found in the LICENSE file.
|
||||||
|
|
||||||
import 'package:flutter/foundation.dart';
|
import 'package:flutter/foundation.dart';
|
||||||
import '../flutter_test_alternative.dart';
|
import 'package:flutter_test/flutter_test.dart';
|
||||||
|
|
||||||
class TestFoundationFlutterBinding extends BindingBase {
|
class TestFoundationFlutterBinding extends BindingBase {
|
||||||
bool? wasLocked;
|
bool? wasLocked;
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
import 'dart:typed_data';
|
import 'dart:typed_data';
|
||||||
|
|
||||||
import 'package:flutter/foundation.dart';
|
import 'package:flutter/foundation.dart';
|
||||||
import '../flutter_test_alternative.dart';
|
import 'package:flutter_test/flutter_test.dart';
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
group('Write and read buffer round-trip', () {
|
group('Write and read buffer round-trip', () {
|
||||||
|
@ -12,7 +12,7 @@ import 'package:flutter/rendering.dart';
|
|||||||
import 'package:flutter/scheduler.dart';
|
import 'package:flutter/scheduler.dart';
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
import 'package:flutter/widgets.dart';
|
import 'package:flutter/widgets.dart';
|
||||||
import '../flutter_test_alternative.dart';
|
import 'package:flutter_test/flutter_test.dart';
|
||||||
|
|
||||||
class TestServiceExtensionsBinding extends BindingBase
|
class TestServiceExtensionsBinding extends BindingBase
|
||||||
with SchedulerBinding,
|
with SchedulerBinding,
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
// found in the LICENSE file.
|
// found in the LICENSE file.
|
||||||
|
|
||||||
import 'package:flutter/foundation.dart';
|
import 'package:flutter/foundation.dart';
|
||||||
import '../flutter_test_alternative.dart';
|
import 'package:flutter_test/flutter_test.dart';
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
test('Parses line', () {
|
test('Parses line', () {
|
||||||
|
@ -3,8 +3,9 @@
|
|||||||
// found in the LICENSE file.
|
// found in the LICENSE file.
|
||||||
|
|
||||||
@TestOn('!chrome')
|
@TestOn('!chrome')
|
||||||
|
|
||||||
import 'package:flutter/foundation.dart';
|
import 'package:flutter/foundation.dart';
|
||||||
import '../flutter_test_alternative.dart';
|
import 'package:flutter_test/flutter_test.dart';
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
// TODO(ianh): These tests and the filtering mechanism should be revisited to
|
// TODO(ianh): These tests and the filtering mechanism should be revisited to
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
// found in the LICENSE file.
|
// found in the LICENSE file.
|
||||||
|
|
||||||
import 'package:flutter/foundation.dart';
|
import 'package:flutter/foundation.dart';
|
||||||
import '../flutter_test_alternative.dart';
|
import 'package:flutter_test/flutter_test.dart';
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
test('SynchronousFuture control test', () async {
|
test('SynchronousFuture control test', () async {
|
||||||
|
@ -3,8 +3,7 @@
|
|||||||
// found in the LICENSE file.
|
// found in the LICENSE file.
|
||||||
|
|
||||||
import 'package:flutter/gestures.dart';
|
import 'package:flutter/gestures.dart';
|
||||||
|
import 'package:flutter_test/flutter_test.dart';
|
||||||
import '../flutter_test_alternative.dart';
|
|
||||||
|
|
||||||
typedef GestureArenaCallback = void Function(Object key);
|
typedef GestureArenaCallback = void Function(Object key);
|
||||||
|
|
||||||
|
@ -2,10 +2,10 @@
|
|||||||
// Use of this source code is governed by a BSD-style license that can be
|
// Use of this source code is governed by a BSD-style license that can be
|
||||||
// found in the LICENSE file.
|
// found in the LICENSE file.
|
||||||
|
|
||||||
import 'package:flutter/gestures.dart';
|
|
||||||
import 'package:fake_async/fake_async.dart';
|
import 'package:fake_async/fake_async.dart';
|
||||||
|
import 'package:flutter/gestures.dart';
|
||||||
|
import 'package:flutter_test/flutter_test.dart';
|
||||||
|
|
||||||
import '../flutter_test_alternative.dart';
|
|
||||||
import 'gesture_tester.dart';
|
import 'gesture_tester.dart';
|
||||||
|
|
||||||
class TestGestureArenaMember extends GestureArenaMember {
|
class TestGestureArenaMember extends GestureArenaMember {
|
||||||
|
@ -9,8 +9,7 @@ import 'package:fake_async/fake_async.dart';
|
|||||||
import 'package:flutter/foundation.dart';
|
import 'package:flutter/foundation.dart';
|
||||||
import 'package:flutter/gestures.dart';
|
import 'package:flutter/gestures.dart';
|
||||||
import 'package:flutter/scheduler.dart';
|
import 'package:flutter/scheduler.dart';
|
||||||
|
import 'package:flutter_test/flutter_test.dart';
|
||||||
import '../flutter_test_alternative.dart';
|
|
||||||
|
|
||||||
typedef HandleEventCallback = void Function(PointerEvent event);
|
typedef HandleEventCallback = void Function(PointerEvent event);
|
||||||
|
|
||||||
|
@ -7,8 +7,7 @@ import 'dart:ui' as ui;
|
|||||||
import 'package:flutter/foundation.dart';
|
import 'package:flutter/foundation.dart';
|
||||||
import 'package:flutter/gestures.dart';
|
import 'package:flutter/gestures.dart';
|
||||||
import 'package:flutter/scheduler.dart';
|
import 'package:flutter/scheduler.dart';
|
||||||
|
import 'package:flutter_test/flutter_test.dart';
|
||||||
import '../flutter_test_alternative.dart';
|
|
||||||
|
|
||||||
typedef HandleEventCallback = void Function(PointerEvent event);
|
typedef HandleEventCallback = void Function(PointerEvent event);
|
||||||
|
|
||||||
|
@ -2,12 +2,11 @@
|
|||||||
// Use of this source code is governed by a BSD-style license that can be
|
// Use of this source code is governed by a BSD-style license that can be
|
||||||
// found in the LICENSE file.
|
// found in the LICENSE file.
|
||||||
|
|
||||||
|
import 'package:fake_async/fake_async.dart';
|
||||||
import 'package:flutter/foundation.dart';
|
import 'package:flutter/foundation.dart';
|
||||||
import 'package:flutter/gestures.dart';
|
import 'package:flutter/gestures.dart';
|
||||||
|
import 'package:flutter_test/flutter_test.dart';
|
||||||
import 'package:meta/meta.dart';
|
import 'package:meta/meta.dart';
|
||||||
import 'package:fake_async/fake_async.dart';
|
|
||||||
|
|
||||||
import '../flutter_test_alternative.dart';
|
|
||||||
|
|
||||||
class TestGestureFlutterBinding extends BindingBase with GestureBinding { }
|
class TestGestureFlutterBinding extends BindingBase with GestureBinding { }
|
||||||
|
|
||||||
|
@ -3,10 +3,9 @@
|
|||||||
// found in the LICENSE file.
|
// found in the LICENSE file.
|
||||||
|
|
||||||
import 'package:flutter/gestures.dart';
|
import 'package:flutter/gestures.dart';
|
||||||
|
import 'package:flutter_test/flutter_test.dart';
|
||||||
import 'package:vector_math/vector_math_64.dart';
|
import 'package:vector_math/vector_math_64.dart';
|
||||||
|
|
||||||
import '../flutter_test_alternative.dart';
|
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
test('wrapped HitTestResult gets HitTestEntry added to wrapping HitTestResult', () async {
|
test('wrapped HitTestResult gets HitTestEntry added to wrapping HitTestResult', () async {
|
||||||
final HitTestEntry entry1 = HitTestEntry(_DummyHitTestTarget());
|
final HitTestEntry entry1 = HitTestEntry(_DummyHitTestTarget());
|
||||||
|
@ -6,8 +6,7 @@ import 'dart:ui' as ui;
|
|||||||
|
|
||||||
import 'package:flutter/foundation.dart';
|
import 'package:flutter/foundation.dart';
|
||||||
import 'package:flutter/gestures.dart';
|
import 'package:flutter/gestures.dart';
|
||||||
|
import 'package:flutter_test/flutter_test.dart';
|
||||||
import '../flutter_test_alternative.dart';
|
|
||||||
|
|
||||||
typedef HandleEventCallback = void Function(PointerEvent event);
|
typedef HandleEventCallback = void Function(PointerEvent event);
|
||||||
|
|
||||||
|
@ -3,8 +3,8 @@
|
|||||||
// found in the LICENSE file.
|
// found in the LICENSE file.
|
||||||
|
|
||||||
import 'package:flutter/gestures.dart';
|
import 'package:flutter/gestures.dart';
|
||||||
|
import 'package:flutter_test/flutter_test.dart';
|
||||||
|
|
||||||
import '../flutter_test_alternative.dart';
|
|
||||||
import 'gesture_tester.dart';
|
import 'gesture_tester.dart';
|
||||||
|
|
||||||
// Down/move/up pair 1: normal tap sequence
|
// Down/move/up pair 1: normal tap sequence
|
||||||
|
@ -3,8 +3,7 @@
|
|||||||
// found in the LICENSE file.
|
// found in the LICENSE file.
|
||||||
|
|
||||||
import 'package:flutter/gestures.dart';
|
import 'package:flutter/gestures.dart';
|
||||||
|
import 'package:flutter_test/flutter_test.dart';
|
||||||
import '../flutter_test_alternative.dart';
|
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
bool approx(double value, double expectation) {
|
bool approx(double value, double expectation) {
|
||||||
|
@ -3,10 +3,9 @@
|
|||||||
// found in the LICENSE file.
|
// found in the LICENSE file.
|
||||||
|
|
||||||
import 'package:flutter/gestures.dart';
|
import 'package:flutter/gestures.dart';
|
||||||
|
import 'package:flutter_test/flutter_test.dart';
|
||||||
import 'package:vector_math/vector_math_64.dart';
|
import 'package:vector_math/vector_math_64.dart';
|
||||||
|
|
||||||
import '../flutter_test_alternative.dart';
|
|
||||||
|
|
||||||
class TestPointerSignalListener {
|
class TestPointerSignalListener {
|
||||||
TestPointerSignalListener(this.event);
|
TestPointerSignalListener(this.event);
|
||||||
|
|
||||||
|
@ -3,8 +3,7 @@
|
|||||||
// found in the LICENSE file.
|
// found in the LICENSE file.
|
||||||
|
|
||||||
import 'package:flutter/gestures.dart';
|
import 'package:flutter/gestures.dart';
|
||||||
|
import 'package:flutter_test/flutter_test.dart';
|
||||||
import '../flutter_test_alternative.dart';
|
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
PointerEvent _createSimulatedPointerAddedEvent(
|
PointerEvent _createSimulatedPointerAddedEvent(
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
// Use of this source code is governed by a BSD-style license that can be
|
// Use of this source code is governed by a BSD-style license that can be
|
||||||
// found in the LICENSE file.
|
// found in the LICENSE file.
|
||||||
|
|
||||||
import '../flutter_test_alternative.dart';
|
import 'package:flutter_test/flutter_test.dart';
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
test('should pass', () {
|
test('should pass', () {
|
||||||
|
@ -3,8 +3,7 @@
|
|||||||
// found in the LICENSE file.
|
// found in the LICENSE file.
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter_test/flutter_test.dart';
|
||||||
import '../flutter_test_alternative.dart';
|
|
||||||
|
|
||||||
const List<int> primaryKeys = <int>[50, 100, 200, 300, 400, 500, 600, 700, 800, 900];
|
const List<int> primaryKeys = <int>[50, 100, 200, 300, 400, 500, 600, 700, 800, 900];
|
||||||
const List<int> accentKeys = <int>[100, 200, 400, 700];
|
const List<int> accentKeys = <int>[100, 200, 400, 700];
|
||||||
|
@ -3,8 +3,7 @@
|
|||||||
// found in the LICENSE file.
|
// found in the LICENSE file.
|
||||||
|
|
||||||
import 'package:flutter/painting.dart';
|
import 'package:flutter/painting.dart';
|
||||||
|
import 'package:flutter_test/flutter_test.dart';
|
||||||
import '../flutter_test_alternative.dart';
|
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
test('applyBoxFit', () {
|
test('applyBoxFit', () {
|
||||||
|
@ -9,8 +9,8 @@ import 'dart:ui' as ui show Image, ColorFilter;
|
|||||||
import 'package:flutter/foundation.dart';
|
import 'package:flutter/foundation.dart';
|
||||||
import 'package:flutter/painting.dart';
|
import 'package:flutter/painting.dart';
|
||||||
import 'package:fake_async/fake_async.dart';
|
import 'package:fake_async/fake_async.dart';
|
||||||
|
import 'package:flutter_test/flutter_test.dart';
|
||||||
|
|
||||||
import '../flutter_test_alternative.dart';
|
|
||||||
import '../image_data.dart';
|
import '../image_data.dart';
|
||||||
import '../painting/mocks_for_image_cache.dart';
|
import '../painting/mocks_for_image_cache.dart';
|
||||||
import '../rendering/rendering_tester.dart';
|
import '../rendering/rendering_tester.dart';
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
// found in the LICENSE file.
|
// found in the LICENSE file.
|
||||||
|
|
||||||
import 'package:flutter/painting.dart';
|
import 'package:flutter/painting.dart';
|
||||||
import '../flutter_test_alternative.dart';
|
import 'package:flutter_test/flutter_test.dart';
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
test('positionDependentBox', () {
|
test('positionDependentBox', () {
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
import 'dart:ui' as ui;
|
import 'dart:ui' as ui;
|
||||||
|
|
||||||
import 'package:flutter/painting.dart';
|
import 'package:flutter/painting.dart';
|
||||||
import '../flutter_test_alternative.dart';
|
import 'package:flutter_test/flutter_test.dart';
|
||||||
|
|
||||||
import '../rendering/rendering_tester.dart';
|
import '../rendering/rendering_tester.dart';
|
||||||
import 'mocks_for_image_cache.dart';
|
import 'mocks_for_image_cache.dart';
|
||||||
|
@ -8,8 +8,8 @@ import 'dart:ui' as ui;
|
|||||||
import 'package:flutter/foundation.dart';
|
import 'package:flutter/foundation.dart';
|
||||||
import 'package:flutter/painting.dart';
|
import 'package:flutter/painting.dart';
|
||||||
import 'package:flutter/scheduler.dart';
|
import 'package:flutter/scheduler.dart';
|
||||||
|
import 'package:flutter_test/flutter_test.dart';
|
||||||
|
|
||||||
import '../flutter_test_alternative.dart';
|
|
||||||
import '../rendering/rendering_tester.dart';
|
import '../rendering/rendering_tester.dart';
|
||||||
import 'mocks_for_image_cache.dart';
|
import 'mocks_for_image_cache.dart';
|
||||||
|
|
||||||
|
@ -6,8 +6,8 @@ import 'dart:typed_data';
|
|||||||
import 'dart:ui' as ui;
|
import 'dart:ui' as ui;
|
||||||
|
|
||||||
import 'package:flutter/painting.dart';
|
import 'package:flutter/painting.dart';
|
||||||
|
import 'package:flutter_test/flutter_test.dart';
|
||||||
|
|
||||||
import '../flutter_test_alternative.dart';
|
|
||||||
import '../image_data.dart';
|
import '../image_data.dart';
|
||||||
import 'painting_utils.dart';
|
import 'painting_utils.dart';
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
// found in the LICENSE file.
|
// found in the LICENSE file.
|
||||||
|
|
||||||
import 'package:flutter/painting.dart';
|
import 'package:flutter/painting.dart';
|
||||||
import '../flutter_test_alternative.dart';
|
import 'package:flutter_test/flutter_test.dart';
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
test('StrutStyle diagnostics test', () {
|
test('StrutStyle diagnostics test', () {
|
||||||
|
@ -4,9 +4,9 @@
|
|||||||
|
|
||||||
import 'dart:ui' as ui show TextStyle, ParagraphStyle, FontFeature, Shadow;
|
import 'dart:ui' as ui show TextStyle, ParagraphStyle, FontFeature, Shadow;
|
||||||
|
|
||||||
|
import 'package:flutter/foundation.dart';
|
||||||
import 'package:flutter/painting.dart';
|
import 'package:flutter/painting.dart';
|
||||||
import 'package:flutter/src/foundation/constants.dart';
|
import 'package:flutter_test/flutter_test.dart';
|
||||||
import '../flutter_test_alternative.dart';
|
|
||||||
|
|
||||||
// This matcher verifies ui.TextStyle.toString (from dart:ui) reports a superset
|
// This matcher verifies ui.TextStyle.toString (from dart:ui) reports a superset
|
||||||
// of the given TextStyle's (from painting.dart) properties.
|
// of the given TextStyle's (from painting.dart) properties.
|
||||||
|
@ -3,8 +3,7 @@
|
|||||||
// found in the LICENSE file.
|
// found in the LICENSE file.
|
||||||
|
|
||||||
import 'package:flutter/physics.dart';
|
import 'package:flutter/physics.dart';
|
||||||
|
import 'package:flutter_test/flutter_test.dart';
|
||||||
import '../flutter_test_alternative.dart';
|
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
test('test_friction', () {
|
test('test_friction', () {
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
import 'package:flutter/rendering.dart';
|
import 'package:flutter/rendering.dart';
|
||||||
import 'package:flutter/widgets.dart';
|
import 'package:flutter/widgets.dart';
|
||||||
import '../flutter_test_alternative.dart';
|
import 'package:flutter_test/flutter_test.dart';
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
group('$AnnotatedRegion find', () {
|
group('$AnnotatedRegion find', () {
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
// found in the LICENSE file.
|
// found in the LICENSE file.
|
||||||
|
|
||||||
import 'package:flutter/rendering.dart';
|
import 'package:flutter/rendering.dart';
|
||||||
import '../flutter_test_alternative.dart';
|
import 'package:flutter_test/flutter_test.dart';
|
||||||
|
|
||||||
import 'rendering_tester.dart';
|
import 'rendering_tester.dart';
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
// found in the LICENSE file.
|
// found in the LICENSE file.
|
||||||
|
|
||||||
import 'package:flutter/rendering.dart';
|
import 'package:flutter/rendering.dart';
|
||||||
import '../flutter_test_alternative.dart';
|
import 'package:flutter_test/flutter_test.dart';
|
||||||
|
|
||||||
class RenderTestBox extends RenderBox {
|
class RenderTestBox extends RenderBox {
|
||||||
double value = 0.0;
|
double value = 0.0;
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
// found in the LICENSE file.
|
// found in the LICENSE file.
|
||||||
|
|
||||||
import 'package:flutter/rendering.dart';
|
import 'package:flutter/rendering.dart';
|
||||||
import '../flutter_test_alternative.dart';
|
import 'package:flutter_test/flutter_test.dart';
|
||||||
|
|
||||||
import 'rendering_tester.dart';
|
import 'rendering_tester.dart';
|
||||||
|
|
||||||
|
@ -5,8 +5,8 @@
|
|||||||
import 'package:flutter/foundation.dart';
|
import 'package:flutter/foundation.dart';
|
||||||
import 'package:flutter/rendering.dart';
|
import 'package:flutter/rendering.dart';
|
||||||
import 'package:vector_math/vector_math_64.dart';
|
import 'package:vector_math/vector_math_64.dart';
|
||||||
|
import 'package:flutter_test/flutter_test.dart';
|
||||||
|
|
||||||
import '../flutter_test_alternative.dart';
|
|
||||||
import 'mock_canvas.dart';
|
import 'mock_canvas.dart';
|
||||||
import 'rendering_tester.dart';
|
import 'rendering_tester.dart';
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
// found in the LICENSE file.
|
// found in the LICENSE file.
|
||||||
|
|
||||||
import 'package:flutter/rendering.dart';
|
import 'package:flutter/rendering.dart';
|
||||||
import '../flutter_test_alternative.dart';
|
import 'package:flutter_test/flutter_test.dart';
|
||||||
|
|
||||||
import 'rendering_tester.dart';
|
import 'rendering_tester.dart';
|
||||||
|
|
||||||
|
@ -9,8 +9,7 @@ import 'package:flutter/gestures.dart';
|
|||||||
import 'package:flutter/rendering.dart';
|
import 'package:flutter/rendering.dart';
|
||||||
import 'package:flutter/scheduler.dart';
|
import 'package:flutter/scheduler.dart';
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
|
import 'package:flutter_test/flutter_test.dart';
|
||||||
import '../flutter_test_alternative.dart';
|
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
test('Flutter dispatches first frame event on the web only', () async {
|
test('Flutter dispatches first frame event on the web only', () async {
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
import 'dart:ui' as ui show window;
|
import 'dart:ui' as ui show window;
|
||||||
|
|
||||||
import 'package:flutter/rendering.dart';
|
import 'package:flutter/rendering.dart';
|
||||||
import '../flutter_test_alternative.dart';
|
import 'package:flutter_test/flutter_test.dart';
|
||||||
|
|
||||||
import 'rendering_tester.dart';
|
import 'rendering_tester.dart';
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
// found in the LICENSE file.
|
// found in the LICENSE file.
|
||||||
|
|
||||||
import 'package:flutter/rendering.dart';
|
import 'package:flutter/rendering.dart';
|
||||||
import '../flutter_test_alternative.dart';
|
import 'package:flutter_test/flutter_test.dart';
|
||||||
|
|
||||||
import 'rendering_tester.dart';
|
import 'rendering_tester.dart';
|
||||||
|
|
||||||
|
@ -8,8 +8,8 @@ import 'dart:ui' show PointerChange;
|
|||||||
import 'package:flutter/rendering.dart';
|
import 'package:flutter/rendering.dart';
|
||||||
import 'package:flutter/gestures.dart';
|
import 'package:flutter/gestures.dart';
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
|
import 'package:flutter_test/flutter_test.dart';
|
||||||
|
|
||||||
import '../flutter_test_alternative.dart';
|
|
||||||
import 'mouse_tracker_test_utils.dart';
|
import 'mouse_tracker_test_utils.dart';
|
||||||
|
|
||||||
typedef MethodCallHandler = Future<dynamic> Function(MethodCall call);
|
typedef MethodCallHandler = Future<dynamic> Function(MethodCall call);
|
||||||
|
@ -7,8 +7,8 @@ import 'dart:ui' show PointerChange;
|
|||||||
|
|
||||||
import 'package:flutter/rendering.dart';
|
import 'package:flutter/rendering.dart';
|
||||||
import 'package:flutter/gestures.dart';
|
import 'package:flutter/gestures.dart';
|
||||||
|
import 'package:flutter_test/flutter_test.dart';
|
||||||
|
|
||||||
import '../flutter_test_alternative.dart';
|
|
||||||
import 'mouse_tracker_test_utils.dart';
|
import 'mouse_tracker_test_utils.dart';
|
||||||
|
|
||||||
MouseTracker get _mouseTracker => RendererBinding.instance!.mouseTracker;
|
MouseTracker get _mouseTracker => RendererBinding.instance!.mouseTracker;
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
// found in the LICENSE file.
|
// found in the LICENSE file.
|
||||||
|
|
||||||
import 'package:flutter/rendering.dart';
|
import 'package:flutter/rendering.dart';
|
||||||
import '../flutter_test_alternative.dart';
|
import 'package:flutter_test/flutter_test.dart';
|
||||||
|
|
||||||
import 'rendering_tester.dart';
|
import 'rendering_tester.dart';
|
||||||
|
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
import 'package:flutter/foundation.dart';
|
import 'package:flutter/foundation.dart';
|
||||||
import 'package:flutter/rendering.dart';
|
import 'package:flutter/rendering.dart';
|
||||||
import '../flutter_test_alternative.dart';
|
import 'package:flutter_test/flutter_test.dart';
|
||||||
|
|
||||||
import 'rendering_tester.dart';
|
import 'rendering_tester.dart';
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
// found in the LICENSE file.
|
// found in the LICENSE file.
|
||||||
|
|
||||||
import 'package:flutter/rendering.dart';
|
import 'package:flutter/rendering.dart';
|
||||||
import '../flutter_test_alternative.dart';
|
import 'package:flutter_test/flutter_test.dart';
|
||||||
|
|
||||||
import 'rendering_tester.dart';
|
import 'rendering_tester.dart';
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
// found in the LICENSE file.
|
// found in the LICENSE file.
|
||||||
|
|
||||||
import 'package:flutter/rendering.dart';
|
import 'package:flutter/rendering.dart';
|
||||||
import '../flutter_test_alternative.dart';
|
import 'package:flutter_test/flutter_test.dart';
|
||||||
|
|
||||||
import 'rendering_tester.dart';
|
import 'rendering_tester.dart';
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
// found in the LICENSE file.
|
// found in the LICENSE file.
|
||||||
|
|
||||||
import 'package:flutter/rendering.dart';
|
import 'package:flutter/rendering.dart';
|
||||||
import '../flutter_test_alternative.dart';
|
import 'package:flutter_test/flutter_test.dart';
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
test('list body and paragraph intrinsics', () {
|
test('list body and paragraph intrinsics', () {
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
// found in the LICENSE file.
|
// found in the LICENSE file.
|
||||||
|
|
||||||
import 'package:flutter/rendering.dart';
|
import 'package:flutter/rendering.dart';
|
||||||
import '../flutter_test_alternative.dart';
|
import 'package:flutter_test/flutter_test.dart';
|
||||||
|
|
||||||
import 'rendering_tester.dart';
|
import 'rendering_tester.dart';
|
||||||
|
|
||||||
|
@ -9,7 +9,7 @@ import 'package:flutter/animation.dart';
|
|||||||
import 'package:flutter/foundation.dart';
|
import 'package:flutter/foundation.dart';
|
||||||
import 'package:flutter/gestures.dart';
|
import 'package:flutter/gestures.dart';
|
||||||
import 'package:flutter/rendering.dart';
|
import 'package:flutter/rendering.dart';
|
||||||
import '../flutter_test_alternative.dart';
|
import 'package:flutter_test/flutter_test.dart';
|
||||||
|
|
||||||
import 'rendering_tester.dart';
|
import 'rendering_tester.dart';
|
||||||
|
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/rendering.dart';
|
import 'package:flutter/rendering.dart';
|
||||||
import '../flutter_test_alternative.dart';
|
import 'package:flutter_test/flutter_test.dart';
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
test('RenderConstrainedBox getters and setters', () {
|
test('RenderConstrainedBox getters and setters', () {
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
import 'package:flutter/rendering.dart';
|
import 'package:flutter/rendering.dart';
|
||||||
import 'package:flutter/widgets.dart';
|
import 'package:flutter/widgets.dart';
|
||||||
import '../flutter_test_alternative.dart';
|
import 'package:flutter_test/flutter_test.dart';
|
||||||
|
|
||||||
import 'rendering_tester.dart';
|
import 'rendering_tester.dart';
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
// found in the LICENSE file.
|
// found in the LICENSE file.
|
||||||
|
|
||||||
import 'package:flutter/rendering.dart';
|
import 'package:flutter/rendering.dart';
|
||||||
import '../flutter_test_alternative.dart';
|
import 'package:flutter_test/flutter_test.dart';
|
||||||
|
|
||||||
import 'rendering_tester.dart';
|
import 'rendering_tester.dart';
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
// found in the LICENSE file.
|
// found in the LICENSE file.
|
||||||
|
|
||||||
import 'package:flutter/rendering.dart';
|
import 'package:flutter/rendering.dart';
|
||||||
import '../flutter_test_alternative.dart';
|
import 'package:flutter_test/flutter_test.dart';
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
test('RelativeRect.==', () {
|
test('RelativeRect.==', () {
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
// found in the LICENSE file.
|
// found in the LICENSE file.
|
||||||
|
|
||||||
import 'package:flutter/rendering.dart';
|
import 'package:flutter/rendering.dart';
|
||||||
import '../flutter_test_alternative.dart';
|
import 'package:flutter_test/flutter_test.dart';
|
||||||
|
|
||||||
import 'rendering_tester.dart';
|
import 'rendering_tester.dart';
|
||||||
|
|
||||||
|
@ -4,8 +4,7 @@
|
|||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/rendering.dart';
|
import 'package:flutter/rendering.dart';
|
||||||
import 'package:flutter_test/flutter_test.dart' show TestVSync;
|
import 'package:flutter_test/flutter_test.dart';
|
||||||
import '../flutter_test_alternative.dart';
|
|
||||||
|
|
||||||
import 'rendering_tester.dart';
|
import 'rendering_tester.dart';
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
// found in the LICENSE file.
|
// found in the LICENSE file.
|
||||||
|
|
||||||
import 'package:flutter/rendering.dart';
|
import 'package:flutter/rendering.dart';
|
||||||
import '../flutter_test_alternative.dart';
|
import 'package:flutter_test/flutter_test.dart';
|
||||||
|
|
||||||
import 'rendering_tester.dart';
|
import 'rendering_tester.dart';
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
// found in the LICENSE file.
|
// found in the LICENSE file.
|
||||||
|
|
||||||
import 'package:flutter/rendering.dart';
|
import 'package:flutter/rendering.dart';
|
||||||
import '../flutter_test_alternative.dart';
|
import 'package:flutter_test/flutter_test.dart';
|
||||||
|
|
||||||
import 'rendering_tester.dart';
|
import 'rendering_tester.dart';
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
// found in the LICENSE file.
|
// found in the LICENSE file.
|
||||||
|
|
||||||
import 'package:flutter/rendering.dart';
|
import 'package:flutter/rendering.dart';
|
||||||
import '../flutter_test_alternative.dart';
|
import 'package:flutter_test/flutter_test.dart';
|
||||||
|
|
||||||
import 'rendering_tester.dart';
|
import 'rendering_tester.dart';
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
// found in the LICENSE file.
|
// found in the LICENSE file.
|
||||||
|
|
||||||
import 'package:flutter/rendering.dart';
|
import 'package:flutter/rendering.dart';
|
||||||
import '../flutter_test_alternative.dart';
|
import 'package:flutter_test/flutter_test.dart';
|
||||||
|
|
||||||
import 'rendering_tester.dart';
|
import 'rendering_tester.dart';
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
// found in the LICENSE file.
|
// found in the LICENSE file.
|
||||||
|
|
||||||
import 'package:flutter/rendering.dart';
|
import 'package:flutter/rendering.dart';
|
||||||
import '../flutter_test_alternative.dart';
|
import 'package:flutter_test/flutter_test.dart';
|
||||||
|
|
||||||
import 'rendering_tester.dart';
|
import 'rendering_tester.dart';
|
||||||
|
|
||||||
|
@ -4,8 +4,7 @@
|
|||||||
|
|
||||||
import 'package:flutter/rendering.dart';
|
import 'package:flutter/rendering.dart';
|
||||||
import 'package:flutter/animation.dart';
|
import 'package:flutter/animation.dart';
|
||||||
|
import 'package:flutter_test/flutter_test.dart';
|
||||||
import '../flutter_test_alternative.dart';
|
|
||||||
|
|
||||||
import 'rendering_tester.dart';
|
import 'rendering_tester.dart';
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
// found in the LICENSE file.
|
// found in the LICENSE file.
|
||||||
|
|
||||||
import 'package:flutter/rendering.dart';
|
import 'package:flutter/rendering.dart';
|
||||||
import '../flutter_test_alternative.dart';
|
import 'package:flutter_test/flutter_test.dart';
|
||||||
|
|
||||||
import 'rendering_tester.dart';
|
import 'rendering_tester.dart';
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
// found in the LICENSE file.
|
// found in the LICENSE file.
|
||||||
|
|
||||||
import 'package:flutter/rendering.dart';
|
import 'package:flutter/rendering.dart';
|
||||||
import '../flutter_test_alternative.dart';
|
import 'package:flutter_test/flutter_test.dart';
|
||||||
|
|
||||||
import 'rendering_tester.dart';
|
import 'rendering_tester.dart';
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
import 'dart:math' as math;
|
import 'dart:math' as math;
|
||||||
|
|
||||||
import 'package:flutter/rendering.dart';
|
import 'package:flutter/rendering.dart';
|
||||||
import '../flutter_test_alternative.dart';
|
import 'package:flutter_test/flutter_test.dart';
|
||||||
|
|
||||||
import 'rendering_tester.dart';
|
import 'rendering_tester.dart';
|
||||||
|
|
||||||
|
@ -5,8 +5,7 @@
|
|||||||
import 'package:flutter/foundation.dart';
|
import 'package:flutter/foundation.dart';
|
||||||
import 'package:flutter/scheduler.dart';
|
import 'package:flutter/scheduler.dart';
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
|
import 'package:flutter_test/flutter_test.dart';
|
||||||
import '../flutter_test_alternative.dart';
|
|
||||||
|
|
||||||
import 'scheduler_tester.dart';
|
import 'scheduler_tester.dart';
|
||||||
|
|
||||||
|
@ -3,8 +3,7 @@
|
|||||||
// found in the LICENSE file.
|
// found in the LICENSE file.
|
||||||
|
|
||||||
import 'package:flutter/scheduler.dart';
|
import 'package:flutter/scheduler.dart';
|
||||||
|
import 'package:flutter_test/flutter_test.dart';
|
||||||
import '../flutter_test_alternative.dart';
|
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
test('Priority operators control test', () async {
|
test('Priority operators control test', () async {
|
||||||
|
@ -8,8 +8,8 @@ import 'dart:ui' show window;
|
|||||||
import 'package:flutter/foundation.dart';
|
import 'package:flutter/foundation.dart';
|
||||||
import 'package:flutter/scheduler.dart';
|
import 'package:flutter/scheduler.dart';
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
|
import 'package:flutter_test/flutter_test.dart';
|
||||||
|
|
||||||
import '../flutter_test_alternative.dart';
|
|
||||||
import 'scheduler_tester.dart';
|
import 'scheduler_tester.dart';
|
||||||
|
|
||||||
class TestSchedulerBinding extends BindingBase with SchedulerBinding, ServicesBinding {
|
class TestSchedulerBinding extends BindingBase with SchedulerBinding, ServicesBinding {
|
||||||
|
@ -3,8 +3,7 @@
|
|||||||
// found in the LICENSE file.
|
// found in the LICENSE file.
|
||||||
|
|
||||||
import 'package:flutter/semantics.dart';
|
import 'package:flutter/semantics.dart';
|
||||||
|
import 'package:flutter_test/flutter_test.dart';
|
||||||
import '../flutter_test_alternative.dart';
|
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
group(CustomSemanticsAction, () {
|
group(CustomSemanticsAction, () {
|
||||||
|
@ -6,9 +6,7 @@ import 'dart:ui' show TextDirection;
|
|||||||
|
|
||||||
import 'package:flutter/semantics.dart';
|
import 'package:flutter/semantics.dart';
|
||||||
import 'package:flutter/services.dart' show SystemChannels;
|
import 'package:flutter/services.dart' show SystemChannels;
|
||||||
import 'package:flutter_test/flutter_test.dart' show TestWidgetsFlutterBinding;
|
import 'package:flutter_test/flutter_test.dart';
|
||||||
|
|
||||||
import '../flutter_test_alternative.dart';
|
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
TestWidgetsFlutterBinding.ensureInitialized();
|
TestWidgetsFlutterBinding.ensureInitialized();
|
||||||
|
@ -10,7 +10,8 @@ import 'dart:typed_data';
|
|||||||
|
|
||||||
import 'package:flutter/foundation.dart' show WriteBuffer;
|
import 'package:flutter/foundation.dart' show WriteBuffer;
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
import '../flutter_test_alternative.dart';
|
import 'package:flutter_test/flutter_test.dart';
|
||||||
|
|
||||||
import 'message_codecs_testing.dart';
|
import 'message_codecs_testing.dart';
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
import 'dart:typed_data';
|
import 'dart:typed_data';
|
||||||
|
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
import '../flutter_test_alternative.dart';
|
import 'package:flutter_test/flutter_test.dart';
|
||||||
|
|
||||||
void checkEncoding<T>(MessageCodec<T> codec, T message, List<int> expectedBytes) {
|
void checkEncoding<T>(MessageCodec<T> codec, T message, List<int> expectedBytes) {
|
||||||
final ByteData encoded = codec.encodeMessage(message)!;
|
final ByteData encoded = codec.encodeMessage(message)!;
|
||||||
|
@ -7,7 +7,8 @@ import 'dart:typed_data';
|
|||||||
|
|
||||||
import 'package:flutter/foundation.dart';
|
import 'package:flutter/foundation.dart';
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
import '../flutter_test_alternative.dart';
|
import 'package:flutter_test/flutter_test.dart';
|
||||||
|
|
||||||
import 'message_codecs_testing.dart';
|
import 'message_codecs_testing.dart';
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
|
@ -3,9 +3,7 @@
|
|||||||
// found in the LICENSE file.
|
// found in the LICENSE file.
|
||||||
|
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
import 'package:flutter_test/flutter_test.dart' show TestWidgetsFlutterBinding;
|
import 'package:flutter_test/flutter_test.dart';
|
||||||
|
|
||||||
import '../flutter_test_alternative.dart';
|
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
TestWidgetsFlutterBinding.ensureInitialized();
|
TestWidgetsFlutterBinding.ensureInitialized();
|
||||||
|
@ -4,8 +4,7 @@
|
|||||||
|
|
||||||
import 'package:flutter/painting.dart';
|
import 'package:flutter/painting.dart';
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
import 'package:flutter_test/flutter_test.dart' show TestWidgetsFlutterBinding;
|
import 'package:flutter_test/flutter_test.dart';
|
||||||
import '../flutter_test_alternative.dart';
|
|
||||||
|
|
||||||
import 'fake_platform_views.dart';
|
import 'fake_platform_views.dart';
|
||||||
|
|
||||||
|
@ -7,8 +7,7 @@ import 'dart:convert' show utf8;
|
|||||||
import 'dart:convert' show jsonDecode;
|
import 'dart:convert' show jsonDecode;
|
||||||
|
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
import 'package:flutter_test/flutter_test.dart' show TestWidgetsFlutterBinding;
|
import 'package:flutter_test/flutter_test.dart';
|
||||||
import '../flutter_test_alternative.dart';
|
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
TestWidgetsFlutterBinding.ensureInitialized();
|
TestWidgetsFlutterBinding.ensureInitialized();
|
||||||
|
@ -32,7 +32,6 @@ To add a private test, add a manifest file of the form (assuming
|
|||||||
],
|
],
|
||||||
"pubspec": "my_private_test.pubspec.yaml",
|
"pubspec": "my_private_test.pubspec.yaml",
|
||||||
"deps": [
|
"deps": [
|
||||||
"test/flutter_test_alternative.dart",
|
|
||||||
"lib/src/subpackage/my_private_implementation.dart",
|
"lib/src/subpackage/my_private_implementation.dart",
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
@ -15,8 +15,7 @@ import 'dart:ui' as ui show Paint, Path, Canvas;
|
|||||||
|
|
||||||
import 'package:flutter/animation.dart';
|
import 'package:flutter/animation.dart';
|
||||||
import 'package:flutter/widgets.dart';
|
import 'package:flutter/widgets.dart';
|
||||||
|
import 'package:flutter_test/flutter_test.dart';
|
||||||
import 'test/flutter_test_alternative.dart';
|
|
||||||
|
|
||||||
part 'src/material/animated_icons/animated_icons.dart';
|
part 'src/material/animated_icons/animated_icons.dart';
|
||||||
part 'src/material/animated_icons/animated_icons_data.dart';
|
part 'src/material/animated_icons/animated_icons_data.dart';
|
||||||
|
@ -3,9 +3,7 @@
|
|||||||
"animated_icons_private_test.dart.tmpl"
|
"animated_icons_private_test.dart.tmpl"
|
||||||
],
|
],
|
||||||
"pubspec": "pubspec.yaml",
|
"pubspec": "pubspec.yaml",
|
||||||
"test_deps": [
|
"test_deps": [],
|
||||||
"test/flutter_test_alternative.dart"
|
|
||||||
],
|
|
||||||
"deps": [
|
"deps": [
|
||||||
"lib/src/material/animated_icons/animated_icons.dart",
|
"lib/src/material/animated_icons/animated_icons.dart",
|
||||||
"lib/src/material/animated_icons/animated_icons_data.dart",
|
"lib/src/material/animated_icons/animated_icons_data.dart",
|
||||||
|
@ -5,17 +5,13 @@
|
|||||||
import 'dart:io';
|
import 'dart:io';
|
||||||
|
|
||||||
import 'package:flutter_driver/src/common/error.dart';
|
import 'package:flutter_driver/src/common/error.dart';
|
||||||
import 'package:test_api/test_api.dart' hide TypeMatcher, isInstanceOf; // ignore: deprecated_member_use
|
import 'package:test_api/test_api.dart'; // ignore: deprecated_member_use
|
||||||
import 'package:test_api/test_api.dart' as test_package show TypeMatcher; // ignore: deprecated_member_use
|
|
||||||
|
|
||||||
export 'package:test_api/test_api.dart' hide TypeMatcher, isInstanceOf; // ignore: deprecated_member_use
|
export 'package:test_api/test_api.dart' hide isInstanceOf; // ignore: deprecated_member_use
|
||||||
export 'package:test_api/fake.dart'; // ignore: deprecated_member_use
|
export 'package:test_api/fake.dart'; // ignore: deprecated_member_use
|
||||||
|
|
||||||
// Defines a 'package:test' shim.
|
|
||||||
// TODO(ianh): Clean this up once https://github.com/dart-lang/matcher/issues/98 is fixed
|
|
||||||
|
|
||||||
/// A matcher that compares the type of the actual value to the type argument T.
|
/// A matcher that compares the type of the actual value to the type argument T.
|
||||||
test_package.TypeMatcher<T> isInstanceOf<T>() => isA<T>();
|
TypeMatcher<T> isInstanceOf<T>() => isA<T>();
|
||||||
|
|
||||||
void tryToDelete(Directory directory) {
|
void tryToDelete(Directory directory) {
|
||||||
// This should not be necessary, but it turns out that
|
// This should not be necessary, but it turns out that
|
||||||
|
@ -9,8 +9,7 @@ import 'package:flutter/widgets.dart';
|
|||||||
import 'package:flutter/rendering.dart';
|
import 'package:flutter/rendering.dart';
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
import 'package:test_api/src/frontend/async_matcher.dart'; // ignore: implementation_imports
|
import 'package:test_api/src/frontend/async_matcher.dart'; // ignore: implementation_imports
|
||||||
// ignore: deprecated_member_use
|
import 'package:test_api/test_api.dart'; // ignore: deprecated_member_use
|
||||||
import 'package:test_api/test_api.dart' hide TypeMatcher, isInstanceOf;
|
|
||||||
|
|
||||||
import 'binding.dart';
|
import 'binding.dart';
|
||||||
import 'finders.dart';
|
import 'finders.dart';
|
||||||
|
@ -7,8 +7,7 @@ import 'dart:ui' as ui;
|
|||||||
import 'package:flutter/rendering.dart';
|
import 'package:flutter/rendering.dart';
|
||||||
import 'package:flutter/widgets.dart';
|
import 'package:flutter/widgets.dart';
|
||||||
import 'package:test_api/src/frontend/async_matcher.dart'; // ignore: implementation_imports
|
import 'package:test_api/src/frontend/async_matcher.dart'; // ignore: implementation_imports
|
||||||
// ignore: deprecated_member_use
|
import 'package:test_api/test_api.dart'; // ignore: deprecated_member_use
|
||||||
import 'package:test_api/test_api.dart' hide TypeMatcher, isInstanceOf;
|
|
||||||
|
|
||||||
import 'binding.dart';
|
import 'binding.dart';
|
||||||
import 'finders.dart';
|
import 'finders.dart';
|
||||||
|
@ -7,10 +7,9 @@ import 'dart:typed_data';
|
|||||||
import 'dart:ui' as ui;
|
import 'dart:ui' as ui;
|
||||||
import 'dart:ui';
|
import 'dart:ui';
|
||||||
|
|
||||||
|
// This import is discouraged in general, but we need it to implement flutter_test.
|
||||||
// ignore: deprecated_member_use
|
// ignore: deprecated_member_use
|
||||||
import 'package:test_api/test_api.dart' hide TypeMatcher, isInstanceOf;
|
import 'package:test_api/test_api.dart';
|
||||||
// ignore: deprecated_member_use
|
|
||||||
import 'package:test_api/test_api.dart' as test_package show TypeMatcher;
|
|
||||||
import 'package:test_api/src/frontend/async_matcher.dart'; // ignore: implementation_imports
|
import 'package:test_api/src/frontend/async_matcher.dart'; // ignore: implementation_imports
|
||||||
|
|
||||||
import 'package:flutter/foundation.dart';
|
import 'package:flutter/foundation.dart';
|
||||||
@ -196,7 +195,7 @@ final Matcher throwsAssertionError = throwsA(isAssertionError);
|
|||||||
///
|
///
|
||||||
/// * [throwsFlutterError], to test if a function throws a [FlutterError].
|
/// * [throwsFlutterError], to test if a function throws a [FlutterError].
|
||||||
/// * [isAssertionError], to test if any object is any kind of [AssertionError].
|
/// * [isAssertionError], to test if any object is any kind of [AssertionError].
|
||||||
final test_package.TypeMatcher<FlutterError> isFlutterError = isA<FlutterError>();
|
final TypeMatcher<FlutterError> isFlutterError = isA<FlutterError>();
|
||||||
|
|
||||||
/// A matcher for [AssertionError].
|
/// A matcher for [AssertionError].
|
||||||
///
|
///
|
||||||
@ -206,11 +205,12 @@ final test_package.TypeMatcher<FlutterError> isFlutterError = isA<FlutterError>(
|
|||||||
///
|
///
|
||||||
/// * [throwsAssertionError], to test if a function throws any [AssertionError].
|
/// * [throwsAssertionError], to test if a function throws any [AssertionError].
|
||||||
/// * [isFlutterError], to test if any object is a [FlutterError].
|
/// * [isFlutterError], to test if any object is a [FlutterError].
|
||||||
final test_package.TypeMatcher<AssertionError> isAssertionError = isA<AssertionError>();
|
final TypeMatcher<AssertionError> isAssertionError = isA<AssertionError>();
|
||||||
|
|
||||||
/// A matcher that compares the type of the actual value to the type argument T.
|
/// A matcher that compares the type of the actual value to the type argument T.
|
||||||
// TODO(ianh): Remove this once https://github.com/dart-lang/matcher/issues/98 is fixed
|
///
|
||||||
test_package.TypeMatcher<T> isInstanceOf<T>() => isA<T>();
|
/// This is identical to [isA] and is included for backwards compatibility.
|
||||||
|
TypeMatcher<T> isInstanceOf<T>() => isA<T>();
|
||||||
|
|
||||||
/// Asserts that two [double]s are equal, within some tolerated error.
|
/// Asserts that two [double]s are equal, within some tolerated error.
|
||||||
///
|
///
|
||||||
|
@ -11,6 +11,7 @@ import 'package:flutter/scheduler.dart';
|
|||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
import 'package:meta/meta.dart';
|
import 'package:meta/meta.dart';
|
||||||
|
|
||||||
|
// The test_api package is not for general use... it's literally for our use.
|
||||||
// ignore: deprecated_member_use
|
// ignore: deprecated_member_use
|
||||||
import 'package:test_api/test_api.dart' as test_package;
|
import 'package:test_api/test_api.dart' as test_package;
|
||||||
|
|
||||||
@ -25,13 +26,26 @@ import 'test_compat.dart';
|
|||||||
import 'test_pointer.dart';
|
import 'test_pointer.dart';
|
||||||
import 'test_text_input.dart';
|
import 'test_text_input.dart';
|
||||||
|
|
||||||
/// Keep users from needing multiple imports to test semantics.
|
// Keep users from needing multiple imports to test semantics.
|
||||||
export 'package:flutter/rendering.dart' show SemanticsHandle;
|
export 'package:flutter/rendering.dart' show SemanticsHandle;
|
||||||
|
|
||||||
|
// We re-export the test package minus some features that we reimplement.
|
||||||
|
//
|
||||||
|
// Specifically:
|
||||||
|
//
|
||||||
|
// - test, group, setUpAll, tearDownAll, setUp, tearDown, and expect would
|
||||||
|
// conflict with our own implementations in test_compat.dart. This handles
|
||||||
|
// setting up a declarer when one is not defined, which can happen when a
|
||||||
|
// test is executed via `flutter run`.
|
||||||
|
//
|
||||||
|
// - expect is reimplemented below, to catch incorrect async usage.
|
||||||
|
//
|
||||||
|
// - isInstanceOf is reimplemented in matchers.dart because we don't want to
|
||||||
|
// mark it as deprecated (ours is just a method, not a class).
|
||||||
|
//
|
||||||
|
// The test_api package has a deprecation warning to discourage direct use but
|
||||||
|
// that doesn't apply here.
|
||||||
// ignore: deprecated_member_use
|
// ignore: deprecated_member_use
|
||||||
/// Hide these imports so that they do not conflict with our own implementations in
|
|
||||||
/// test_compat.dart. This handles setting up a declarer when one is not defined, which
|
|
||||||
/// can happen when a test is executed via flutter_run.
|
|
||||||
export 'package:test_api/test_api.dart' hide
|
export 'package:test_api/test_api.dart' hide
|
||||||
test,
|
test,
|
||||||
group,
|
group,
|
||||||
@ -39,9 +53,8 @@ export 'package:test_api/test_api.dart' hide
|
|||||||
tearDownAll,
|
tearDownAll,
|
||||||
setUp,
|
setUp,
|
||||||
tearDown,
|
tearDown,
|
||||||
expect, // we have our own wrapper below
|
expect,
|
||||||
TypeMatcher, // matcher's TypeMatcher conflicts with the one in the Flutter framework
|
isInstanceOf;
|
||||||
isInstanceOf; // we have our own wrapper in matchers.dart
|
|
||||||
|
|
||||||
/// Signature for callback to [testWidgets] and [benchmarkWidgets].
|
/// Signature for callback to [testWidgets] and [benchmarkWidgets].
|
||||||
typedef WidgetTesterCallback = Future<void> Function(WidgetTester widgetTester);
|
typedef WidgetTesterCallback = Future<void> Function(WidgetTester widgetTester);
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user