Sha256: 91e4e3cfe2302f18094133daefa65375c2c928ccc0626873abf7d5a93905e099

Contents?: true

Size: 769 Bytes

Versions: 145

Compression:

Stored size: 769 Bytes

Contents

(ql:quickload "lisp-unit")
#-xlisp-test (load "collatz-conjecture")

(defpackage #:collatz-conjecture-test
  (:use #:common-lisp #:lisp-unit))

(in-package #:collatz-conjecture-test)

(define-test steps-for-1
  (assert-equal 0 (collatz-conjecture:collatz 1)))

(define-test steps-for-16
  (assert-equal 4 (collatz-conjecture:collatz 16)))

(define-test steps-for-12
  (assert-equal 9 (collatz-conjecture:collatz 12)))

(define-test steps-for-1000000
  (assert-equal 152 (collatz-conjecture:collatz 1000000)))

(define-test steps-for-0
  (assert-equal NIL (collatz-conjecture:collatz 0)))

(define-test steps-for-negative
  (assert-equal NIL (collatz-conjecture:collatz (- 0 15))))


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

Version data entries

145 entries across 145 versions & 1 rubygems

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