Skip to content

Instantly share code, notes, and snippets.

Anthony Bullard gamebox

Block or report user

Report or block gamebox

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:a6048c187538044a5a8d210e1c623619
src/libponyc/pass/expr.c:640: pass_expr: Assertion `errors_get_count(options->check.errors) > 0` failed.
Backtrace:
This is an optimised version of ponyc: the backtrace may be imprecise or incorrect.
Use a debug version to get more meaningful information.
ponyc(ponyint_assert_fail+0x90) [0x732d90]
ponyc(pass_expr+0x11a) [0x67d79a]
ponyc(ast_visit+0x1c8) [0x6762e8]
ponyc(ast_visit+0x170) [0x676290]
ponyc(ast_visit+0x170) [0x676290]
@gamebox
gamebox / test_asset_bundle.dart
Created May 1, 2019
A possible implementation of TestAssetBundle for Flutter tests
View test_asset_bundle.dart
class TestAssetBundle extends CachingAssetBundle {
TestAssetBundle(Map<String, List<String>> assets) : _assets = assets {
for (String assetList in assets.keys) {
for (String asset in assets[assetList]) {
_assetMap[asset] = bytesForFile(asset);
}
}
}
final Map<String, ByteData> _assetMap = <String, ByteData>{};
View using_test_asset_bundle.dart
final AssetBundle bundle = TestAssetBundle(<String, List<String>>{
'assets/dart-logo.png': <String>['assets/dart-logo.png'],
});
View fake_async_zone_example.dart
import 'package:flutter_test/flutter_test.dart';
void main() {
Future<int> outerF;
final Duration delay = Duration(seconds: 20);
group('Async Tests - Fake Async', () {
setUpAll(() async {
outerF = Future<int>.delayed(delay, () => 42);
final Stopwatch waiting = Stopwatch()..start();
View real_async_in_tests.dart
import 'dart:async';
import 'package:flutter_test/flutter_test.dart';
void main() async {
LiveTestWidgetsFlutterBinding();
Future outsideFuture;
setUp(() {
outsideFuture = Future.microtask(() {
return 'outside';
You can’t perform that action at this time.