Sha256: 6004bde19b3a3a3abe57fbebd75050ef35dbd43aa31b5c988694afad84a6572e

Contents?: true

Size: 1.33 KB

Versions: 53

Compression:

Stored size: 1.33 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"))))

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

Version data entries

53 entries across 53 versions & 1 rubygems

Version Path
trackler-2.0.8.5 tracks/lisp/exercises/anagram/anagram-test.lisp
trackler-2.0.8.4 tracks/lisp/exercises/anagram/anagram-test.lisp
trackler-2.0.8.3 tracks/lisp/exercises/anagram/anagram-test.lisp
trackler-2.0.8.2 tracks/lisp/exercises/anagram/anagram-test.lisp
trackler-2.0.8.1 tracks/lisp/exercises/anagram/anagram-test.lisp
trackler-2.0.7.0 tracks/lisp/exercises/anagram/anagram-test.lisp
trackler-2.0.6.44 tracks/lisp/exercises/anagram/anagram-test.lisp
trackler-2.0.6.43 tracks/lisp/exercises/anagram/anagram-test.lisp
trackler-2.0.6.42 tracks/lisp/exercises/anagram/anagram-test.lisp
trackler-2.0.6.41 tracks/lisp/exercises/anagram/anagram-test.lisp
trackler-2.0.6.40 tracks/lisp/exercises/anagram/anagram-test.lisp
trackler-2.0.6.39 tracks/lisp/exercises/anagram/anagram-test.lisp
trackler-2.0.6.38 tracks/lisp/exercises/anagram/anagram-test.lisp
trackler-2.0.6.37 tracks/lisp/exercises/anagram/anagram-test.lisp
trackler-2.0.6.36 tracks/lisp/exercises/anagram/anagram-test.lisp
trackler-2.0.6.35 tracks/lisp/exercises/anagram/anagram-test.lisp
trackler-2.0.6.34 tracks/lisp/exercises/anagram/anagram-test.lisp
trackler-2.0.6.33 tracks/lisp/exercises/anagram/anagram-test.lisp
trackler-2.0.6.32 tracks/lisp/exercises/anagram/anagram-test.lisp
trackler-2.0.6.31 tracks/lisp/exercises/anagram/anagram-test.lisp