You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Tests/QueryTests.swift
+23Lines changed: 23 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -617,4 +617,27 @@ class QueryTests: XCTestCase {
617
617
letquery2=Query.parse(query1.build())
618
618
XCTAssertEqual(query2.minimumAroundRadius,1000)
619
619
}
620
+
621
+
func test_numericFilters(){
622
+
letVALUE:[AnyObject]=["code=1",["price:0 to 10","price:1000 to 2000"]]
623
+
letquery1=Query()
624
+
XCTAssertNil(query1.numericFilters)
625
+
query1.numericFilters = VALUE
626
+
XCTAssertEqual(query1.numericFilters! asNSObject, VALUE asNSObject)
627
+
XCTAssertEqual(query1["numericFilters"],"[\"code=1\",[\"price:0 to 10\",\"price:1000 to 2000\"]]")
628
+
letquery2=Query.parse(query1.build())
629
+
XCTAssertEqual(query2.numericFilters! asNSObject, VALUE asNSObject)
630
+
}
631
+
632
+
func test_filters(){
633
+
letVALUE="available=1 AND (category:Book OR NOT category:Ebook) AND publication_date: 1441745506 TO 1441755506 AND inStock > 0 AND author:\"John Doe\""
0 commit comments