Normalise shared field prefixes at underscore boundaries
This commit is contained in:
2 files changed
+35
-3
No files matched your search
@@ -52,3 +52,20 @@ let () =
|
||||
assert (view focus changed = 8 && Swatch.label changed = "grey");
|
||||
assert (set focus (view focus original) original = original);
|
||||
assert (set Box._contents "grey" Box.{ contents = 9 } = Box.{ contents = "grey" })
|
||||
|
||||
module Prefixed = struct
|
||||
type t = { paint_colour_red : int; paint_colour_green : int } [@@fieldglass generate]
|
||||
end
|
||||
|
||||
module Unprefixed = struct
|
||||
type t = { yes : bool; yellow : bool } [@@fieldglass generate]
|
||||
end
|
||||
|
||||
module Single = struct
|
||||
type t = { paint_red : int } [@@fieldglass generate]
|
||||
end
|
||||
|
||||
let () =
|
||||
assert (Prefixed.red Prefixed.{ paint_colour_red = 3; paint_colour_green = 4 } = 3);
|
||||
assert (Unprefixed.yes Unprefixed.{ yes = true; yellow = false });
|
||||
assert (Single.paint_red Single.{ paint_red = 3 } = 3)
|
||||
Reference in new issue
Block a user