Skip to content

Commit

Permalink
Fix ArgumentError text
Browse files Browse the repository at this point in the history
  • Loading branch information
nielsenko committed Aug 30, 2023
1 parent 8cea096 commit b9de113
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion common/lib/src/realm_types.dart
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ typedef GeoRing = List<GeoPoint>;

extension on GeoRing {
void validate() {
if (first != last) throw ArgumentError('Vertices must for a ring (first != last)');
if (first != last) throw ArgumentError('Vertices must form a ring (first != last)');
if (length < 4) throw ArgumentError('Ring must have at least 3 different vertices');
}
}
Expand Down
4 changes: 2 additions & 2 deletions test/geospatial_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -212,8 +212,8 @@ Future<void> main([List<String>? args]) async {
test('GeoPolygon invalid args throws', () {
expect(() => GeoPolygon(ring([(1, 1)])), throws<ArgumentError>('Ring must have at least 3 different'));
expect(() => GeoPolygon(ring([(1, 1), (2, 2)])), throws<ArgumentError>('Ring must have at least 3 different'));
expect(() => GeoPolygon(ring([(1, 1), (2, 2), (3, 3)], close: false)), throws<ArgumentError>('first != last'));
expect(() => GeoPolygon(ring([(1, 1), (2, 2), (3, 3), (4, 4)], close: false)), throws<ArgumentError>('first != last'));
expect(() => GeoPolygon(ring([(1, 1), (2, 2), (3, 3)], close: false)), throws<ArgumentError>('Vertices must form a ring (first != last)'));
expect(() => GeoPolygon(ring([(1, 1), (2, 2), (3, 3), (4, 4)], close: false)), throws<ArgumentError>('Vertices must form a ring (first != last)'));
});

test('GeoPoint.operator==', () {
Expand Down

0 comments on commit b9de113

Please sign in to comment.