Commit 4d719d4a authored by Zach Beane's avatar Zach Beane
Browse files

Fix net.uri setter semantics.

Also add some net.uri tests.
parent 8e4c34ce
......@@ -40,7 +40,7 @@
`(defun ,net-name (uri)
(,name (real-uri uri)))
`(defun (setf ,net-name) (new-value uri)
(setf (,name uri ) new-value)))))
(setf (,name (real-uri uri) ) new-value)))))
(net-uri-accessors uri-path
......@@ -8,6 +8,7 @@
(:import-from #:net.aserve
......@@ -48,6 +49,27 @@
(is (equalp "bob" (mp:process-name process)))
(mp:process-kill process)))
(test uri-manipulation
(let ((uri (net.uri:parse-uri "/"))
(query "foo=bar")
(host "")
(fragment "baz")
(scheme :http)
(full-uri ""))
(is (null (net.uri:uri-query uri)))
(is (null (net.uri:uri-host uri)))
(is (null (net.uri:uri-fragment uri)))
(is (null (net.uri:uri-scheme uri )))
(setf (net.uri:uri-query uri) query)
(setf (net.uri:uri-host uri) host)
(setf (net.uri:uri-fragment uri) fragment)
(setf (net.uri:uri-scheme uri) scheme)
(is (equalp (net.uri:uri-query uri) query))
(is (equalp (net.uri:uri-host uri) host))
(is (equalp (net.uri:uri-fragment uri) fragment))
(is (equalp (net.uri:uri-scheme uri) scheme))
(is (equalp (net.uri:render-uri uri) full-uri))))
(test utf8-enabled
(is (= (length "€") 1)))
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment