Add initial test

This commit is contained in:
Maiste 2023-10-19 14:03:12 +02:00
parent c7bdcb974c
commit 5f97fd6e34
No known key found for this signature in database
GPG Key ID: 030C4ED753794A0E
4 changed files with 18 additions and 2 deletions

View File

@ -15,5 +15,7 @@
(description "The Gilded Rose Refactoring Kata in OCaml")
(depends
(ocaml (>= 4.08))
dune))
dune
ppx_deriving
(alcotest (>= 1.7.0))))

View File

@ -12,6 +12,8 @@ bug-reports:
depends: [
"ocaml" {>= "4.08"}
"dune" {>= "3.11"}
"ppx_deriving"
"alcotest" {>= "1.7.0"}
"odoc" {with-doc}
]
build: [

View File

@ -1,2 +1,3 @@
(test
(name gilded_rose))
(name gilded_rose)
(libraries gilded_rose alcotest))

View File

@ -0,0 +1,11 @@
open Gilded_rose
let test () =
let items = Items.v ~items:[ Item.v "Foo" 10 20 ] () in
Alcotest.(check string)
"Broken test" "Fixme"
(List.hd items |> fun item -> item.name)
let () =
let open Alcotest in
run "Gilded Rose" [ ("Our first test", [ test_case "fixme" `Quick test ]) ]