Files
flame/packages/flame_test/test/flame_async_test.dart
Lukas Klingsbo 49252f8ef2 feat: Add more lint rules (#1703)
Adds some more lint rules and fixes the issues those rules pointed out.
2022-06-06 19:23:25 +00:00

36 lines
926 B
Dart

import 'package:flame/components.dart';
import 'package:flame_test/flame_test.dart';
import 'package:flutter_test/flutter_test.dart';
void main() {
var instructions = 0;
tearDown(() {
assert(instructions == 9, 'There should be exactly 9 instructions');
});
flameGame.test(
'runs all the async tests',
(game) async {
await game.ensureAdd(Component());
instructions++;
await game.ensureAdd(Component());
instructions++;
await game.ensureAdd(Component());
instructions++;
await game.ensureAdd(Component());
instructions++;
await game.ensureAdd(Component());
instructions++;
await game.ensureAdd(Component());
instructions++;
await game.ensureAdd(Component());
instructions++;
await game.ensureAdd(Component());
instructions++;
expect(game.children.length, equals(8));
instructions++;
},
);
}