Sha256: 95d5d0bac3b962d1898b051a49c48d37800b86874d128ce8a59ee86505211901

Contents?: true

Size: 1.5 KB

Versions: 42

Compression:

Stored size: 1.5 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 (scrabble-score))

(test-begin "scrabble-score")

(test-assert "a is worth one point"
             (equal? (score "a")
                     1))

(test-assert "scoring is case insensitive"
             (equal? (score "A")
                     1))

(test-assert "f is worth four"
             (equal? (score "f")
                     4))

(test-assert "two one point letters make a two point word"
             (equal? (score "at")
                     2))

(test-assert "three letter word"
             (equal? (score "zoo")
                     12))

(test-assert "medium word"
             (equal? (score "street")
                     6))

(test-assert "longer words with valuable letters"
             (equal? (score "quirky")
                     22))

(test-assert "long mixed case word"
             (equal? (score "OxyphenButazone")
                     41))

(test-assert "english scrabble letters score"
             (equal? (score "pinata")
                     8))

(test-assert "non english scrabble letters do not score"
             (equal? (score "piƱata")
                     7))

(test-assert "empty words are worth zero"
             (equal? (score "")
                     0))

(test-end "scrabble-score")

Version data entries

42 entries across 42 versions & 1 rubygems

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