forked from lpongetti/flutter_map_marker_cluster
-
Notifications
You must be signed in to change notification settings - Fork 5
/
quick_hull_test.dart
executable file
·54 lines (51 loc) · 1.23 KB
/
quick_hull_test.dart
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
import 'package:flutter_map_marker_cluster/src/core/quick_hull.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:latlong2/latlong.dart';
void main() {
test('creates a hull', () {
expect(
QuickHull.getConvexHull(
[
const LatLng(0, 0),
const LatLng(10, 0),
const LatLng(10, 10),
const LatLng(0, 10),
const LatLng(5, 5),
],
),
[
const LatLng(0, 10),
const LatLng(10, 10),
const LatLng(10, 0),
const LatLng(0, 0),
]);
});
test('creates a hull for vertically-aligned objects', () {
expect(
QuickHull.getConvexHull(
[
const LatLng(0, 0),
const LatLng(5, 0),
const LatLng(10, 0),
],
),
[
const LatLng(0, 0),
const LatLng(10, 0),
]);
});
test('creates a hull for horizontally-aligned objects', () {
expect(
QuickHull.getConvexHull(
[
const LatLng(0, 0),
const LatLng(0, 5),
const LatLng(0, 10),
],
),
[
const LatLng(0, 0),
const LatLng(0, 10),
]);
});
}