From a17afe81118c7167bc188545a65bc45eda0f40eb Mon Sep 17 00:00:00 2001
From: Arun Isaac
Date: Sun, 27 Sep 2026 01:20:39 +0100
Subject: Switch to xapian 2.x.
---
tests/smoketest.scm | 28 +++++++++++++++-------------
1 file changed, 15 insertions(+), 13 deletions(-)
(limited to 'tests/smoketest.scm')
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 @@
;;; .
;;; 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(( AND_NOT test@1))"
+ "Query((0 * 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(( AND_NOT Zt\u00e9st@1))"
+ "Query((0 * 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")
--
cgit 1.4.1