aboutsummaryrefslogtreecommitdiff
path: root/tests/test/server.scm
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2023-10-02 19:26:40 +0200
committerHugo Hörnquist <hugo@lysator.liu.se>2023-10-02 19:28:44 +0200
commit712654d4c023a2ab13190c6905d313e0ba897965 (patch)
treeb8505b420d6621022fa6a46271340071d8881322 /tests/test/server.scm
parentMade displayln into a library export. (diff)
downloadcalp-712654d4c023a2ab13190c6905d313e0ba897965.tar.gz
calp-712654d4c023a2ab13190c6905d313e0ba897965.tar.xz
Rewrite test running system.
Diffstat (limited to 'tests/test/server.scm')
-rw-r--r--tests/test/server.scm28
1 files changed, 0 insertions, 28 deletions
diff --git a/tests/test/server.scm b/tests/test/server.scm
deleted file mode 100644
index a6200cb8..00000000
--- a/tests/test/server.scm
+++ /dev/null
@@ -1,28 +0,0 @@
-;;; Commentary:
-;; Tests parse-endpoint-string, used for defining server routes.
-;;; Code:
-
-(define-module (test server)
- :use-module (srfi srfi-64)
- :use-module (srfi srfi-71)
- :use-module (srfi srfi-88)
- :use-module ((web http make-routes)
- :select (parse-endpoint-string)))
-
-(test-assert "Check that parsing doesn't crash"
- (parse-endpoint-string "/static/:dir/:file"))
-
-;; Checks that parsing produces correct results
-(test-group
- "Simple parameters"
- (let ((path args (parse-endpoint-string "/static/:dir/:file")))
- (test-equal "Path" "/static/([^/.]+)/([^/.]+)" path)
- (test-equal "Parameters" '(dir file) args)))
-
-;; Checks that parsing with custom regex works
-;; along with literal periods.
-(test-group
- "Custom regex for parameters"
- (let ((path args (parse-endpoint-string "/static/:filename{.*}.:ext")))
- (test-equal "Path" "/static/(.*)\\.([^/.]+)" path)
- (test-equal "Parameters" '(filename ext) args)))