Issue 1:
Steps to Reproduce

Ubuntu 16.04 Flutter Beta 2.0.0-dev27

The following unit test:

import 'dart:collection';

import 'package:flutter_test/flutter_test.dart';

class MyList1 extends Object with ListMixin<Map<String, dynamic>> {
final List _list;

MyList1.from(this._list);

@override
Map<String, dynamic> operator [](int index) {
Map value = _list[index];
return value.cast<String, dynamic>();
}

@override
void operator []=(int index, Map<String, dynamic> value) {
throw "read-only";
}

@override
set length(int newLength) {
throw "read-only";
}

@override
int get length => _list.length;
}

class MyList2 extends ListBase<Map<String, dynamic>> {
final List _list;

MyList2.from(this._list);

@override
Map<String, dynamic> operator [](int index) {
Map value = _list[index];
return value.cast<String, dynamic>();
}

@override
void operator []=(int index, Map<String, dynamic> value) {
throw "read-only";
}

@override
set length(int newLength) {
throw "read-only";
}

@override
int get length => _list.length;
}

main() {
group("mixin", () {
// This currently fails...
test('ListMixin', () {
var raw = [
{'col': 1}
];
var rows = new MyList1.from(raw);
expect(rows, raw);
}); //, skip: true);

test('ListBase', () {
var raw = [
{'col': 1}
];
var rows = new MyList2.from(raw);
expect(rows, raw);
});
});
}

works when using

flutter test

but fails for ListMixin (not ListBase) using

flutter test --preview-dart-2

00:04 +0 -1: mixin ListMixin [E]
NoSuchMethodError: The method 'toList' was called on null.
Receiver: null
Tried calling: toList()
dart:core Object.noSuchMethod
package:matcher/src/pretty_print.dart 37:36 prettyPrint._prettyPrint
package:matcher/src/pretty_print.dart 116:22 prettyPrint
package:matcher/src/description.dart 44:11 StringDescription.addDescriptionOf
package:test expect
package:flutter_test/src/widget_tester.dart 141:16 expect
test/list_mixin_test.dart 63:7 main.<fn>.<fn>

Basically using extends ListBase and extends Object with ListMixin has a different behavior (on dart2 only) and I cannot figure out why...

Flutter Doctor

Paste the output of running flutter doctor -v here.

[✓] Flutter (on Linux, locale en_US.UTF-8, channel beta)
• Flutter version 0.1.4 at /media/ssd/dev_tool/flutter
• Framework revision f914e701c5 (9 days ago), 2018-02-19 21:12:17 +0000
• Engine revision 13cf22c284
• Dart version 2.0.0-dev.27.0-flutter-0d5cf900b0

[✓] Android toolchain - develop for Android devices (Android SDK 27.0.2)
• Android SDK at /opt/apps/android-sdk-linux
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-27, build-tools 27.0.2
• ANDROID_HOME = /opt/apps/android-sdk-linux
• Java binary at: /opt/app/android-studio-3/jre/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-915-b01)

[✓] Android Studio (version 3.0)
• Android Studio at /opt/app/android-studio-3
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-915-b01)

[✓] Android Studio (version 2.3)
• Android Studio at /opt/apps2/android-studio
• Java version OpenJDK Runtime Environment (build 1.8.0_112-release-b06)

[✓] IntelliJ IDEA Community Edition (version 2017.2)
• Flutter plugin version 19.1
• Dart plugin version 172.4343.25

[!] IntelliJ IDEA Ultimate Edition (version 2016.2)
✗ Flutter plugin not installed; this adds Flutter specific functionality.
✗ Dart plugin not installed; this adds Dart specific functionality.
• For information about installing plugins, see
https://flutter.io/intellij-setup/#installing-the-plugins
✗ This install is older than the minimum recommended version of 2017.1.0.

[✓] IntelliJ IDEA Community Edition (version 2017.3)
• Flutter plugin version 22.1.2
• Dart plugin version 173.4548.30

[!] IntelliJ IDEA Community Edition (version 2016.3)
✗ Flutter plugin not installed; this adds Flutter specific functionality.
• Dart plugin version 163.13137
• For information about installing plugins, see
https://flutter.io/intellij-setup/#installing-the-plugins
✗ This install is older than the minimum recommended version of 2017.1.0.

[!] IntelliJ IDEA Community Edition (version 2016.2)
✗ Flutter plugin not installed; this adds Flutter specific functionality.
• Dart plugin version 162.2485
• For information about installing plugins, see
https://flutter.io/intellij-setup/#installing-the-plugins
✗ This install is older than the minimum recommended version of 2017.1.0.

[!] VS Code (version 1.20.1)
• VS Code at /usr/share/code
• Dart Code extension not installed; install from
https://marketplace.visualstudio.com/items?itemName=Dart-Code.dart-code

[✓] Connected devices

Issue 2:
Steps to Reproduce

Checkout flutter/plugins

cd flutter/plugins/packages/path_provider

flutter test --preview-dart-2

There is just one test file with four short tests, but it doesn't seem to finish loading them.

Runs fine without --preview-dart-2.

Logs

$ flutter test -v --preview-dart-2
[ +26 ms] [/Users/mravn/github/flutter/] git rev-parse --abbrev-ref --symbolic @{u}
[ +30 ms] Exit code 0 from: git rev-parse --abbrev-ref --symbolic @{u}
[ ] upstream/master
[ ] [/Users/mravn/github/flutter/] git rev-parse --abbrev-ref HEAD
[ +6 ms] Exit code 0 from: git rev-parse --abbrev-ref HEAD
[ ] master
[ ] [/Users/mravn/github/flutter/] git ls-remote --get-url upstream
[ +6 ms] Exit code 0 from: git ls-remote --get-url upstream
[ ] git@github.com:flutter/flutter.git
[ ] [/Users/mravn/github/flutter/] git log -n 1 --pretty=format:%H
[ +9 ms] Exit code 0 from: git log -n 1 --pretty=format:%H
[ ] 29d59e3cb7dcd74a8e6ecb57c5c2b11fa106cba0
[ ] [/Users/mravn/github/flutter/] git log -n 1 --pretty=format:%ar
[ +7 ms] Exit code 0 from: git log -n 1 --pretty=format:%ar
[ ] 59 minutes ago
[ ] [/Users/mravn/github/flutter/] git describe --match v*.*.* --first-parent --long --tags
[ +18 ms] Exit code 0 from: git describe --match v*.*.* --first-parent --long --tags
[ ] v0.1.7-2-g29d59e3cb
[ +140 ms] switching to directory LocalDirectory: 'test' to run tests
[ +1 ms] running test package with arguments: [--, /Users/mravn/github/plugins/packages/path_provider/test/path_provider_test.dart]
00:00 +0: loading /Users/mravn/github/plugins/packages/path_provider/test/path_provider_test.dart [ +160 ms] test 0: starting test /Users/mravn/github/plugins/packages/path_provider/test/path_provider_test.dart
[ +14 ms] test 0: starting shell process in preview-dart-2 mode
[ +2 ms] /Users/mravn/github/flutter/bin/cache/dart-sdk/bin/dart /Users/mravn/github/flutter/bin/cache/artifacts/engine/darwin-x64/frontend_server.dart.snapshot --sdk-root /Users/mravn/github/flutter/bin/cache/artifacts/engine/common/flutter_patched_sdk/ --strong --no-link-platform --incremental --packages /Users/mravn/github/plugins/packages/path_provider/.packages /var/folders/d7/wjkm2mlx10j1389dljf91sg400cjvd/T/dart_test_listenerN7qzTN/listener.dart
00:03 +0: loading /Users/mravn/github/plugins/packages/path_provider/test/path_provider_test.dart [+3513 ms] /Users/mravn/github/flutter/bin/cache/artifacts/engine/darwin-x64/flutter_tester --disable-observatory --flutter-assets-dir=/var/folders/d7/wjkm2mlx10j1389dljf91sg400cjvd/T/flutter_bundle_directoryFKjvPb --enable-checked-mode --enable-dart-profiling --non-interactive --use-test-fonts --packages=/Users/mravn/github/plugins/packages/path_provider/.packages /var/folders/d7/wjkm2mlx10j1389dljf91sg400cjvd/T/dart_test_listenerN7qzTN/listener.dart.dill
[ +10 ms] test 0: awaiting initial result for pid 14958
00:04 +0: loading /Users/mravn/github/plugins/packages/path_provider/test/path_provider_test.dart [ +656 ms] test 0: process with pid 14958 connected to test harness
[ ] test 0: awaiting test result for pid 14958
02:09 +0: loading /Users/mravn/github/plugins/packages/path_provider/test/path_provider_test.dart

Flutter Doctor

[✓] Flutter (Channel master, v0.1.8-pre.2, on Mac OS X 10.13.3 17D102, locale en-US)
• Flutter version 0.1.8-pre.2 at /Users/mravn/github/flutter
• Framework revision 29d59e3cb7 (61 minutes ago), 2018-02-27 13:15:32 -0800
• Engine revision ead227f118
• Dart version 2.0.0-dev.28.0.flutter-0b4f01f759

[✓] Android toolchain - develop for Android devices (Android SDK 27.0.3)
• Android SDK at /Users/mravn/Library/Android/sdk
• Android NDK at /Users/mravn/Library/Android/sdk/ndk-bundle
• Platform android-27, build-tools 27.0.3
• Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-915-b08)

[✓] iOS toolchain - develop for iOS devices (Xcode 9.2)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 9.2, Build version 9C40b
• ios-deploy 1.9.2
• CocoaPods version 1.2.1

[✓] Android Studio (version 3.0)
• Android Studio at /Applications/Android Studio.app/Contents
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-915-b08)

[✓] IntelliJ IDEA Community Edition (version 2017.3.4)
• Flutter plugin version 21.2.3
• Dart plugin version 173.4548.30

[✓] Connected devices (1 available)
• Nexus 5X • 00bff34682e4b2ab • android-arm64 • Android 8.1.0 (API 27)

• No issues found!