Skip to content

Commit d17a929

Browse files
committed
Fix the tests
1 parent b43f18e commit d17a929

File tree

1 file changed

+36
-36
lines changed

1 file changed

+36
-36
lines changed

src/test.rs

Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -102,23 +102,23 @@ fn basic_write() {
102102
])));
103103
db.add(&mut wtxn, 0, &point).unwrap();
104104

105-
insta::assert_snapshot!(db.snap(&wtxn), @r"
106-
# Version: 0.3.0
105+
insta::assert_snapshot!(db.snap(&wtxn), @r###"
106+
# Version: 0.3.1
107107
# Items
108108
0: Point(Zoint { lng: 0.0, lat: 0.0 })
109109
# Cells
110110
# Belly Cells
111-
");
111+
"###);
112112

113113
db.build(&mut wtxn, &|| false, &NoProgress).unwrap();
114-
insta::assert_snapshot!(db.snap(&wtxn), @r"
115-
# Version: 0.3.0
114+
insta::assert_snapshot!(db.snap(&wtxn), @r###"
115+
# Version: 0.3.1
116116
# Items
117117
0: Point(Zoint { lng: 0.0, lat: 0.0 })
118118
# Cells
119119
Cell { res: 0, center: (2.3009, -5.2454) }: RoaringBitmap<[0]>
120120
# Belly Cells
121-
");
121+
"###);
122122

123123
let point = GeoJson::from(geojson::Geometry::new(geojson::Value::Point(vec![
124124
0.0, 1.0,
@@ -129,21 +129,21 @@ fn basic_write() {
129129
])));
130130
db.add(&mut wtxn, 2, &point).unwrap();
131131

132-
insta::assert_snapshot!(db.snap(&wtxn), @r"
133-
# Version: 0.3.0
132+
insta::assert_snapshot!(db.snap(&wtxn), @r###"
133+
# Version: 0.3.1
134134
# Items
135135
0: Point(Zoint { lng: 0.0, lat: 0.0 })
136136
1: Point(Zoint { lng: 0.0, lat: 1.0 })
137137
2: Point(Zoint { lng: 0.0, lat: 2.0 })
138138
# Cells
139139
Cell { res: 0, center: (2.3009, -5.2454) }: RoaringBitmap<[0]>
140140
# Belly Cells
141-
");
141+
"###);
142142

143143
db.build(&mut wtxn, &|| false, &NoProgress).unwrap();
144144

145-
insta::assert_snapshot!(db.snap(&wtxn), @r"
146-
# Version: 0.3.0
145+
insta::assert_snapshot!(db.snap(&wtxn), @r###"
146+
# Version: 0.3.1
147147
# Items
148148
0: Point(Zoint { lng: 0.0, lat: 0.0 })
149149
1: Point(Zoint { lng: 0.0, lat: 1.0 })
@@ -155,16 +155,16 @@ fn basic_write() {
155155
Cell { res: 2, center: (-0.4597, 0.5342) }: RoaringBitmap<[0]>
156156
# Belly Cells
157157
Cell { res: 1, center: (2.0979, 0.4995) }: RoaringBitmap<[]>
158-
");
158+
"###);
159159

160160
let point = GeoJson::from(geojson::Geometry::new(geojson::Value::Point(vec![
161161
0.0, 3.0,
162162
])));
163163
db.add(&mut wtxn, 3, &point).unwrap();
164164
db.build(&mut wtxn, &|| false, &NoProgress).unwrap();
165165

166-
insta::assert_snapshot!(db.snap(&wtxn), @r"
167-
# Version: 0.3.0
166+
insta::assert_snapshot!(db.snap(&wtxn), @r###"
167+
# Version: 0.3.1
168168
# Items
169169
0: Point(Zoint { lng: 0.0, lat: 0.0 })
170170
1: Point(Zoint { lng: 0.0, lat: 1.0 })
@@ -180,7 +180,7 @@ fn basic_write() {
180180
Cell { res: 3, center: (2.9436, 0.1993) }: RoaringBitmap<[3]>
181181
# Belly Cells
182182
Cell { res: 2, center: (2.0979, 0.4995) }: RoaringBitmap<[]>
183-
");
183+
"###);
184184
}
185185

186186
#[test]
@@ -200,8 +200,8 @@ fn bug_write_points_create_cells_too_deep() {
200200
])));
201201
db.add(&mut wtxn, 1, &point).unwrap();
202202
db.build(&mut wtxn, &|| false, &NoProgress).unwrap();
203-
insta::assert_snapshot!(db.snap(&wtxn), @r"
204-
# Version: 0.3.0
203+
insta::assert_snapshot!(db.snap(&wtxn), @r###"
204+
# Version: 0.3.1
205205
# Items
206206
0: Point(Zoint { lng: -11.460678226504395, lat: 48.213563161838714 })
207207
1: Point(Zoint { lng: -1.520397001416467, lat: 54.586501531522245 })
@@ -210,7 +210,7 @@ fn bug_write_points_create_cells_too_deep() {
210210
Cell { res: 1, center: (45.2992, -14.2485) }: RoaringBitmap<[0]>
211211
Cell { res: 1, center: (53.6528, 0.2143) }: RoaringBitmap<[1]>
212212
# Belly Cells
213-
");
213+
"###);
214214
}
215215

216216
#[test]
@@ -231,8 +231,8 @@ fn bug_write_points_create_unrelated_cells() {
231231
])));
232232
db.add(&mut wtxn, 1, &point).unwrap();
233233
db.build(&mut wtxn, &|| false, &NoProgress).unwrap();
234-
insta::assert_snapshot!(db.snap(&wtxn), @r"
235-
# Version: 0.3.0
234+
insta::assert_snapshot!(db.snap(&wtxn), @r###"
235+
# Version: 0.3.1
236236
# Items
237237
0: Point(Zoint { lng: 6.0197316417968105, lat: 49.63676497357687 })
238238
1: Point(Zoint { lng: 7.435508967561083, lat: 43.76438119061842 })
@@ -241,7 +241,7 @@ fn bug_write_points_create_unrelated_cells() {
241241
Cell { res: 1, center: (47.9847, 6.9179) }: RoaringBitmap<[0]>
242242
Cell { res: 1, center: (40.9713, 2.8207) }: RoaringBitmap<[1]>
243243
# Belly Cells
244-
");
244+
"###);
245245
}
246246

247247
#[test]
@@ -270,14 +270,14 @@ fn query_points_on_transmeridian_cell() {
270270

271271
db.add(&mut wtxn, 0, &lake).unwrap();
272272
db.build(&mut wtxn, &|| false, &NoProgress).unwrap();
273-
insta::assert_snapshot!(db.snap(&wtxn), @r"
274-
# Version: 0.3.0
273+
insta::assert_snapshot!(db.snap(&wtxn), @r###"
274+
# Version: 0.3.1
275275
# Items
276276
0: Point(Zoint { lng: -172.36201, lat: 64.42921 })
277277
# Cells
278278
Cell { res: 0, center: (64.4181, -158.9175) }: RoaringBitmap<[0]>
279279
# Belly Cells
280-
");
280+
"###);
281281

282282
let ret = db.in_shape(&wtxn, &contains_lake).unwrap();
283283
insta::assert_debug_snapshot!(ret, @"RoaringBitmap<[0]>");
@@ -288,8 +288,8 @@ fn query_points_on_transmeridian_cell() {
288288

289289
db.add(&mut wtxn, 1, &airport).unwrap();
290290
db.build(&mut wtxn, &|| false, &NoProgress).unwrap();
291-
insta::assert_snapshot!(db.snap(&wtxn), @r"
292-
# Version: 0.3.0
291+
insta::assert_snapshot!(db.snap(&wtxn), @r###"
292+
# Version: 0.3.1
293293
# Items
294294
0: Point(Zoint { lng: -172.36201, lat: 64.42921 })
295295
1: Point(Zoint { lng: -173.23841, lat: 64.37949 })
@@ -300,7 +300,7 @@ fn query_points_on_transmeridian_cell() {
300300
Cell { res: 2, center: (64.6946, -176.8313) }: RoaringBitmap<[1]>
301301
# Belly Cells
302302
Cell { res: 1, center: (67.6370, -175.8874) }: RoaringBitmap<[]>
303-
");
303+
"###);
304304

305305
let ret = db.in_shape(&wtxn, &contains_lake).unwrap();
306306
insta::assert_debug_snapshot!(ret, @"RoaringBitmap<[0]>");
@@ -333,8 +333,8 @@ fn store_all_kind_of_collection() {
333333
db.add(&mut wtxn, 2, &feature_collection.into()).unwrap();
334334

335335
db.build(&mut wtxn, &|| false, &NoProgress).unwrap();
336-
insta::assert_snapshot!(db.snap(&wtxn), @r"
337-
# Version: 0.3.0
336+
insta::assert_snapshot!(db.snap(&wtxn), @r###"
337+
# Version: 0.3.1
338338
# Items
339339
0: Collection(Zollection { bounding_box: BoundingBox { bottom_left: Coord { x: 6.0197316417968105, y: 49.63676497357687 }, top_right: Coord { x: 6.0197316417968105, y: 49.63676497357687 } }, points: ZultiPoints { bounding_box: BoundingBox { bottom_left: Coord { x: 6.0197316417968105, y: 49.63676497357687 }, top_right: Coord { x: 6.0197316417968105, y: 49.63676497357687 } }, points: [Zoint { lng: 6.0197316417968105, lat: 49.63676497357687 }] }, lines: ZultiLines { bounding_box: BoundingBox { bottom_left: Coord { x: 0.0, y: 0.0 }, top_right: Coord { x: 0.0, y: 0.0 } }, zines: [] }, polygons: ZultiPolygons { bounding_box: BoundingBox { bottom_left: Coord { x: 0.0, y: 0.0 }, top_right: Coord { x: 0.0, y: 0.0 } }, zolygons: [] } })
340340
1: Collection(Zollection { bounding_box: BoundingBox { bottom_left: Coord { x: 6.0197316417968105, y: 49.63676497357687 }, top_right: Coord { x: 6.0197316417968105, y: 49.63676497357687 } }, points: ZultiPoints { bounding_box: BoundingBox { bottom_left: Coord { x: 6.0197316417968105, y: 49.63676497357687 }, top_right: Coord { x: 6.0197316417968105, y: 49.63676497357687 } }, points: [Zoint { lng: 6.0197316417968105, lat: 49.63676497357687 }] }, lines: ZultiLines { bounding_box: BoundingBox { bottom_left: Coord { x: 0.0, y: 0.0 }, top_right: Coord { x: 0.0, y: 0.0 } }, zines: [] }, polygons: ZultiPolygons { bounding_box: BoundingBox { bottom_left: Coord { x: 0.0, y: 0.0 }, top_right: Coord { x: 0.0, y: 0.0 } }, zolygons: [] } })
@@ -372,7 +372,7 @@ fn store_all_kind_of_collection() {
372372
Cell { res: 13, center: (49.6368, 6.0197) }: RoaringBitmap<[]>
373373
Cell { res: 14, center: (49.6368, 6.0197) }: RoaringBitmap<[]>
374374
Cell { res: 15, center: (49.6368, 6.0197) }: RoaringBitmap<[]>
375-
");
375+
"###);
376376
let contains =
377377
polygon![(x: 6.0, y: 49.0), (x: 7.0, y: 49.0), (x: 7.0, y: 50.0), (x: 6.0, y: 50.0)];
378378
let ret = db.in_shape(&wtxn, &contains).unwrap();
@@ -405,8 +405,8 @@ fn write_polygon_with_belly_cells_at_res0() {
405405
cellulite.add(&mut wtxn, 1, &shape).unwrap();
406406

407407
cellulite.build(&mut wtxn, &|| false, &NoProgress).unwrap();
408-
insta::assert_snapshot!(cellulite.snap(&wtxn), @r"
409-
# Version: 0.3.0
408+
insta::assert_snapshot!(cellulite.snap(&wtxn), @r###"
409+
# Version: 0.3.1
410410
# Items
411411
0: Collection(Zollection { bounding_box: BoundingBox { bottom_left: Coord { x: -10.38791, y: 51.6838 }, top_right: Coord { x: -10.38791, y: 51.6838 } }, points: ZultiPoints { bounding_box: BoundingBox { bottom_left: Coord { x: -10.38791, y: 51.6838 }, top_right: Coord { x: -10.38791, y: 51.6838 } }, points: [Zoint { lng: -10.38791, lat: 51.6838 }] }, lines: ZultiLines { bounding_box: BoundingBox { bottom_left: Coord { x: 0.0, y: 0.0 }, top_right: Coord { x: 0.0, y: 0.0 } }, zines: [] }, polygons: ZultiPolygons { bounding_box: BoundingBox { bottom_left: Coord { x: 0.0, y: 0.0 }, top_right: Coord { x: 0.0, y: 0.0 } }, zolygons: [] } })
412412
1: Polygon(Zolygon { bounding_box: BoundingBox { bottom_left: Coord { x: -36.80442428588867, y: 37.05668258666992 }, top_right: Coord { x: 12.589740753173828, y: 65.76936340332031 } }, coords: [Coord { x: -36.80442428588867, y: 59.85004425048828 }, Coord { x: -8.567954063415527, y: 65.76936340332031 }, Coord { x: 12.589740753173828, y: 56.09892654418945 }, Coord { x: 6.169264793395996, y: 41.49180603027344 }, Coord { x: -11.232604026794434, y: 37.05668258666992 }, Coord { x: -32.81175231933594, y: 44.35645294189453 }, Coord { x: -36.80442428588867, y: 59.85004425048828 }] })
@@ -420,7 +420,7 @@ fn write_polygon_with_belly_cells_at_res0() {
420420
Cell { res: 0, center: (33.7110, -0.5345) }: RoaringBitmap<[1]>
421421
# Belly Cells
422422
Cell { res: 0, center: (52.6758, -11.6016) }: RoaringBitmap<[1]>
423-
");
423+
"###);
424424

425425
let filter = polygon![
426426
(x: -13.35211181640625, y: 51.78105163574219),
@@ -454,8 +454,8 @@ fn write_polygon_with_belly_cells_at_res1() {
454454
cellulite.add(&mut wtxn, 1, &shape).unwrap();
455455

456456
cellulite.build(&mut wtxn, &|| false, &NoProgress).unwrap();
457-
insta::assert_snapshot!(cellulite.snap(&wtxn), @r"
458-
# Version: 0.3.0
457+
insta::assert_snapshot!(cellulite.snap(&wtxn), @r###"
458+
# Version: 0.3.1
459459
# Items
460460
0: Collection(Zollection { bounding_box: BoundingBox { bottom_left: Coord { x: -10.89288, y: 52.91525 }, top_right: Coord { x: -10.89288, y: 52.91525 } }, points: ZultiPoints { bounding_box: BoundingBox { bottom_left: Coord { x: -10.89288, y: 52.91525 }, top_right: Coord { x: -10.89288, y: 52.91525 } }, points: [Zoint { lng: -10.89288, lat: 52.91525 }] }, lines: ZultiLines { bounding_box: BoundingBox { bottom_left: Coord { x: 0.0, y: 0.0 }, top_right: Coord { x: 0.0, y: 0.0 } }, zines: [] }, polygons: ZultiPolygons { bounding_box: BoundingBox { bottom_left: Coord { x: 0.0, y: 0.0 }, top_right: Coord { x: 0.0, y: 0.0 } }, zolygons: [] } })
461461
1: Polygon(Zolygon { bounding_box: BoundingBox { bottom_left: Coord { x: -22.350751876831055, y: 46.764404296875 }, top_right: Coord { x: -1.9412200450897217, y: 57.86238098144531 } }, coords: [Coord { x: -22.350751876831055, y: 54.04570388793945 }, Coord { x: -14.230262756347656, y: 57.86238098144531 }, Coord { x: -3.6089367866516113, y: 56.31303405761719 }, Coord { x: -1.9412200450897217, y: 50.917137145996094 }, Coord { x: -7.79402494430542, y: 46.764404296875 }, Coord { x: -18.57700538635254, y: 48.349578857421875 }, Coord { x: -22.350751876831055, y: 54.04570388793945 }] })
@@ -470,7 +470,7 @@ fn write_polygon_with_belly_cells_at_res1() {
470470
Cell { res: 1, center: (57.6409, -21.6939) }: RoaringBitmap<[1]>
471471
# Belly Cells
472472
Cell { res: 1, center: (52.6758, -11.6016) }: RoaringBitmap<[1]>
473-
");
473+
"###);
474474

475475
let filter = polygon![
476476
(x: -14.853970527648926, y: 52.716609954833984),

0 commit comments

Comments
 (0)