;;; Weeb --- Web microframework for GNU Guile ;;; Copyright © 2026 Jakob Kreuze ;;; ;;; This file is part of Weeb. ;;; ;;; Weeb is free software: you can redistribute it and/or modify it ;;; under the terms of the GNU Affero General Public License as ;;; published by the Free Software Foundation, either version 3 of the ;;; License, or (at your option) any later version. ;;; ;;; Weeb is distributed in the hope that it will be useful, but WITHOUT ;;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ;;; or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General ;;; Public License for more details. ;;; ;;; You should have received a copy of the GNU Affero General Public ;;; License along with Weeb. If not, see . (use-modules (srfi srfi-64) (weeb response) (weeb struct)) (test-runner-current (test-runner-simple)) (test-begin "weeb-response") (test-group "any->response" (let ((resp (make-struct 201 '() "created"))) (test-equal "identity" resp (any->response resp))) (test-equal "string-only" (make-struct 200 '() "hello") (any->response "hello")) (test-equal "list" (make-struct 404 '() "not found") (any->response '(404 "not found"))) (test-error "integer should trigger error" #t (any->response 500)) (test-error "list too short" #t (any->response '(200))) (test-error "list too long" #t (any->response '(200 "body" "extra")))) (test-end)