Sha256: 1b6767ab8c6832c5c98e5476563dc27907bbae4790058cd4f656cef21356284d

Contents?: true

Size: 1.47 KB

Versions: 396

Compression:

Stored size: 1.47 KB

Contents

;; Load SRFI-64 lightweight testing specification
(use-modules (srfi srfi-64))

;; Suppress log file output. To write logs, comment out the following line:
(module-define! (resolve-module '(srfi srfi-64)) 'test-log-to-file #f)

;; Require module
(add-to-load-path (dirname (current-filename)))
(use-modules (anagram))

(test-begin "anagram")

;; Tests go here

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

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

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

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

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

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

(test-equal "case-insensitive-anagrams"
            '("Carthorse")
            (anagrams-for
             "Orchestra"
             '("cashregister" "Carthorse" "radishes")))

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

(test-end "anagram")

Version data entries

396 entries across 396 versions & 1 rubygems

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