Mercurial > core / lisp/lib/net/tests.lisp
changeset 698: |
96958d3eb5b0 |
parent: |
7ce855f76e1d
|
author: |
Richard Westhaver <ellis@rwest.io> |
date: |
Fri, 04 Oct 2024 22:04:59 -0400 |
permissions: |
-rw-r--r-- |
description: |
fixes |
2 (:use :rt :std :cl :net :sb-concurrency :sb-thread :dat/proto :sb-bsd-sockets)) 4 (in-package :net/tests) 13 (is (stringp (resolve "compiler.company")))) 16 (with-tcp-client (client) 17 (is (typep client 'sb-bsd-sockets:inet-socket)) 18 (is (= (get-protocol-by-name :tcp) 19 (socket-protocol client))))) 22 (with-udp-client (client) 23 (is (typep client 'sb-bsd-sockets:inet-socket)) 24 (is (= (get-protocol-by-name :udp) 25 (socket-protocol client))))) 28 (is (= 4 (length (serialize (make-instance 'tlv :type 0 :length 1 :value #(1)) :bytes))))) 33 (let ((req (make-http-request)) 34 (cb (make-callbacks))) 37 (sb-ext:string-to-octets #"GET /cookies HTTP/1.1 39 Connection: keep-alive 40 Cache-Control: max-age=0Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 41 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.56 Safari/537.17 42 Accept-Encoding: gzip,deflate,sdch 43 Accept-Language: en-US,en;q=0.8 44 Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3 52 (is (req:get (uri:uri "https://compiler.company/index.html")))) 55 (is (fetch:download "https://compiler.company/index.html" :output "/tmp/index.html" :progress t)) 56 (is (delete-file "/tmp/index.html"))) 59 (let ((cookies (net/cookie:make-cookie-jar)) 60 (cookie (net/cookie:make-cookie))) 61 (net/cookie:merge-cookies cookies #(cookie)) 62 (is (= 1 (length (net/cookie:cookie-jar-cookies cookies)))) 63 (is (net/cookie:cookie= cookie (net/cookie:make-cookie))) 64 (is (stringp (net/cookie:write-cookie-header (list cookie)))))) 68 (is (pathnamep (default-web-directory))))