Sha256: 47320fa4e42ee9d98cc30f031ddbca18c565e686723f374b82eee610b56b53ed

Contents?: true

Size: 1.17 KB

Versions: 343

Compression:

Stored size: 1.17 KB

Contents

(ql:quickload "lisp-unit")
#-xlisp-test (load "atbash-cipher")

(defpackage #:atbash-cipher-test
  (:use #:common-lisp #:lisp-unit))

(in-package #:atbash-cipher-test)

(define-test encode-no
  (assert-equal "ml" (atbash-cipher:encode "no")))

(define-test encode-yes
  (assert-equal "bvh" (atbash-cipher:encode "yes")))

(define-test encode-OMG
  (assert-equal "lnt" (atbash-cipher:encode "OMG")))

(define-test encode-O-M-G
  (assert-equal "lnt" (atbash-cipher:encode "O M G")))

(define-test encode-long-word
  (assert-equal "nrmwy oldrm tob"
                (atbash-cipher:encode "mindblowingly")))

(define-test encode-numbers
  (assert-equal "gvhgr mt123 gvhgr mt"
                (atbash-cipher:encode "Testing, 1 2 3, testing.")))

(define-test encode-sentence
  (assert-equal "gifgs rhurx grlm"
                (atbash-cipher:encode "Truth is fiction.")))

(define-test encode-all-the-things
  (let ((plaintext "The quick brown fox jumps over the lazy dog.")
        (cipher "gsvjf rxpyi ldmul cqfnk hlevi gsvoz abwlt"))
    (assert-equal cipher (atbash-cipher:encode plaintext))))

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

Version data entries

343 entries across 343 versions & 1 rubygems

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