Skip to content

Commit 7d18e50

Browse files
fixed html script test and swift query struct
1 parent 538f015 commit 7d18e50

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed

templates/swift/Sources/Query.swift.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ public struct Query : Codable, CustomStringConvertible {
8787
case let queryValue as Query:
8888
return [.query(queryValue)]
8989
case let anyArray as [Any]:
90-
return return [.array(anyArray.compactMap { convertToQueryValueArray($0).map { .array($0) } })]
90+
return [.array(anyArray.compactMap { convertToQueryValueArray($0).map { .array($0) } })]
9191
default:
9292
return nil
9393
}

tests/languages/web/index.html

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,26 @@
263263
console.log(Query.createdAfter("2023-01-01"));
264264
console.log(Query.updatedBefore("2023-01-01"));
265265
console.log(Query.updatedAfter("2023-01-01"));
266+
267+
// Spatial Distance query tests
268+
console.log(Query.distanceEqual("location", [40.7128, -74], 1000));
269+
console.log(Query.distanceEqual("location", [40.7128, -74], 1000, true));
270+
console.log(Query.distanceNotEqual("location", [40.7128, -74], 1000));
271+
console.log(Query.distanceNotEqual("location", [40.7128, -74], 1000, true));
272+
console.log(Query.distanceGreaterThan("location", [40.7128, -74], 1000));
273+
console.log(Query.distanceGreaterThan("location", [40.7128, -74], 1000, true));
274+
console.log(Query.distanceLessThan("location", [40.7128, -74], 1000));
275+
console.log(Query.distanceLessThan("location", [40.7128, -74], 1000, true));
276+
277+
// Spatial query tests
278+
console.log(Query.intersects("location", [40.7128, -74]));
279+
console.log(Query.notIntersects("location", [40.7128, -74]));
280+
console.log(Query.crosses("location", [40.7128, -74]));
281+
console.log(Query.notCrosses("location", [40.7128, -74]));
282+
console.log(Query.overlaps("location", [40.7128, -74]));
283+
console.log(Query.notOverlaps("location", [40.7128, -74]));
284+
console.log(Query.touches("location", [40.7128, -74]));
285+
console.log(Query.notTouches("location", [40.7128, -74]));
266286

267287
console.log(Query.or([
268288
Query.equal("released", true),

0 commit comments

Comments
 (0)