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.119 tracks/racket/exercises/anagram/anagram-test.rkt
trackler-2.2.1.118 tracks/racket/exercises/anagram/anagram-test.rkt
trackler-2.2.1.117 tracks/racket/exercises/anagram/anagram-test.rkt
trackler-2.2.1.116 tracks/racket/exercises/anagram/anagram-test.rkt
trackler-2.2.1.115 tracks/racket/exercises/anagram/anagram-test.rkt
trackler-2.2.1.114 tracks/racket/exercises/anagram/anagram-test.rkt
trackler-2.2.1.113 tracks/racket/exercises/anagram/anagram-test.rkt
trackler-2.2.1.111 tracks/racket/exercises/anagram/anagram-test.rkt
trackler-2.2.1.110 tracks/racket/exercises/anagram/anagram-test.rkt
trackler-2.2.1.109 tracks/racket/exercises/anagram/anagram-test.rkt
trackler-2.2.1.108 tracks/racket/exercises/anagram/anagram-test.rkt
trackler-2.2.1.107 tracks/racket/exercises/anagram/anagram-test.rkt
trackler-2.2.1.106 tracks/racket/exercises/anagram/anagram-test.rkt
trackler-2.2.1.105 tracks/racket/exercises/anagram/anagram-test.rkt
trackler-2.2.1.104 tracks/racket/exercises/anagram/anagram-test.rkt
trackler-2.2.1.103 tracks/racket/exercises/anagram/anagram-test.rkt
trackler-2.2.1.102 tracks/racket/exercises/anagram/anagram-test.rkt
trackler-2.2.1.101 tracks/racket/exercises/anagram/anagram-test.rkt
trackler-2.2.1.100 tracks/racket/exercises/anagram/anagram-test.rkt
trackler-2.2.1.99 tracks/racket/exercises/anagram/anagram-test.rkt