I wanted to try the Bank kata in OCaml and play a bit with ppx_expect
but I’ve ran into a strange issue, that I’m not sure if it’s a bug or something I’ve done wrong.
I’m on linux, with opam 2.0 and ocaml 4.07.0
So I have a file lib/Account.ml
:
let create () = ()
let deposit _ _ = ()
let withdrawal _ _ = ()
let print _ =
print_endline "TODO"
and a test: test/AccountTest.ml
:
open! Base
open! Stdio
let%expect_test "Printing the statements should contain all transactions" =
Lib.Account.create ()
|> Lib.Account.deposit 500
|> Lib.Account.withdrawal 200
|> Lib.Account.print;
[%expect{| |}]
now when I run dune runtest
the first time everything is ok. If I now change TODO
to something else and run dune runtest
again I get the following error:
...
File "_none_", line 1:
Error: Files test/test.cmxa and lib/lib.cmxa
make inconsistent assumptions over implementation Lib__Account
If I remove _build/default/test
then everything works fine again, but as soon as I change something again I get the same error.
Am I doing something wrong or is this a bug? And if it is a bug, any idea where I should report it?