diff options
| author | ยท๐๐ด๐๐๐ฉ๐ค | 2025-12-10 20:39:01 +0000 |
|---|---|---|
| committer | ยท๐๐ด๐๐๐ฉ๐ค | 2025-12-10 20:39:01 +0000 |
| commit | 2b69aa9def94d45b641d266bf9b3549e384bd7a1 (patch) | |
| tree | 32f39bceaab525db8506dc2e3466214775afece4 /lib | |
| parent | 67370de49dad3ab220adea26f67493beb20a2178 (diff) | |
| download | nixtaml-2b69aa9def94d45b641d266bf9b3549e384bd7a1.tar nixtaml-2b69aa9def94d45b641d266bf9b3549e384bd7a1.tar.gz nixtaml-2b69aa9def94d45b641d266bf9b3549e384bd7a1.tar.bz2 nixtaml-2b69aa9def94d45b641d266bf9b3549e384bd7a1.tar.lz nixtaml-2b69aa9def94d45b641d266bf9b3549e384bd7a1.tar.xz nixtaml-2b69aa9def94d45b641d266bf9b3549e384bd7a1.tar.zst nixtaml-2b69aa9def94d45b641d266bf9b3549e384bd7a1.zip | |
add more eq
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/input.ml | 34 | ||||
| -rw-r--r-- | lib/lockfile.ml | 24 | ||||
| -rw-r--r-- | lib/manifest.ml | 24 |
3 files changed, 41 insertions, 41 deletions
diff --git a/lib/input.ml b/lib/input.ml index 3e9fd0f..1aed440 100644 --- a/lib/input.ml +++ b/lib/input.ml @@ -10,7 +10,7 @@ module Template = struct type t = Template of string [@@unboxed] - [@@deriving show, qcheck] + [@@deriving show, eq, qcheck] let [@inline]make t = Template t let [@inline]take (Template t) = t @@ -22,16 +22,16 @@ module Latest = struct module Cmd = struct type 'a non_empty_list = ('a * 'a list) - [@@deriving show, qcheck] + [@@deriving show, eq, qcheck] type cmd = { prog: Template.t; args: Template.t list; } - [@@deriving show, make, qcheck] + [@@deriving show, eq, make, qcheck] type t = cmd non_empty_list - [@@deriving show, qcheck] + [@@deriving show, eq, qcheck] let (~$) x = (x, []) let (|:) (x, xs) x' = (x, x' :: xs) @@ -42,7 +42,7 @@ module Latest = struct cmd: Cmd.t option; value: string option; } - [@@deriving show, make, qcheck] + [@@deriving show, eq, make, qcheck] end (* KINDS **********************************************************************) @@ -52,7 +52,7 @@ module File = struct url: Template.t; mirrors: Template.t list; } - [@@deriving show, make, qcheck] + [@@deriving show, eq, make, qcheck] end module Archive = struct @@ -60,7 +60,7 @@ module Archive = struct url: Template.t; mirrors: Template.t list; } - [@@deriving show, make, qcheck] + [@@deriving show, eq, make, qcheck] end module Git = struct @@ -69,7 +69,7 @@ module Git = struct | `Branch of string | `Ref of string ] - [@@deriving show, qcheck] + [@@deriving show, eq, qcheck] end type t = { @@ -81,7 +81,7 @@ module Git = struct lfs: bool; [@default false] latest_revision: string option; } - [@@deriving show, make, qcheck] + [@@deriving show, eq, make, qcheck] let default_latest_cmd git : Latest.Cmd.t = let open Latest.Cmd in @@ -102,13 +102,13 @@ module Darcs = struct | `Assumed of string option | `Stated of string ] - [@@deriving show, qcheck] + [@@deriving show, eq, qcheck] type t = [ | `Context of context_grounds | `Tag of string ] - [@@deriving show, qcheck] + [@@deriving show, eq, qcheck] end type t = { @@ -118,7 +118,7 @@ module Darcs = struct datetime: string option; (* ISO 8601 RFC 3339 *) latest_weak_hash: string option; } - [@@deriving show, make, qcheck] + [@@deriving show, eq, make, qcheck] let pp fmt t = Fmt.pf fmt "%s" (show t) end @@ -130,7 +130,7 @@ module Pijul = struct | `State of string | `Change of string ] - [@@deriving show, qcheck] + [@@deriving show, eq, qcheck] end type t = { @@ -140,7 +140,7 @@ module Pijul = struct datetime: string option; (* ISO 8601 RFC 3339 *) latest_state: string option; } - [@@deriving show, make, qcheck] + [@@deriving show, eq, make, qcheck] end module Hash = struct @@ -175,7 +175,7 @@ module Hash = struct (* used to assert in fetching for manually-updated pins *) expected: string option; } - [@@deriving show, make, qcheck] + [@@deriving show, eq, make, qcheck] end (* INPUT *******************************************************************) @@ -188,7 +188,7 @@ module Kind = struct | `Darcs of Darcs.t | `Pijul of Pijul.t ] - [@@deriving show, qcheck] + [@@deriving show, eq, qcheck] end let make_kind_file ~url ?mirrors () = @@ -215,7 +215,7 @@ type t = { hash: Hash.t; [@default Hash.make ()] frozen: bool; [@default false] } -[@@deriving show, make, qcheck] +[@@deriving show, eq, make, qcheck] let latest_cmd (input : t) : Latest.Cmd.t option = match input.latest.cmd with diff --git a/lib/lockfile.ml b/lib/lockfile.ml index e109312..cbafc27 100644 --- a/lib/lockfile.ml +++ b/lib/lockfile.ml @@ -29,7 +29,7 @@ module File = struct url: Uri.t; mirrors: Uri.t list; } - [@@deriving show, qcheck] + [@@deriving show, eq, qcheck] let [@inline]to_lock ~(models : Input.jg_models2) @@ -57,7 +57,7 @@ module Archive = struct url: Uri.t; mirrors: Uri.t list; } - [@@deriving show, qcheck] + [@@deriving show, eq, qcheck] let [@inline]to_lock ~(models : Input.jg_models2) ({url; mirrors; _}: Input.Archive.t) : t = let to_uri = Fun.compose Uri.of_string (Input.Template.fill ~models) in @@ -114,7 +114,7 @@ module Git = struct lfs: bool; latest_revision: string option; } - [@@deriving show, qcheck] + [@@deriving show, eq, qcheck] let [@inline]to_lock ~(models : Input.jg_models2) @@ -152,7 +152,7 @@ end module Darcs = struct module Reference = struct type t = Input.Darcs.Reference.t - [@@deriving show, qcheck] + [@@deriving show, eq, qcheck] let jsont : t Jsont.t = let open Jsont in @@ -207,7 +207,7 @@ module Darcs = struct reference: Reference.t; latest_weak_hash: string option; } - [@@deriving show, qcheck] + [@@deriving show, eq, qcheck] let [@inline]to_lock ~(models : Input.jg_models2) @@ -276,7 +276,7 @@ module Pijul = struct (*reference: Reference.t;*) latest_state: string option; } - [@@deriving show, qcheck] + [@@deriving show, eq, qcheck] let [@inline]to_lock ~(models : Input.jg_models2) @@ -312,7 +312,7 @@ module Kind = struct | `Darcs of Darcs.t | `Pijul of Pijul.t ] - [@@deriving show, qcheck] + [@@deriving show, eq, qcheck] let to_lock ~(models : Input.jg_models2) : Input.Kind.t -> t = function | `File f -> `File (File.to_lock ~models f) @@ -362,7 +362,7 @@ end module Hash = struct type algorithm = Input.Hash.algorithm - [@@deriving show, qcheck] + [@@deriving show, eq, qcheck] let algorithm_jsont = let gen_algo i = @@ -378,7 +378,7 @@ module Hash = struct algorithm: algorithm; value: string option; } - [@@deriving show, qcheck] + [@@deriving show, eq, qcheck] let [@inline]to_lock ({algorithm; value; _}: Input.Hash.t) : t = {algorithm; value} @@ -399,7 +399,7 @@ module Input' = struct hash: Hash.t; latest_value: string option; } - [@@deriving show, qcheck] + [@@deriving show, eq, qcheck] let [@inline]to_lock ~(models : Input.jg_models2) (input : Input.t) : t = { kind = Kind.to_lock ~models input.kind; @@ -417,13 +417,13 @@ module Input' = struct end type inputs = Input'.t NameMap.t -[@@deriving show, qcheck] +[@@deriving show, eq, qcheck] type t = { version: string; inputs: inputs; } -[@@deriving show, qcheck] +[@@deriving show, eq, qcheck] let lockfile : t option ref = ref None diff --git a/lib/manifest.ml b/lib/manifest.ml index 68d5690..725cbc5 100644 --- a/lib/manifest.ml +++ b/lib/manifest.ml @@ -39,7 +39,7 @@ module File = struct url: Template.t; mirrors: Template.t list; } - [@@deriving show, make, qcheck] + [@@deriving show, eq, make, qcheck] let [@inline]to_manifest ({url; mirrors; _}: Input.File.t) : t = make ~url ~mirrors () @@ -78,7 +78,7 @@ module Archive = struct url: Template.t; mirrors: Template.t list; } - [@@deriving show, make, qcheck] + [@@deriving show, eq, make, qcheck] let [@inline]to_manifest ({url; mirrors; _}: Input.Archive.t) : t = make ~url ~mirrors () @@ -115,7 +115,7 @@ end module Git = struct module Reference = struct type t = Input.Git.Reference.t - [@@deriving show, qcheck] + [@@deriving show, eq, qcheck] let codec : t Util.KDL.node_codec = { to_node = (fun ref -> @@ -147,7 +147,7 @@ module Git = struct submodules: bool; [@default false] lfs: bool; [@default false] } - [@@deriving show, make, qcheck] + [@@deriving show, eq, make, qcheck] let [@inline]to_manifest ({repository; mirrors; reference; submodules; lfs; _}: Input.Git.t) : t = make ~repository ~mirrors ~reference ~submodules ~lfs () @@ -209,7 +209,7 @@ end module Darcs = struct module Reference = struct type t = Input.Darcs.Reference.t - [@@deriving show, qcheck] + [@@deriving show, eq, qcheck] let codec : t Util.KDL.codec = { to_kdl = (fun ref -> @@ -240,7 +240,7 @@ module Darcs = struct mirrors: Template.t list; reference: Reference.t; } - [@@deriving show, make, qcheck] + [@@deriving show, eq, make, qcheck] let [@inline]to_manifest ({repository; mirrors; reference; _}: Input.Darcs.t) : t = make ~repository ~mirrors ~reference () @@ -281,7 +281,7 @@ end module Pijul = struct module Reference = struct type t = Input.Pijul.Reference.t - [@@deriving show, qcheck] + [@@deriving show, eq, qcheck] let codec : t Util.KDL.node_codec = { to_node = (fun ref -> @@ -314,7 +314,7 @@ module Pijul = struct mirrors: Template.t list; reference: Reference.t; } - [@@deriving show, make, qcheck] + [@@deriving show, eq, make, qcheck] let [@inline]to_manifest ({remote; mirrors; reference; _}: Input.Pijul.t) : t = make ~remote ~mirrors ~reference () @@ -360,7 +360,7 @@ module Hash = struct algorithm: Input.Hash.algorithm; [@default Input.Hash.default_algorithm] expected: string option; } - [@@deriving show, make, qcheck] + [@@deriving show, eq, make, qcheck] let [@inline]to_manifest ({algorithm; expected; _}: Input.Hash.t) : t = make ~algorithm ?expected () @@ -441,7 +441,7 @@ module Kind = struct | `Darcs of Darcs.t | `Pijul of Pijul.t ] - [@@deriving show, qcheck] + [@@deriving show, eq, qcheck] let to_manifest : Input.Kind.t -> t = function | `File f -> `File (File.to_manifest f) @@ -498,7 +498,7 @@ module Input' = struct hash: Hash.t; frozen: bool; [@default false] } - [@@deriving show, make, qcheck] + [@@deriving show, eq, make, qcheck] let [@inline]to_manifest (input : Input.t) : t = { name = input.name; @@ -623,7 +623,7 @@ type t = { version: string; inputs: Input'.t list; } -[@@deriving show, make, qcheck] +[@@deriving show, eq, make, qcheck] let document_to_t (doc : Kdl.t) : t Util.KDL.Valid.t = let open Util.KDL.L in |
