Add a toString to Simulation (#7364)

Also, make hasOneLineDescription more discerning.
Also, add a test for hasOneLineDescription.
Also, add a test for GravitySimulation, to test the toString.
This commit is contained in:
Ian Hickson
2017-01-05 16:33:40 -08:00
committed by GitHub
parent 11d1d54c8a
commit 79c8e5c7c7
6 changed files with 29 additions and 4 deletions

View File

@@ -5,6 +5,14 @@
import 'package:flutter_test/flutter_test.dart';
void main() {
test('hasOneLineDescription', () {
expect('Hello', hasOneLineDescription);
expect('Hello\nHello', isNot(hasOneLineDescription));
expect(' Hello', isNot(hasOneLineDescription));
expect('Hello ', isNot(hasOneLineDescription));
expect(new Object(), isNot(hasOneLineDescription));
});
test('moreOrLessEquals', () {
expect(0.0, moreOrLessEquals(1e-11));
expect(1e-11, moreOrLessEquals(0.0));