Author: rklochkov Date: Mon Jan 28 09:03:50 2013 New Revision: 19
Log: Added tests
Added: advanced-readtable.test.asd test.lisp
Added: advanced-readtable.test.asd ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ advanced-readtable.test.asd Mon Jan 28 09:03:50 2013 (r19) @@ -0,0 +1,8 @@ +(asdf:defsystem #:advanced-readtable.test + :description "Tests for advanced-customizable" + :author "Roman Klochkov kalimehtar@mail.ru" + :version "0.8.1" + :license "BSD" + :depends-on (#:advanced-readtable #:fiveam) + :components ((:file "test"))) + \ No newline at end of file
Added: test.lisp ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ test.lisp Mon Jan 28 09:03:50 2013 (r19) @@ -0,0 +1,44 @@ +(named-readtables:in-readtable :advanced) + +(5am:in-suite* :advanced-readtable) + +(defpackage a (:use cl)) +(in-package a) +(5am:test hierarchy1 + (5am:is (string= (package-name *package*) "A"))) + +(defpackage .b (:use cl)) +(in-package .b) +(5am:test hierarchy2 + (5am:is (string= (package-name *package*) "A.B"))) + +(in-package ..) +(5am:test hierarchy3 + (5am:is (string= (package-name *package*) "A"))) + +(defun foo () 1) + +(in-package a.b) + +(defun foo () 2) + +(5am:test hierarchy4 + (5am:is (= (+ (foo) (..::foo) 3))) + (5am:is (= (+ (foo) (..b::foo) 4))) + (5am:is (eq 'foo '..b::foo))) +; (5am:is (eq 'foo '........b::foo))) + +(eval-when (:compile-toplevel :load-toplevel :execute) + (advanced-readtable:push-import-prefix :a)) + +(5am:test import-prefix + (5am:is (eq 'foo 'b::foo))) + +(eval-when (:compile-toplevel :load-toplevel :execute) + (advanced-readtable:push-local-nickname :cl :alias)) + +(5am:test local-nickname + (5am:is (eq 'car 'alias:car))) + +(eval-when (:compile-toplevel :load-toplevel :execute) + (advanced-readtable:push-local-nickname :cl :alias))
advanced-readtable-cvs@common-lisp.net