Sha256: 52bef074f60e13aca419acfcb01c7344ec3b6423420a8b84c44000eacd8366ca

Contents?: true

Size: 1.96 KB

Versions: 96

Compression:

Stored size: 1.96 KB

Contents

open Core.Std
open OUnit2
open Beer_song

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

let tests =
  ["a verse">:: (fun _ ->
     let exp = "8 bottles of beer on the wall, 8 bottles of beer.\nTake one down and pass it around, 7 bottles of beer on the wall.\n" in
     ae exp (verse 8));
   "verse 1">:: (fun _ ->
     let exp = "1 bottle of beer on the wall, 1 bottle of beer.\nTake it down and pass it around, no more bottles of beer on the wall.\n" in
     ae exp (verse 1));
   "verse 2">:: (fun _ ->
     let exp = "2 bottles of beer on the wall, 2 bottles of beer.\nTake one down and pass it around, 1 bottle of beer on the wall.\n" in
     ae exp (verse 2));
   "verse 0">:: (fun _ ->
     let exp = "No more bottles of beer on the wall, no more bottles of beer.\nGo to the store and buy some more, 99 bottles of beer on the wall.\n" in
     ae exp (verse 0));
   "singing several verses">:: (fun _ ->
     let exp = "8 bottles of beer on the wall, 8 bottles of beer.\nTake one down and pass it around, 7 bottles of beer on the wall.\n\n7 bottles of beer on the wall, 7 bottles of beer.\nTake one down and pass it around, 6 bottles of beer on the wall.\n\n6 bottles of beer on the wall, 6 bottles of beer.\nTake one down and pass it around, 5 bottles of beer on the wall.\n\n" in
     ae exp (sing ~from:8 ~until:6));
   "sing all the rest of the verses">:: (fun _ ->
     let exp = "3 bottles of beer on the wall, 3 bottles of beer.\nTake one down and pass it around, 2 bottles of beer on the wall.\n\n2 bottles of beer on the wall, 2 bottles of beer.\nTake one down and pass it around, 1 bottle of beer on the wall.\n\n1 bottle of beer on the wall, 1 bottle of beer.\nTake it down and pass it around, no more bottles of beer on the wall.\n\nNo more bottles of beer on the wall, no more bottles of beer.\nGo to the store and buy some more, 99 bottles of beer on the wall.\n\n" in
     ae exp (sing ~from:3 ~until:0))
  ]

let () =
  run_test_tt_main ("beer-song tests" >::: tests)

Version data entries

96 entries across 96 versions & 1 rubygems

Version Path
trackler-2.0.6.41 tracks/ocaml/exercises/beer-song/test.ml
trackler-2.0.6.40 tracks/ocaml/exercises/beer-song/test.ml
trackler-2.0.6.39 tracks/ocaml/exercises/beer-song/test.ml
trackler-2.0.6.38 tracks/ocaml/exercises/beer-song/test.ml
trackler-2.0.6.37 tracks/ocaml/exercises/beer-song/test.ml
trackler-2.0.6.36 tracks/ocaml/exercises/beer-song/test.ml
trackler-2.0.6.35 tracks/ocaml/exercises/beer-song/test.ml
trackler-2.0.6.34 tracks/ocaml/exercises/beer-song/test.ml
trackler-2.0.6.33 tracks/ocaml/exercises/beer-song/test.ml
trackler-2.0.6.32 tracks/ocaml/exercises/beer-song/test.ml
trackler-2.0.6.31 tracks/ocaml/exercises/beer-song/test.ml
trackler-2.0.6.30 tracks/ocaml/exercises/beer-song/test.ml
trackler-2.0.6.29 tracks/ocaml/exercises/beer-song/test.ml
trackler-2.0.6.28 tracks/ocaml/exercises/beer-song/test.ml
trackler-2.0.6.27 tracks/ocaml/exercises/beer-song/test.ml
trackler-2.0.6.26 tracks/ocaml/exercises/beer-song/test.ml
trackler-2.0.6.25 tracks/ocaml/exercises/beer-song/test.ml
trackler-2.0.6.24 tracks/ocaml/exercises/beer-song/test.ml
trackler-2.0.6.23 tracks/ocaml/exercises/beer-song/test.ml
trackler-2.0.6.22 tracks/ocaml/exercises/beer-song/test.ml