-
Notifications
You must be signed in to change notification settings - Fork 696
[clarity-wasm-tests] fix Unchecked(TypeError(UIntType, IntType)) #6204
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
base: feat/clarity-wasm-develop
Are you sure you want to change the base?
[clarity-wasm-tests] fix Unchecked(TypeError(UIntType, IntType)) #6204
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
❌ Your project check has failed because the head coverage (20.49%) is below the target coverage (80.00%). You can increase the head coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## feat/clarity-wasm-develop #6204 +/- ##
=============================================================
- Coverage 20.51% 20.49% -0.02%
=============================================================
Files 528 528
Lines 392169 392169
Branches 323 323
=============================================================
- Hits 80438 80387 -51
- Misses 311723 311774 +51
Partials 8 8
... and 22 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
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.
Too much code duplication. We should instead just assign expected
value to a if cfg!(clarity-wasm) {...} else {...}
.
clarity/src/vm/tests/contracts.rs
Outdated
let contracts = [ | ||
"(define-private (test-func) (get-block-info? time u1))", | ||
"(define-private (test-func) (get-block-info? time block-height))", | ||
"(define-private (test-func) (get-block-info? time u100000))", | ||
"(define-private (test-func) (get-block-info? header-hash u1))", | ||
"(define-private (test-func) (get-block-info? burnchain-header-hash u1))", | ||
"(define-private (test-func) (get-block-info? vrf-seed u1))", | ||
]; |
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.
Why are there only 6 contracts compared to the 8 in the regular test?
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.
Two of them would fail during the Clarity-wasm static analysis pass, but the other six make sense to be validated in a test.
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.
Don't we also get testable errors in this case?
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 is possible, but that would require considerable changes in the code, that is not our intention when dealing with tests.
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.
Actually, I would here argue that the test wasn't very pretty to begin with. How about a refactor which would make it a lot prettier: instead of having two variables with contracts and expected, we could have a single list of tuple (contract, expected). This way, we have no problem using our if cfg!...
, and the testing loop can stop using an index and iterate directly for (contract, expected) in list_of_stuffs {...}
.
ff4e695
to
f410a1a
Compare
f410a1a
to
83a58de
Compare
fix stacks-network/clarity-wasm#677