Sha256: 0707c675d612ffc6cedea8d35a57a32870c3091c7b41b6983a6509faf83e8f2a

Contents?: true

Size: 1.47 KB

Versions: 68

Compression:

Stored size: 1.47 KB

Contents

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

open OUnit2
open Atbash_cipher

let ae exp got _test_ctxt = assert_equal ~printer:(fun x -> x) 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

68 entries across 68 versions & 1 rubygems

Version Path
trackler-2.2.1.180 tracks/ocaml/exercises/atbash-cipher/test.ml
trackler-2.2.1.179 tracks/ocaml/exercises/atbash-cipher/test.ml
trackler-2.2.1.178 tracks/ocaml/exercises/atbash-cipher/test.ml
trackler-2.2.1.177 tracks/ocaml/exercises/atbash-cipher/test.ml
trackler-2.2.1.176 tracks/ocaml/exercises/atbash-cipher/test.ml
trackler-2.2.1.175 tracks/ocaml/exercises/atbash-cipher/test.ml
trackler-2.2.1.174 tracks/ocaml/exercises/atbash-cipher/test.ml
trackler-2.2.1.173 tracks/ocaml/exercises/atbash-cipher/test.ml
trackler-2.2.1.172 tracks/ocaml/exercises/atbash-cipher/test.ml
trackler-2.2.1.171 tracks/ocaml/exercises/atbash-cipher/test.ml
trackler-2.2.1.170 tracks/ocaml/exercises/atbash-cipher/test.ml
trackler-2.2.1.169 tracks/ocaml/exercises/atbash-cipher/test.ml
trackler-2.2.1.167 tracks/ocaml/exercises/atbash-cipher/test.ml
trackler-2.2.1.166 tracks/ocaml/exercises/atbash-cipher/test.ml
trackler-2.2.1.165 tracks/ocaml/exercises/atbash-cipher/test.ml
trackler-2.2.1.164 tracks/ocaml/exercises/atbash-cipher/test.ml
trackler-2.2.1.163 tracks/ocaml/exercises/atbash-cipher/test.ml
trackler-2.2.1.162 tracks/ocaml/exercises/atbash-cipher/test.ml
trackler-2.2.1.161 tracks/ocaml/exercises/atbash-cipher/test.ml
trackler-2.2.1.160 tracks/ocaml/exercises/atbash-cipher/test.ml