summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorยท๐‘‘๐‘ด๐‘•๐‘‘๐‘ฉ๐‘ค2025-12-11 17:39:31 +0000
committerยท๐‘‘๐‘ด๐‘•๐‘‘๐‘ฉ๐‘ค2025-12-11 17:39:31 +0000
commita0bd1aa8ea87054e9b240b9ea2a2b8ce44193824 (patch)
tree4fb777bf1d85c5d784ac99710d51b5bf42574328 /test
parenta9d4d2402d20617d27bf5b1bbc510f5f90890c09 (diff)
downloadnixtaml-a0bd1aa8ea87054e9b240b9ea2a2b8ce44193824.tar
nixtaml-a0bd1aa8ea87054e9b240b9ea2a2b8ce44193824.tar.gz
nixtaml-a0bd1aa8ea87054e9b240b9ea2a2b8ce44193824.tar.bz2
nixtaml-a0bd1aa8ea87054e9b240b9ea2a2b8ce44193824.tar.lz
nixtaml-a0bd1aa8ea87054e9b240b9ea2a2b8ce44193824.tar.xz
nixtaml-a0bd1aa8ea87054e9b240b9ea2a2b8ce44193824.tar.zst
nixtaml-a0bd1aa8ea87054e9b240b9ea2a2b8ce44193824.zip
QCheck input sameshape
Diffstat (limited to 'test')
-rw-r--r--test/test_input.ml25
1 files changed, 25 insertions, 0 deletions
diff --git a/test/test_input.ml b/test/test_input.ml
index a9c63a9..92eb308 100644
--- a/test/test_input.ml
+++ b/test/test_input.ml
@@ -153,4 +153,29 @@ let suite =
| Error err ->
QCheck.Test.fail_reportf "%a" Fmt.(list ~sep: semi Util.KDL.Valid.pp_err) err;
);
+ QCheck.Test.make
+ ~name: "Input sameshape"
+ (QCheck.make ~print: (Fmt.str "%a" Input.pp) Input.gen)
+ (fun input ->
+ let manifest_input =
+ Manifest.Input'.to_manifest input
+ and lockfile_input =
+ let models = Input.jg_models2 input in
+ Lockfile.Input'.to_lock ~models input
+ in
+ let melded =
+ meld_input_with_lock
+ (Manifest.Input'.of_manifest manifest_input)
+ lockfile_input
+ in
+ if melded = input then
+ true
+ else
+ QCheck.Test.fail_reportf
+ "Aimed for:@,%a@.@.But got:@,%a@."
+ Input.pp
+ input
+ Input.pp
+ melded
+ );
]