10
1
mirror of https://gitlab.com/scemama/QCaml.git synced 2024-12-23 12:53:46 +01:00
QCaml/particles/test/nuclei.ml

24 lines
729 B
OCaml
Raw Normal View History

2020-12-29 18:06:54 +01:00
(* Tests *)
2021-01-01 16:39:33 +01:00
(* [[file:~/QCaml/particles/nuclei.org::*Tests][Tests:1]] *)
2020-10-09 09:47:57 +02:00
open Common
open Particles
2020-09-26 12:02:53 +02:00
open Alcotest
2020-10-09 09:47:57 +02:00
let wd = Common.Qcaml.root ^ Filename.dir_sep ^ "test"
2020-09-26 12:02:53 +02:00
let test_xyz molecule length repulsion charge core =
let xyz = Nuclei.of_xyz_file (wd^Filename.dir_sep^molecule^".xyz") in
check int "length" length (Array.length xyz);
check (float 1.e-4) "repulsion" repulsion (Nuclei.repulsion xyz);
check int "charge" charge (Charge.to_int @@ Nuclei.charge xyz);
check int "small_core" core (Nuclei.small_core xyz);
()
let tests = [
"caffeine", `Quick, (fun () -> test_xyz "caffeine" 24 917.0684 102 28);
"water", `Quick, (fun () -> test_xyz "water" 3 9.19497 10 2);
]
2020-12-29 18:06:54 +01:00
(* Tests:1 ends here *)