-
Notifications
You must be signed in to change notification settings - Fork 159
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
irmin.type: test the pp_ty
operation
#968
Conversation
Rebased. |
246191b
to
5ab226a
Compare
in | ||
|
||
(* Test cases for basic types *) | ||
test "unit" T.unit "Prim Unit"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is Prim
really necessary here? Maybe the printer should just omit these.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed 🙂 I've included this in my list of suggestions in the PR description.
I think it's good to test the existing behaviour first.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hum yes I jumped directly to the code without reading the description, feel free to ignore my comments ;-)
test "array {size=3}" T.(array ~len:(`Fixed 3) unit) "Array:<3> (Prim Unit)"; | ||
|
||
(* Test cases for algebraic combinators *) | ||
test "enum" Algebraic.my_enum_t "Variant"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want to be a bit more precise for variants and records? I guess these printers are just for debugging anyway, but we could imagine extending them one day to become proper schemas, and having a precise printer would help parsing. I agree this is clearly not very urgent to do :-)
Thanks! Let's do the improvement in new PRs as the current one already improved the current situation quite a bit. |
Resolves #959. In the same vein as #965, test the behaviour of the
Irmin.Type.pp_ty
operation. Found and fixed a format string bug in doing so.Shares a LCA with #965 for the
ppx_irmin
dependency.Some thoughts about the current behaviour:
Prim
node could be skipped during pretty-printing;Custom (foo)
is reallyLike (foo)
from a user perspective;int list
rather thanList (Prim Int)
).