diff options
| author | Sébastien Dailly <sebastien@dailly.me> | 2026-03-27 08:48:05 +0100 |
|---|---|---|
| committer | Sébastien Dailly <sebastien@dailly.me> | 2026-03-27 08:48:05 +0100 |
| commit | 830e7c5d27d161b91402414e6ecd49f1ed818bfb (patch) | |
| tree | 448864635d29b1ea66424cbb9e0816fbcf1e1907 /test/hash.ml | |
Initial commit
Diffstat (limited to 'test/hash.ml')
| -rw-r--r-- | test/hash.ml | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/test/hash.ml b/test/hash.ml new file mode 100644 index 0000000..83f7d5c --- /dev/null +++ b/test/hash.ml @@ -0,0 +1,20 @@ +(** Just a proof of concept. + + Display the hash of the configuration *) + +let name = __FILE__ +let description = "Print the hash of the configuration" +let speclist = [] + +type t = (int, Configuration.Read_conf.error) result + +let pp : Format.formatter -> t -> unit = + Format.pp_print_result ~error:Configuration.Read_conf.pp_error + ~ok:Format.pp_print_int + +let exec : string list -> t = + fun _ -> + let stdin = In_channel.input_all stdin in + let ( let+ ) opt cont = Result.map cont opt in + let+ configuration = Configuration.Read_conf.read_string_conf stdin in + Hashtbl.hash configuration |
