Sha256: 669fd7cf800f4ecda3659ab602687f414f932375e271607ecb16587c65c573fc

Contents?: true

Size: 1.48 KB

Versions: 150

Compression:

Stored size: 1.48 KB

Contents

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

open Core
open OUnit2
open Atbash_cipher

let ae exp got _test_ctxt = assert_equal ~printer:String.to_string exp got

let encode_tests = [
   "encode yes" >::
     ae "bvh" (encode "yes");
   "encode no" >::
     ae "ml" (encode "no");
   "encode OMG" >::
     ae "lnt" (encode "OMG");
   "encode spaces" >::
     ae "lnt" (encode "O M G");
   "encode mindblowingly" >::
     ae "nrmwy oldrm tob" (encode "mindblowingly");
   "encode numbers" >::
     ae "gvhgr mt123 gvhgr mt" (encode "Testing,1 2 3, testing.");
   "encode deep thought" >::
     ae "gifgs rhurx grlm" (encode "Truth is fiction.");
   "encode all the letters" >::
     ae "gsvjf rxpyi ldmul cqfnk hlevi gsvoz abwlt" (encode "The quick brown fox jumps over the lazy dog.");
]


let decode_tests = [
   "decode exercism" >::
     ae "exercism" (decode "vcvix rhn");
   "decode a sentence" >::
     ae "anobstacleisoftenasteppingstone" (decode "zmlyh gzxov rhlug vmzhg vkkrm thglm v");
   "decode numbers" >::
     ae "testing123testing" (decode "gvhgr mt123 gvhgr mt");
   "decode all the letters" >::
     ae "thequickbrownfoxjumpsoverthelazydog" (decode "gsvjf rxpyi ldmul cqfnk hlevi gsvoz abwlt");
]

let different_block_size_test = [
  "encode mindblowingly with a different block size" >::
    ae "n r m w y o l d r m t o b" (encode ~block_size:1 "mindblowingly");
]

let () =
  run_test_tt_main (
    "atbash-cipher tests" >:::
      List.concat [encode_tests; decode_tests; different_block_size_test]
  )

Version data entries

150 entries across 150 versions & 1 rubygems

Version Path
trackler-2.1.0.52 tracks/ocaml/exercises/atbash-cipher/test.ml
trackler-2.1.0.51 tracks/ocaml/exercises/atbash-cipher/test.ml
trackler-2.1.0.50 tracks/ocaml/exercises/atbash-cipher/test.ml
trackler-2.1.0.49 tracks/ocaml/exercises/atbash-cipher/test.ml
trackler-2.1.0.48 tracks/ocaml/exercises/atbash-cipher/test.ml
trackler-2.1.0.47 tracks/ocaml/exercises/atbash-cipher/test.ml
trackler-2.1.0.46 tracks/ocaml/exercises/atbash-cipher/test.ml
trackler-2.1.0.45 tracks/ocaml/exercises/atbash-cipher/test.ml
trackler-2.1.0.44 tracks/ocaml/exercises/atbash-cipher/test.ml
trackler-2.1.0.43 tracks/ocaml/exercises/atbash-cipher/test.ml
trackler-2.1.0.42 tracks/ocaml/exercises/atbash-cipher/test.ml
trackler-2.1.0.41 tracks/ocaml/exercises/atbash-cipher/test.ml
trackler-2.1.0.40 tracks/ocaml/exercises/atbash-cipher/test.ml
trackler-2.1.0.39 tracks/ocaml/exercises/atbash-cipher/test.ml
trackler-2.1.0.38 tracks/ocaml/exercises/atbash-cipher/test.ml
trackler-2.1.0.37 tracks/ocaml/exercises/atbash-cipher/test.ml
trackler-2.1.0.36 tracks/ocaml/exercises/atbash-cipher/test.ml
trackler-2.1.0.34 tracks/ocaml/exercises/atbash-cipher/test.ml
trackler-2.1.0.33 tracks/ocaml/exercises/atbash-cipher/test.ml
trackler-2.1.0.32 tracks/ocaml/exercises/atbash-cipher/test.ml