Skip to content

Commit

Permalink
Convert version tests to cram tests
Browse files Browse the repository at this point in the history
  • Loading branch information
aantron committed Jan 11, 2024
1 parent 012a7bf commit 3d71cf8
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 0 deletions.
10 changes: 10 additions & 0 deletions test/unit/pure/dune
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
(cram
(deps
version.exe
))

(executables
(names
version
)
(libraries luv))
7 changes: 7 additions & 0 deletions test/unit/pure/pure.t
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
$ dune exec ./version.exe
Numeric: 1.47.0
String: 1.47.0
Hex: 0x012F00
version (): 0x012F00
is_release: true
suffix: ""
13 changes: 13 additions & 0 deletions test/unit/pure/version.ml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
(* This file is part of Luv, released under the MIT license. See LICENSE.md for
details, or visit https://github.com/aantron/luv/blob/master/LICENSE.md. *)



let () =
Printf.printf "Numeric: %i.%i.%i\n"
Luv.Version.major Luv.Version.minor Luv.Version.patch;
Printf.printf "String: %s\n" (Luv.Version.string ());
Printf.printf "Hex: 0x%06X\n" Luv.Version.hex;
Printf.printf "version (): 0x%06X\n" (Luv.Version.version ());
Printf.printf "is_release: %b\n" Luv.Version.is_release;
Printf.printf "suffix: %S\n" Luv.Version.suffix

0 comments on commit 3d71cf8

Please # to comment.