mirror of
https://github.com/emilybache/GildedRose-Refactoring-Kata.git
synced 2025-12-12 12:22:12 +00:00
Support texttest with OCaml
This commit is contained in:
parent
50163ec350
commit
8d5803116f
@ -16,6 +16,5 @@
|
||||
(depends
|
||||
(ocaml (>= 4.08))
|
||||
dune
|
||||
ppx_deriving
|
||||
(alcotest (>= 1.7.0))))
|
||||
|
||||
|
||||
@ -12,7 +12,6 @@ bug-reports:
|
||||
depends: [
|
||||
"ocaml" {>= "4.08"}
|
||||
"dune" {>= "3.11"}
|
||||
"ppx_deriving"
|
||||
"alcotest" {>= "1.7.0"}
|
||||
"odoc" {with-doc}
|
||||
]
|
||||
|
||||
@ -1,3 +1,2 @@
|
||||
(library
|
||||
(preprocess (pps ppx_deriving.show))
|
||||
(name gilded_rose))
|
||||
|
||||
@ -1,14 +1,23 @@
|
||||
module Item = struct
|
||||
type t = { name : string; sell_in : int; quality : int } [@@deriving show]
|
||||
type t = { name : string; sell_in : int; quality : int }
|
||||
|
||||
let show { name; sell_in; quality } =
|
||||
Printf.printf "%s, %d, %d" name sell_in quality
|
||||
|
||||
let v name sell_in quality = { name; sell_in; quality }
|
||||
end
|
||||
|
||||
module Items = struct
|
||||
type items = Item.t list [@@deriving show]
|
||||
type items = Item.t list
|
||||
|
||||
let v ?(items = []) () = items
|
||||
let show items : string = show_items items
|
||||
|
||||
let show items =
|
||||
List.iter
|
||||
(fun item ->
|
||||
Item.show item;
|
||||
Printf.printf "\n")
|
||||
items
|
||||
|
||||
let update_quality items =
|
||||
let update_quality_items ({ name; sell_in; quality } as item : Item.t) =
|
||||
|
||||
@ -39,4 +39,7 @@ diff_program:meld
|
||||
#executable:${TEXTTEST_HOME}/php/fixtures/texttest_fixture.php
|
||||
#interpreter:php
|
||||
|
||||
# Settings for the OCaml version
|
||||
# executable:${TEXTTEST_HOME}/ocaml/_build/default/bin/main.exe
|
||||
|
||||
filename_convention_scheme:standard
|
||||
|
||||
Loading…
Reference in New Issue
Block a user