-
Notifications
You must be signed in to change notification settings - Fork 145
Add support for unit tests via $[test] attribute
#928
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
Conversation
Still TODO: * Documentation * Verify the type is `unit -> unit` for functions where this is applied. * Tests * Other backends?? * Output formatting isn't quite right; not sure why.
Test Results 12 files ± 0 24 suites ±0 0s ⏱️ ±0s For more details on these errors, see this check. Results for commit 59d29e3. ± Comparison against base commit e7f1262. ♻️ This comment has been updated with latest results. |
|
Yes, that looks like the right way to go. |
| | None -> () | ||
| end; | ||
| (* Check $[test] functions have type unit -> unit. *) | ||
| (* TODO: Does the annotation go on the type declaration or the function definition? *) |
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.
I think in general we put these annotations on the val type declarations. That's where $[property] and $[counterexample] are expected to be.
If you have a function with an inline annotation:
$[annot]
function f(x : int) -> unit = ...
it'll get expanded to
$[annot]
val f : int -> unit
$[annot]
function f(x) = ...
with the annotation on both.
| let end_extern_cpp = separate hardline (List.map string [""; "#ifdef __cplusplus"; "}"; "#endif"]) in | ||
| let hlhl = hardline ^^ hardline in | ||
|
|
||
| (* TODO: Formatting here isn't quite right. What are the arguments to jump? *) |
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.
It's explained a bit here https://github.com/fpottier/pprint/blob/767ef4ae0d5de95b21e0d650e8bb752830d75a47/src/PPrint.mli#L163
|
I think this change has probably broken this PR: #960 I can fix if you like? |
|
Ah that's a nice change. Don't worry, I'll try and figure it out. You have more important things to do! |
…ms-project#928) From section 12.2.1 of the priv spec: > For implementations that make satp.MODE read-only zero (always Bare), attempts to execute an SFENCE.VMA instruction might raise an illegal-instruction exception.
Draft for #919, just checking if this approach makes sense.
Still TODO:
unit -> unitfor functions where this is applied.