Sha256: 58699702a981cef490005b4e10e638af42bb99391fe203ce40bf2613fefcad1e

Contents?: true

Size: 1.12 KB

Versions: 53

Compression:

Stored size: 1.12 KB

Contents

(ql:quickload "lisp-unit")

(defpackage #:trinary-test
  (:use #:common-lisp #:lisp-unit))

#-xlisp-test (load "trinary")

(in-package #:trinary-test)

(define-test trinary-1-is-decimal-1
  (assert-equal 1 (trinary:to-decimal "1")))

(define-test trinary-2-is-decimal-2
  (assert-equal 2 (trinary:to-decimal "2")))

(define-test trinary-10-is-decimal-3
  (assert-equal 3 (trinary:to-decimal "10")))

(define-test trinary-11-is-decimal-4
  (assert-equal 4 (trinary:to-decimal "11")))

(define-test trinary-100-is-decimal-9
  (assert-equal 9 (trinary:to-decimal "100")))

(define-test trinary-112-is-decimal-14
  (assert-equal 14 (trinary:to-decimal "112")))

(define-test trinary-222-is-decimal-26

  (assert-equal 26 (trinary:to-decimal "222")))

(define-test trinary-1122000120-is-decimal-32091
  (assert-equal 32091 (trinary:to-decimal "1122000120")))

(define-test invalid-input-is-decimal-0
  (assert-equal 0 (trinary:to-decimal "carrot")))

(define-test invalid-input-with-digits-is-decimal-0
  (assert-equal 0 (trinary:to-decimal "0a1b2c")))

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

Version data entries

53 entries across 53 versions & 1 rubygems

Version Path
trackler-2.0.5.16 tracks/lisp/exercises/trinary/trinary-test.lisp
trackler-2.0.5.15 tracks/lisp/exercises/trinary/trinary-test.lisp
trackler-2.0.5.14 tracks/lisp/exercises/trinary/trinary-test.lisp
trackler-2.0.5.13 tracks/lisp/exercises/trinary/trinary-test.lisp
trackler-2.0.5.12 tracks/lisp/exercises/trinary/trinary-test.lisp
trackler-2.0.5.11 tracks/lisp/exercises/trinary/trinary-test.lisp
trackler-2.0.5.10 tracks/lisp/exercises/trinary/trinary-test.lisp
trackler-2.0.5.9 tracks/lisp/exercises/trinary/trinary-test.lisp
trackler-2.0.5.8 tracks/lisp/exercises/trinary/trinary-test.lisp
trackler-2.0.5.7 tracks/lisp/exercises/trinary/trinary-test.lisp
trackler-2.0.5.6 tracks/lisp/exercises/trinary/trinary-test.lisp
trackler-2.0.5.5 tracks/lisp/exercises/trinary/trinary-test.lisp
trackler-2.0.5.4 tracks/lisp/exercises/trinary/trinary-test.lisp
trackler-2.0.5.3 tracks/lisp/exercises/trinary/trinary-test.lisp
trackler-2.0.5.2 tracks/lisp/exercises/trinary/trinary-test.lisp
trackler-2.0.5.1 tracks/lisp/exercises/trinary/trinary-test.lisp
trackler-2.0.5.0 tracks/lisp/exercises/trinary/trinary-test.lisp
trackler-2.0.4.0 tracks/lisp/exercises/trinary/trinary-test.lisp
trackler-2.0.3.9 tracks/lisp/exercises/trinary/trinary-test.lisp
trackler-2.0.3.8 tracks/lisp/exercises/trinary/trinary-test.lisp