raft/tests/run.scm

54 lines
1.7 KiB
Scheme
Raw Normal View History

(import (chicken string))
(import r7rs
test
(chicken base)
(chicken string)
(chicken process)
(chicken gc)
2023-11-24 21:19:20 +00:00
alist-lib ;;Handling alists from JSON objects
base64 ;;decoding screenshot data
2023-11-24 21:19:20 +00:00
coops ;;Object system
http-client ;;API interaction
intarweb ;;Supporting HTTP functionality
medea ;;JSON handling
2023-11-24 21:19:20 +00:00
srfi-34 ;;Exception Handling
srfi-35 ;;Exception Types
uri-common ;;Supporting HTTP functionality
)
2023-11-24 21:19:20 +00:00
;; [[file:../raft.org::*Dependencies][Dependencies:5]]
(include-relative "../raft-impl.scm")
;; Dependencies:5 ends here
2023-11-24 21:19:20 +00:00
;; #+name: raft-session-test
2023-11-24 21:19:20 +00:00
;; [[file:../raft.org::raft-session-test][raft-session-test]]
(test-group "session"
2023-11-24 21:19:20 +00:00
(let ((browser (make-Raft <Gecko>)))
(test "Initial state" #f (slot-value browser 'session-id))
(test-assert "Session id check" (string? (begin (initialize-session browser) (slot-value browser 'session-id))))
(test-assert "Session id after termination" (eq? #f (begin (terminate-session browser) (slot-value browser 'session-id))))
(terminate browser)))
2023-11-24 21:19:20 +00:00
;; raft-session-test ends here
2023-11-24 21:19:20 +00:00
;; #+name: raft-url-test
2023-11-24 21:19:20 +00:00
;; [[file:../raft.org::raft-url-test][raft-url-test]]
(test-group "url"
2023-11-24 21:19:20 +00:00
(let ((browser (make-Raft <Gecko>)))
(test "Initial state" #f (slot-value browser 'session-id))
(test "Navigating to the first website" "http://info.cern.ch/hypertext/WWW/TheProject.html"
(begin (initialize-session browser)
(set-url browser "http://info.cern.ch/hypertext/WWW/TheProject.html")
(url browser)))
(terminate browser)))
2023-11-24 21:19:20 +00:00
;; raft-url-test ends here
2023-11-24 21:19:20 +00:00
;; [[file:../raft.org::*About This Egg][About This Egg:2]]
(test-exit)
;; About This Egg:2 ends here