Sha256: 536a43b4d3ef9692e8c03a2f39e592fa0da09abaccf845399556adb07f9980d0

Contents?: true

Size: 1.46 KB

Versions: 290

Compression:

Stored size: 1.46 KB

Contents

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

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

(in-package #:anagram-test)

(define-test no-matches
  (assert-equal '()
      (anagram:anagrams-for
       "diaper"
       '("hello" "world" "zombies" "pants"))))

(define-test detect-simple-anagram
  (assert-equal '("tan")
      (anagram:anagrams-for "ant" '("tan" "stand" "at"))))

(define-test does-not-confuse-different-duplicates
  (assert-equal '() (anagram:anagrams-for "galea" '("eagle"))))

(define-test eliminate-anagram-subsets
  (assert-equal '() (anagram:anagrams-for "good" '("dog" "goody"))))

(define-test detect-anagram
  (assert-equal '("inlets")
      (anagram:anagrams-for
       "listen"
       '("enlists" "google" "inlets" "banana"))))

(define-test multiple-anagrams
  (assert-equal '("gallery" "regally" "largely")
      (anagram:anagrams-for
       "allergy"
       '("gallery" "ballerina" "regally" "clergy" "largely" "leading"))))

(define-test case-insensitive-anagrams
  (assert-equal '("Carthorse")
      (anagram:anagrams-for
       "Orchestra"
       '("cashregister" "Carthorse" "radishes"))))

(define-test word-is-not-own-anagram
  (assert-equal '()
      (anagram:anagrams-for "banana" '("banana"))))

(define-test word-is-not-own-anagram-case-insensitively
  (assert-equal '()
      (anagram:anagrams-for "bananarama" '("BananaRama"))))

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

Version data entries

290 entries across 290 versions & 1 rubygems

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