Sha256: d63bf5624e16ad5f3ab60ec069c3d9073260426349514a5107fbe1b5f3322f39

Contents?: true

Size: 1.42 KB

Versions: 151

Compression:

Stored size: 1.42 KB

Contents

(* Test/exercise version: "1.0.0" *)

open Core
open OUnit2
open Etl

let ae exp got _test_ctxt =
  let sexpr_of l = List.sexp_of_t (Tuple2.sexp_of_t Char.sexp_of_t Int.sexp_of_t) l in
  let printer l = Sexp.to_string (sexpr_of l) in
  assert_equal exp got ~printer

let tests = [
   "a single letter" >::
      ae [('a', 1)] 
         (transform [(1, ['A'])]);
   "single score with multiple letters" >::
      ae [('a', 1); ('e', 1); ('i', 1); ('o', 1); ('u', 1)] 
         (transform [(1, ['A'; 'E'; 'I'; 'O'; 'U'])]);
   "multiple scores with multiple letters" >::
      ae [('a', 1); ('d', 2); ('e', 1); ('g', 2)] 
         (transform [(1, ['A'; 'E']); (2, ['D'; 'G'])]);
   "multiple scores with differing numbers of letters" >::
      ae [('a', 1); ('b', 3); ('c', 3); ('d', 2); ('e', 1); 
          ('f', 4); ('g', 2); ('h', 4); ('i', 1); ('j', 8); 
          ('k', 5); ('l', 1); ('m', 3); ('n', 1); ('o', 1); 
          ('p', 3); ('q', 10); ('r', 1); ('s', 1); ('t', 1); 
          ('u', 1); ('v', 4); ('w', 4); ('x', 8); ('y', 4); 
          ('z', 10)] 
         (transform [(1, ['A'; 'E'; 'I'; 'O'; 'U'; 'L'; 'N'; 'R'; 'S'; 'T']); 
                     (2, ['D'; 'G']); 
                     (3, ['B'; 'C'; 'M'; 'P']); 
                     (4, ['F'; 'H'; 'V'; 'W'; 'Y']); 
                     (5, ['K']); 
                     (8, ['J'; 'X']); 
                     (10, ['Q'; 'Z'])]);
]

let () =
  run_test_tt_main ("etl tests" >::: tests)

Version data entries

151 entries across 151 versions & 1 rubygems

Version Path
trackler-2.2.1.110 tracks/ocaml/exercises/etl/test.ml
trackler-2.2.1.109 tracks/ocaml/exercises/etl/test.ml
trackler-2.2.1.108 tracks/ocaml/exercises/etl/test.ml
trackler-2.2.1.107 tracks/ocaml/exercises/etl/test.ml
trackler-2.2.1.106 tracks/ocaml/exercises/etl/test.ml
trackler-2.2.1.105 tracks/ocaml/exercises/etl/test.ml
trackler-2.2.1.104 tracks/ocaml/exercises/etl/test.ml
trackler-2.2.1.103 tracks/ocaml/exercises/etl/test.ml
trackler-2.2.1.102 tracks/ocaml/exercises/etl/test.ml
trackler-2.2.1.101 tracks/ocaml/exercises/etl/test.ml
trackler-2.2.1.100 tracks/ocaml/exercises/etl/test.ml
trackler-2.2.1.99 tracks/ocaml/exercises/etl/test.ml
trackler-2.2.1.98 tracks/ocaml/exercises/etl/test.ml
trackler-2.2.1.97 tracks/ocaml/exercises/etl/test.ml
trackler-2.2.1.96 tracks/ocaml/exercises/etl/test.ml
trackler-2.2.1.95 tracks/ocaml/exercises/etl/test.ml
trackler-2.2.1.94 tracks/ocaml/exercises/etl/test.ml
trackler-2.2.1.93 tracks/ocaml/exercises/etl/test.ml
trackler-2.2.1.92 tracks/ocaml/exercises/etl/test.ml
trackler-2.2.1.91 tracks/ocaml/exercises/etl/test.ml