Sha256: 717230f4c04b112619b5f68f5f37c577ea88dc1fb6d7a4c2f5cdc17b5248345e

Contents?: true

Size: 1.35 KB

Versions: 396

Compression:

Stored size: 1.35 KB

Contents

#lang racket/base

(require "anagram.rkt")

(module+ test
  (require rackunit rackunit/text-ui))

(module+ test
  (define allergies '("gallery" "ballerina" "regally" "clergy" "largely" "leading"))

  (define suite
    (test-suite
     "anagram tests"

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

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

     (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"
                  (anagrams-for "listen"'("enlists" "google" "inlets" "banana"))
                  '("inlets"))

     (test-equal? "multiple-anagrams"
                  (anagrams-for "allergy" allergies)
                  '("gallery" "regally" "largely"))

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

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

  (run-tests suite))

Version data entries

396 entries across 396 versions & 1 rubygems

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