Skip to content

Instantly share code, notes, and snippets.

Avatar

Anthony Bullard gamebox

  • ServiceNow
  • Chicago. Il
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';
@gamebox
gamebox / string.gleam
Created Feb 28, 2020
Documentation of stdlib functions, with forward looking API
View string.gleam
/// A built-in representation for efficient string manipulation. String literals
/// are enclosed in `"double quotes"`.
///
import gleam/iodata
import gleam/list
import gleam/order
View hyperapp-html-test.js
const h = (type) => (props, children = [], node, tag) => ({
type,
props,
children: Array.isArray(children) ? children : [children],
node,
key: props.key,
tag,
})
export default {
You can’t perform that action at this time.