about summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
authorArun Isaac2026-09-27 01:20:39 +0100
committerArun Isaac2026-09-27 01:46:26 +0100
commita17afe81118c7167bc188545a65bc45eda0f40eb (patch)
tree7a6853e69f611c71e081aae668f77ec4b368d50a /tests
parent99c8e034f83ad7e34fddbff6018bf0639533f2d9 (diff)
downloadguile-xapian-a17afe81118c7167bc188545a65bc45eda0f40eb.tar.gz
guile-xapian-a17afe81118c7167bc188545a65bc45eda0f40eb.tar.lz
guile-xapian-a17afe81118c7167bc188545a65bc45eda0f40eb.zip
Switch to xapian 2.x. HEAD master
Diffstat (limited to 'tests')
-rw-r--r--tests/smoketest.scm28
1 files changed, 15 insertions, 13 deletions
diff --git a/tests/smoketest.scm b/tests/smoketest.scm
index 1e4f37e..b7a84b8 100644
--- a/tests/smoketest.scm
+++ b/tests/smoketest.scm
@@ -18,7 +18,7 @@
 ;;; <https://www.gnu.org/licenses/>.
 
 ;;; This test suite is a more or less faithful port of
-;;; xapian-bindings/python3/smoketest.py from v1.4.32 of the xapian
+;;; xapian-bindings/python3/smoketest.py from v2.1.0 of the xapian
 ;;; repo. Keep this updated with new releases of xapian.
 
 (use-modules ((rnrs conditions) #:select (&error) #:prefix rnrs:)
@@ -79,12 +79,16 @@ after."
   "Xapian::Stem(english)"
   (Stem-get-description (make-stem "english")))
 
-(test-expect-fail "document does not transparently handle a zero byte")
-(let* ((data "a\0b")
-       (doc (make-document #:data data)))
-  (test-equal "document does not transparently handle a zero byte"
-    data
-    (document-data (make-document #:data data))))
+;; scm_to_stringn does not allow strings containing null characters to
+;; be converted to C strings. So, this test can never actually pass.
+;; And, we keep it commented out because running it raises an
+;; exception and crashes the test runner process.
+;; (test-expect-fail "document does not transparently handle a zero byte")
+;; (let* ((data "a\0b")
+;;        (doc (make-document #:data data)))
+;;   (test-equal "document does not transparently handle a zero byte"
+;;     data
+;;     (document-data (make-document #:data data))))
 
 (call-with-temporary-writable-database "/tmp/xapian-db"
   (lambda (db)
@@ -185,15 +189,15 @@ after."
 ;; TODO: Check QueryParser parsing error.
 
 (test-equal "parse pure NOT query"
-  "Query((<alldocuments> AND_NOT test@1))"
+  "Query((0 * <alldocuments> AND_NOT test@1))"
   (Query-get-description (parse-query "NOT test"
                                       #:stemmer (make-stem "none")
                                       #:boolean? #t
                                       #:pure-not? #t)))
 
 (test-equal "parse query with partial matching 1"
-  "Query((Zfoo@1 AND (WILDCARD SYNONYM o OR Zo@2)))"
-  (Query-get-description (parse-query "foo o"
+  "Query((Zfoo@1 AND (WILDCARD SYNONYM ox OR Zox@2)))"
+  (Query-get-description (parse-query "foo ox"
                                       #:stemmer (make-stem "en")
                                       #:default-operator (Query-OP-AND)
                                       #:partial? #t)))
@@ -210,7 +214,7 @@ after."
   (Query-get-description (query-or (query "foo") (query "bar£"))))
 
 (test-equal "parse query with unicode characters"
-  "Query((<alldocuments> AND_NOT Zt\u00e9st@1))"
+  "Query((0 * <alldocuments> AND_NOT Zt\u00e9st@1))"
   (Query-get-description (parse-query "NOT tést"
                                       #:stemmer (make-stem "en")
                                       #:boolean? #t
@@ -264,8 +268,6 @@ after."
                 #:stemmer (make-stem "none")
                 #:range-processors (list (prefixed-date-range-processor 1 #:prefer-mdy? #t)))))
 
-;; TODO: Test NumberValueRangeProcessor.
-
 (let* ((test-field-processor
         (field-processor (lambda (str)
                            (if (string= str "spam")