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.29 tracks/ocaml/exercises/atbash-cipher/test.ml
trackler-2.2.1.28 tracks/ocaml/exercises/atbash-cipher/test.ml
trackler-2.2.1.27 tracks/ocaml/exercises/atbash-cipher/test.ml
trackler-2.2.1.26 tracks/ocaml/exercises/atbash-cipher/test.ml
trackler-2.2.1.25 tracks/ocaml/exercises/atbash-cipher/test.ml
trackler-2.2.1.24 tracks/ocaml/exercises/atbash-cipher/test.ml
trackler-2.2.1.23 tracks/ocaml/exercises/atbash-cipher/test.ml
trackler-2.2.1.22 tracks/ocaml/exercises/atbash-cipher/test.ml
trackler-2.2.1.21 tracks/ocaml/exercises/atbash-cipher/test.ml
trackler-2.2.1.20 tracks/ocaml/exercises/atbash-cipher/test.ml
trackler-2.2.1.19 tracks/ocaml/exercises/atbash-cipher/test.ml
trackler-2.2.1.18 tracks/ocaml/exercises/atbash-cipher/test.ml
trackler-2.2.1.17 tracks/ocaml/exercises/atbash-cipher/test.ml
trackler-2.2.1.16 tracks/ocaml/exercises/atbash-cipher/test.ml
trackler-2.2.1.15 tracks/ocaml/exercises/atbash-cipher/test.ml
trackler-2.2.1.14 tracks/ocaml/exercises/atbash-cipher/test.ml
trackler-2.2.1.13 tracks/ocaml/exercises/atbash-cipher/test.ml
trackler-2.2.1.12 tracks/ocaml/exercises/atbash-cipher/test.ml
trackler-2.2.1.11 tracks/ocaml/exercises/atbash-cipher/test.ml
trackler-2.2.1.10 tracks/ocaml/exercises/atbash-cipher/test.ml