refactor(3p/lisp/mime4cl): unify test mechanism for sample msgs

For whatever reason, there were two sort of identical tests, mime.1 and
mime.2, in the mime4cl test suite: The former tested *sample1-file* and
the latter all messages *samples-directory*—in the same way, parsing the
original and a re-rendered version of the message to check if they were
equal.

We can just move sample1.msg into *samples-directory*, get rid
of *sample1-file* and thus pave the way for more test messages in the
future.

Change-Id: I843be331682b731af6ae02a4648ba1c64aaf59a5
Reviewed-on: https://cl.tvl.fyi/c/depot/+/8546
Reviewed-by: sterni <sternenseemann@systemli.org>
Autosubmit: sterni <sternenseemann@systemli.org>
Tested-by: BuildkiteCI
This commit is contained in:
sterni 2023-05-01 18:06:18 +02:00 committed by clbot
parent 93a6d3d920
commit 1e4b73ac95
3 changed files with 4 additions and 17 deletions

View file

@ -29,10 +29,8 @@ depot.nix.buildLisp.library {
(pkgs.writeText "nix-samples.lisp" ''
(in-package :mime4cl-tests)
;; missing from the tarball completely
(defvar *samples-directory* (pathname "/this/does/not/exist"))
;; override auto discovery which doesn't work in store
(defvar *sample1-file* (pathname "${./test/sample1.msg}"))
;; override auto discovery which doesn't work in the nix store
(defvar *samples-directory* (pathname "${./test/samples}"))
'')
./test/temp-file.lisp
./test/endec.lisp

View file

@ -1,7 +1,7 @@
;;; mime.lisp --- MIME regression tests
;;; Copyright (C) 2012 by Walter C. Pelissero
;;; Copyright (C) 2021-2022 by the TVL Authors
;;; Copyright (C) 2021-2023 by the TVL Authors
;;; Author: Walter C. Pelissero <walter@pelissero.de>
;;; Project: mime4cl
@ -27,22 +27,11 @@
*load-pathname*
#P"")))
(defvar *sample1-file* (make-pathname :defaults #.(or *compile-file-pathname*
*load-pathname*)
:name "sample1"
:type "msg"))
(deftest mime.1
(let* ((orig (mime-message *sample1-file*))
(dup (mime-message (with-output-to-string (out) (encode-mime-part orig out)))))
(mime= orig dup))
t)
(deftest mime.2
(loop
for f in (directory (make-pathname :defaults *samples-directory*
:name :wild
:type "txt"))
:type "msg"))
do
(format t "~A:~%" f)
(finish-output)