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:
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user