mu-scm: don't depend on dir order in tests

Some of the tests were using (mfind "") to find messages, but since some
messages don't have dates the order is implicitly defined by the directory
order. This usually works, but not always (i.e. guix).

So let's make the behavior deterministic.

Fixes #2888
This commit is contained in:
Dirk-Jan C. Binnema
2025-11-30 16:16:10 +02:00
committed by Seth Ladygo
parent b855a0dc93
commit 043f0ce337

View File

@ -26,7 +26,7 @@
(test-begin "test-basic-mfind") (test-begin "test-basic-mfind")
(let ((msg (car (mfind "")))) (let ((msg (car (mfind "from:Frodo"))))
;; size ;; size
(test-equal 490 (size msg)) (test-equal 490 (size msg))
;; message-id ;; message-id
@ -60,7 +60,7 @@
(define (test-mfind) (define (test-mfind)
(test-begin "test-mfind") (test-begin "test-mfind")
(let ((msg (car (mfind "" #:sort-field 'date #:reverse? #t)))) (let ((msg (car (mfind "to:a@example.com" #:sort-field 'date #:reverse? #t))))
(test-equal "test with multi to and cc" (subject msg) ) (test-equal "test with multi to and cc" (subject msg) )
(test-equal "2016-05-15 16:57:25" (test-equal "2016-05-15 16:57:25"
(time->string (date msg) #:format "%F %T" #:utc? #t))) (time->string (date msg) #:format "%F %T" #:utc? #t)))
@ -69,7 +69,7 @@
(define (test-message-full) (define (test-message-full)
(test-begin "test-message-full") (test-begin "test-message-full")
(let ((msg (cadr (mfind "")))) (let ((msg (car (mfind "from:testmu@testmu.xx"))))
(test-equal "Motörhead" (header msg "Subject")) (test-equal "Motörhead" (header msg "Subject"))
(test-equal "Mü <testmu@testmu.xx>" (header msg "From")) (test-equal "Mü <testmu@testmu.xx>" (header msg "From"))
(test-equal #f (header msg "Bla")) (test-equal #f (header msg "Bla"))