test-urls-2.script 1.2 KB
Newer Older
1
;;; -*- Lisp -*-
2

3 4 5
#+scl
(require :http-library)

6
(progn
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
 (setf asdf:*central-registry* '("http://www.scieneer.com/files/"))
 ;; Compare the source files with local versions before loading them.
 #+(and (or abcl scl) trust-the-net)
 (flet ((compare (url local)
	  (with-open-file (stream1 url :element-type 'character
				   :external-format :utf-8)
	    (with-open-file (stream2 local :element-type 'character
				     :external-format :utf-8)
	      (loop
		 (let ((ch1 (read-char stream1 nil nil))
		       (ch2 (read-char stream2 nil nil)))
		   (unless (eql ch1 ch2)
		     (error "Unexpected source content."))
		   (unless (and ch1 ch2)
		     (return))))))))
22
   (let ((url (system-definition-pathname "test-urls-2")))
23 24
     (compare url "test-urls-2.asd"))
   (let* ((system (asdf:find-system "test-urls-2"))
25 26
	  (url (component-pathname
		(find-component system "test"))))
27 28
     (compare url "test.lisp"))

29
   (load-system 'test-urls-2)
30 31

   ;; Test that it compiled
32 33 34
   (let* ((path (component-pathname
                 (find-component "test-urls-2" "test")))
          (test (test-fasl path))
35 36 37
          (test-date (file-write-date test)))
   (format t "~&test-urls-2 1: ~S ~S~%" test test-date)
   (assert test-date))))