Sha256: e6da2da3f53e556d1e40d0c3ce8bd4ed12d5bba22c51383f2572c6154da8b555

Contents?: true

Size: 1.51 KB

Versions: 133

Compression:

Stored size: 1.51 KB

Contents

(ql:quickload "lisp-unit")
#-xlisp-test (load "perfect-numbers")

(defpackage #:perfect-numbers-test
  (:use #:common-lisp #:lisp-unit))

(in-package #:perfect-numbers-test)


;; Perfect numbers tests:
(define-test smallest-perfect-number
  (assert-equal "perfect" (perfect-numbers:classify 6)))

(define-test medium-perfect-number
  (assert-equal "perfect" (perfect-numbers:classify 28)))

(define-test large-perfect-number
  (assert-equal "perfect" (perfect-numbers:classify 33550336)))


;; Abundant numbers tests:
(define-test smallest-abundant-number
  (assert-equal "abundant" (perfect-numbers:classify 12)))

(define-test medium-abundant-number
  (assert-equal "abundant" (perfect-numbers:classify 30)))

(define-test large-abundant-number
  (assert-equal "abundant" (perfect-numbers:classify 33550335)))


;; Deficient numbers tests:
(define-test smallest-prime-deficient-number
  (assert-equal "deficient" (perfect-numbers:classify 2)))

(define-test smallest-non-prime-deficient-number
  (assert-equal "deficient" (perfect-numbers:classify 1)))

(define-test medium-deficient-number
  (assert-equal "deficient" (perfect-numbers:classify 32)))

(define-test large-deficient-number
  (assert-equal "deficient" (perfect-numbers:classify 33550337)))


;; Undefined values of classify tests:
(define-test undefinded-0
  (assert-equal NIL (perfect-numbers:classify 0)))

(define-test undefined-negative
  (assert-equal NIL (perfect-numbers:classify -3)))

#-xlisp-test
(let ((*print-errors* t)
      (*print-failures* t))
  (run-tests :all))

Version data entries

133 entries across 133 versions & 1 rubygems

Version Path
trackler-2.2.1.180 tracks/common-lisp/exercises/perfect-numbers/perfect-numbers-test.lisp
trackler-2.2.1.179 tracks/common-lisp/exercises/perfect-numbers/perfect-numbers-test.lisp
trackler-2.2.1.178 tracks/common-lisp/exercises/perfect-numbers/perfect-numbers-test.lisp
trackler-2.2.1.177 tracks/common-lisp/exercises/perfect-numbers/perfect-numbers-test.lisp
trackler-2.2.1.176 tracks/common-lisp/exercises/perfect-numbers/perfect-numbers-test.lisp
trackler-2.2.1.175 tracks/common-lisp/exercises/perfect-numbers/perfect-numbers-test.lisp
trackler-2.2.1.174 tracks/common-lisp/exercises/perfect-numbers/perfect-numbers-test.lisp
trackler-2.2.1.173 tracks/common-lisp/exercises/perfect-numbers/perfect-numbers-test.lisp
trackler-2.2.1.172 tracks/common-lisp/exercises/perfect-numbers/perfect-numbers-test.lisp
trackler-2.2.1.171 tracks/common-lisp/exercises/perfect-numbers/perfect-numbers-test.lisp
trackler-2.2.1.170 tracks/common-lisp/exercises/perfect-numbers/perfect-numbers-test.lisp
trackler-2.2.1.169 tracks/common-lisp/exercises/perfect-numbers/perfect-numbers-test.lisp
trackler-2.2.1.167 tracks/common-lisp/exercises/perfect-numbers/perfect-numbers-test.lisp
trackler-2.2.1.166 tracks/common-lisp/exercises/perfect-numbers/perfect-numbers-test.lisp
trackler-2.2.1.165 tracks/common-lisp/exercises/perfect-numbers/perfect-numbers-test.lisp
trackler-2.2.1.164 tracks/common-lisp/exercises/perfect-numbers/perfect-numbers-test.lisp
trackler-2.2.1.163 tracks/common-lisp/exercises/perfect-numbers/perfect-numbers-test.lisp
trackler-2.2.1.162 tracks/common-lisp/exercises/perfect-numbers/perfect-numbers-test.lisp
trackler-2.2.1.161 tracks/common-lisp/exercises/perfect-numbers/perfect-numbers-test.lisp
trackler-2.2.1.160 tracks/common-lisp/exercises/perfect-numbers/perfect-numbers-test.lisp