Sha256: 8d85ed1044429827dbb8bbb05f5c8f9e5151b30e6f8e50cb3734375d0328a44d

Contents?: true

Size: 1.49 KB

Versions: 288

Compression:

Stored size: 1.49 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 "hello-world")

(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 "hello-world")

Version data entries

288 entries across 288 versions & 1 rubygems

Version Path
trackler-2.2.1.137 tracks/scheme/exercises/scrabble-score/scrabble-score-test.scm
trackler-2.2.1.136 tracks/scheme/exercises/scrabble-score/scrabble-score-test.scm
trackler-2.2.1.135 tracks/scheme/exercises/scrabble-score/scrabble-score-test.scm
trackler-2.2.1.134 tracks/scheme/exercises/scrabble-score/scrabble-score-test.scm
trackler-2.2.1.133 tracks/scheme/exercises/scrabble-score/scrabble-score-test.scm
trackler-2.2.1.132 tracks/scheme/exercises/scrabble-score/scrabble-score-test.scm
trackler-2.2.1.131 tracks/scheme/exercises/scrabble-score/scrabble-score-test.scm
trackler-2.2.1.130 tracks/scheme/exercises/scrabble-score/scrabble-score-test.scm
trackler-2.2.1.129 tracks/scheme/exercises/scrabble-score/scrabble-score-test.scm
trackler-2.2.1.128 tracks/scheme/exercises/scrabble-score/scrabble-score-test.scm
trackler-2.2.1.127 tracks/scheme/exercises/scrabble-score/scrabble-score-test.scm
trackler-2.2.1.126 tracks/scheme/exercises/scrabble-score/scrabble-score-test.scm
trackler-2.2.1.125 tracks/scheme/exercises/scrabble-score/scrabble-score-test.scm
trackler-2.2.1.124 tracks/scheme/exercises/scrabble-score/scrabble-score-test.scm
trackler-2.2.1.123 tracks/scheme/exercises/scrabble-score/scrabble-score-test.scm
trackler-2.2.1.122 tracks/scheme/exercises/scrabble-score/scrabble-score-test.scm
trackler-2.2.1.121 tracks/scheme/exercises/scrabble-score/scrabble-score-test.scm
trackler-2.2.1.120 tracks/scheme/exercises/scrabble-score/scrabble-score-test.scm
trackler-2.2.1.119 tracks/scheme/exercises/scrabble-score/scrabble-score-test.scm
trackler-2.2.1.118 tracks/scheme/exercises/scrabble-score/scrabble-score-test.scm