From 712654d4c023a2ab13190c6905d313e0ba897965 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Mon, 2 Oct 2023 19:26:40 +0200 Subject: Rewrite test running system. --- tests/test/webdav-file.scm | 53 ---------------------------------------------- 1 file changed, 53 deletions(-) delete mode 100644 tests/test/webdav-file.scm (limited to 'tests/test/webdav-file.scm') diff --git a/tests/test/webdav-file.scm b/tests/test/webdav-file.scm deleted file mode 100644 index 4096016b..00000000 --- a/tests/test/webdav-file.scm +++ /dev/null @@ -1,53 +0,0 @@ -(define-module (test webdav-file) - :use-module (srfi srfi-64) - :use-module (srfi srfi-71) - :use-module (srfi srfi-88) - :use-module (hnh util) - :use-module (hnh util path) - :use-module (ice-9 ftw) - :use-module (ice-9 rdelim) - :use-module (oop goops) - :use-module (calp webdav resource) - :use-module (calp webdav resource file) - ) - -;;; Commentary: -;;; Tests the specifics of the file backed webdav resource objects. -;;; Code: - - -;;; TODO general helper procedure for this -(define test-root (mkdtemp (string-copy "/tmp/calp-test-XXXXXX"))) - -(define root-resource (make - root: test-root)) - - -(test-group "File resource collection" - (add-collection! root-resource "subdir") - (test-eqv "Collection correctly added" - 'directory (-> (path-append test-root "subdir") - stat stat:type) )) - - - -;;; TODO this fails, sice doesn't override add-resource! -;;; 's add resource must at least update root path path of the -;;; child resource, and possibly also touch the file (so ctime gets set). -(test-group "File resource with content" - (let ((fname "file.txt") - (s "Hello, World!\n")) - (add-resource! root-resource fname s) - (let ((p (path-append test-root fname))) - (test-eqv "File correctly added" - 'regular (-> p stat stat:type)) - (test-equal "Expected content was written" - s - (with-input-from-file p - (lambda () (read-delimited ""))) - )))) - - - -(test-group "Copy file" - 'TODO) -- cgit v1.2.3