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.2.1.9 tracks/ocaml/exercises/atbash-cipher/test.ml
trackler-2.2.1.8 tracks/ocaml/exercises/atbash-cipher/test.ml
trackler-2.2.1.7 tracks/ocaml/exercises/atbash-cipher/test.ml
trackler-2.2.1.6 tracks/ocaml/exercises/atbash-cipher/test.ml
trackler-2.2.1.5 tracks/ocaml/exercises/atbash-cipher/test.ml
trackler-2.2.1.4 tracks/ocaml/exercises/atbash-cipher/test.ml
trackler-2.2.1.3 tracks/ocaml/exercises/atbash-cipher/test.ml
trackler-2.2.1.2 tracks/ocaml/exercises/atbash-cipher/test.ml
trackler-2.2.1.1 tracks/ocaml/exercises/atbash-cipher/test.ml
trackler-2.2.1.0 tracks/ocaml/exercises/atbash-cipher/test.ml
trackler-2.2.0.6 tracks/ocaml/exercises/atbash-cipher/test.ml
trackler-2.2.0.5 tracks/ocaml/exercises/atbash-cipher/test.ml
trackler-2.2.0.4 tracks/ocaml/exercises/atbash-cipher/test.ml
trackler-2.2.0.3 tracks/ocaml/exercises/atbash-cipher/test.ml
trackler-2.2.0.2 tracks/ocaml/exercises/atbash-cipher/test.ml
trackler-2.2.0.1 tracks/ocaml/exercises/atbash-cipher/test.ml
trackler-2.2.0.0 tracks/ocaml/exercises/atbash-cipher/test.ml
trackler-2.1.0.55 tracks/ocaml/exercises/atbash-cipher/test.ml
trackler-2.1.0.54 tracks/ocaml/exercises/atbash-cipher/test.ml
trackler-2.1.0.53 tracks/ocaml/exercises/atbash-cipher/test.ml