add amount
This commit is contained in:
parent
19a05f84e7
commit
d5eaf6d92f
4 changed files with 98 additions and 15 deletions
15
test/test.ml
15
test/test.ml
|
|
@ -18,3 +18,18 @@ let () =
|
|||
check_bad Timestamp.jsont {|{"t_s": "123456780"}|};
|
||||
check_bad Timestamp.jsont {|{"t_s": "agagou"}|};
|
||||
()
|
||||
|
||||
let () =
|
||||
let open Types.Amount in
|
||||
let v =
|
||||
{
|
||||
sign= Some `Plus
|
||||
; currency= `Eur
|
||||
; value= Int64.of_int 25
|
||||
; fraction= Int64.of_int 678
|
||||
}
|
||||
in
|
||||
let s = to_string v in
|
||||
let v' = of_string s |> Result.get_ok in
|
||||
assert (v = v');
|
||||
()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue