aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2023-10-27 16:22:14 +0200
committerHugo Hörnquist <hugo@lysator.liu.se>2023-11-06 00:46:25 +0100
commit6c7b46f5a9fbc1175a706dd005f72a952877a03c (patch)
treee0712fe0003a317e4ba02553107a46f2f8d87f64
parentAutomatically mark all definitions as covered. (diff)
downloadcalp-6c7b46f5a9fbc1175a706dd005f72a952877a03c.tar.gz
calp-6c7b46f5a9fbc1175a706dd005f72a952877a03c.tar.xz
Add tests for HTTP status codes.
-rw-r--r--tests/unit/web-util/http-status-codes.scm16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/unit/web-util/http-status-codes.scm b/tests/unit/web-util/http-status-codes.scm
new file mode 100644
index 00000000..51bc26d6
--- /dev/null
+++ b/tests/unit/web-util/http-status-codes.scm
@@ -0,0 +1,16 @@
+(define-module (test web-http-status-codes)
+ :use-module (srfi srfi-64)
+ :use-module (srfi srfi-88)
+ :use-module ((web http status-codes)
+ :select (http-status-codes
+ http-status-phrase
+ http-status-line)))
+
+(test-equal "Existing code" "Locked" (http-status-phrase 423))
+(test-equal "Missing code" "" (http-status-phrase 999))
+(test-equal "Default status line"
+ "HTTP/1.1 302 Found" (http-status-line 302))
+(test-equal "Custom status line"
+ "HTTP/1.1 200 Sure Thing" (http-status-line 200 "Sure Thing"))
+
+'((web http status-codes))