X-Git-Url: http://git.kpe.io/?p=kmrcl.git;a=blobdiff_plain;f=tests.lisp;h=d78aba3f890c5fbbe445f61e86bb075a73cae23f;hp=86e86bdbb19ac6f8067f6b0e8ada0b3f0e88c264;hb=9861627be14c8df1d16a25fb062d718051a636b7;hpb=6edcb840b821b4be95925fe39ce34ee5e1f229d7 diff --git a/tests.lisp b/tests.lisp index 86e86bd..d78aba3 100644 --- a/tests.lisp +++ b/tests.lisp @@ -9,7 +9,7 @@ ;;;; ;;;; $Id$ ;;;; -;;;; This file is Copyright (c) 2000-2002 by Kevin M. Rosenberg +;;;; This file is Copyright (c) 2000-2006 by Kevin M. Rosenberg ;;;; ;;;; ************************************************************************* @@ -64,6 +64,22 @@ (deftest :sdstl.4 (string-delimited-string-to-list "ab|cd|ef" "ab") ("" "|cd|ef")) +(deftest :hexstr.1 (binary-sequence-to-hex-string ()) + "") + +(deftest :hexstr.2 (binary-sequence-to-hex-string #()) + "") + +(deftest :hexstr.3 (binary-sequence-to-hex-string #(165)) + "a5" +) + +(deftest :hexstr.4 (binary-sequence-to-hex-string (list 165)) + "a5") + +(deftest :hexstr.5 (binary-sequence-to-hex-string #(165 86)) + "a556") + (deftest :apsl.1 (append-sublists '((a b) (c d))) (a b c d)) (deftest :apsl.2 (append-sublists nil) nil) (deftest :apsl.3 (append-sublists '((a b))) (a b)) @@ -379,6 +395,33 @@ (make-url "pg" :anchor "then" :vars '(("a" . "5") ("b" . "pi"))) "pg?a=5&b=pi#then") +(defclass test-unique () + ((a :initarg :a) + (b :initarg :b))) + + +(deftest :unique.1 + (let ((list (list (make-instance 'test-unique :a 1 :b 1) + (make-instance 'test-unique :a 2 :b 2) + (make-instance 'test-unique :a 3 :b 2)))) + (values + (unique-slot-values list 'a) + (unique-slot-values list 'b))) + (1 2 3) (1 2)) + +(deftest :unique.2 + (unique-slot-values nil 'a) + nil) + +(deftest :nwp.1 + (numbers-within-percentage 1. 1.1 9) + nil) + +(deftest :nwp.2 + (numbers-within-percentage 1. 1.1 11) + t) + + ;;; MOP Testing ;; Disable attrib class until understand changes in sbcl/cmucl