Conversation
- TestSend -> send.num - TestVariablesJSON -> variables-json.num - TestPortionSyntax -> portion-syntax.num - TestBadPortionSyntax -> bad-portion-syntax.num - TestSource -> source.num - TestAllocation -> allocation.num - TestDynamicAllocation -> dynamic-allocation.num - TestSendAll -> send-all.num - TestSendAllWhenNegative -> send-all-when-negative.num - TestSendAllWhenNegativeWithOverdraft -> send-all-negative-with-overdraft.num All tests follow the specs.schema.json format and exclude grouped tests with multiple t.Run() calls. Co-Authored-By: alessandro@formance.com <alessandro@formance.com>
Migrated tests: - TestSendAllVariable -> send-all-variable.num - TestSendAlltMaxWhenNoAmount -> send-all-max-when-no-amount.num - TestNegativeMaxSendAll -> negative-max-send-all.num - TestNegativeMax -> negative-max.num - TestSendAllDestinatioAllot -> send-all-destination-allot.num - TestSendAllDestinatioAllotComplex -> send-all-destination-allot-complex.num - TestOverdraftInSendAll -> overdraft-in-send-all.num - TestOverdraftInSendAllWhenNoop -> overdraft-in-send-all-when-noop.num - TestSendAlltMaxInSrc -> send-all-max-in-src.num - TestSendAlltMaxInDest -> send-all-max-in-dest.num - TestManyMaxDest -> many-max-dest.num - TestManyKeptDest -> many-kept-dest.num - TestSendAllManyMaxInDest -> send-all-many-max-in-dest.num - TestSendAllMulti -> send-all-multi.num - TestInsufficientFunds -> insufficient-funds.num - TestWorldSource -> world-source.num - TestNoEmptyPostings -> no-empty-postings.num - TestEmptyPostings -> empty-postings.num - TestAllocateDontTakeTooMuch -> allocate-dont-take-too-much.num - TestMetadata -> metadata.num - TestTrackBalances -> track-balances.num - TestTrackBalances2 -> track-balances2.num - TestKeptInSendAllInorder -> kept-in-send-all-inorder.num - TestRemainingKeptInSendAllInorder -> remaining-kept-in-send-all-inorder.num - TestTrackBalancesSendAll -> track-balances-send-all.num - TestTrackBalances3 -> track-balances3.num - TestSourceAllotment -> source-allotment.num - TestVariablePortionPart -> variable-portion-part.num - TestSourceAllotmentInvalidAmt -> source-allotment-invalid-amt.num - TestSourceOverlapping -> source-overlapping.num - TestCappedWhenMoreThanBalance -> capped-when-more-than-balance.num - TestCappedWhenLessThanNeeded -> capped-when-less-than-needed.num - TestSourceComplex -> source-complex.num - TestKeptInorder -> kept-inorder.num - TestRemainingKeptInorder -> remaining-kept-inorder.num - TestKeptWithBalance -> kept-with-balance.num - TestRemainingNone -> remaining-none.num - TestRemainingNoneInSendAll -> remaining-none-in-send-all.num - TestDestinationComplex -> destination-complex.num - TestSendZero -> send-zero.num - TestBalance -> balance.num - TestBalanceNotFound -> balance-not-found.num - TestInoderDestination -> inorder-destination.num - TestBalanceSimple -> balance-simple.num - TestAskBalanceTwice -> ask-balance-twice.num Skipped grouped tests and tests with non-MissingFundsErr errors as requested. All files follow the specs.schema.json format. Co-Authored-By: alessandro@formance.com <alessandro@formance.com>
- Added 16 more test migrations with exact script copies - Removed problematic big-int and invalid-number-literal tests with extremely long numbers - All scripts copied exactly from interpreter_test.go without modifications Co-Authored-By: alessandro@formance.com <alessandro@formance.com>
- Added arithmetic operations: add-monetaries-same-currency, add-numbers, sub-numbers, sub-monetaries - Added oneof feature tests: oneof-in-source, oneof-all-failing, oneof-in-send-all, oneof-singleton, oneof-destination-first-clause - All scripts copied exactly from interpreter_test.go without modifications - Skipped error tests that expect non-MissingFundsErr errors Co-Authored-By: alessandro@formance.com <alessandro@formance.com>
- Added oneof destination tests: oneof-destination-second-clause, oneof-destination-remaining-clause - Added account interpolation test: account-interp - Added midscript balance tests: midscript-balance, midscript-balance-after-decrease - Added expression and function tests: expr-in-var-origin, get-asset-function, get-amount-function - All scripts copied exactly from interpreter_test.go without modifications - Skipped error tests that expect non-MissingFundsErr errors Co-Authored-By: alessandro@formance.com <alessandro@formance.com>
- Added color send tests: color-send, color-send-overdraft - Added color balance restriction tests: color-restrict-balance, color-restrict-balance-when-missing-funds - All scripts copied exactly from interpreter_test.go without modifications - Continued systematic migration of remaining tests Co-Authored-By: alessandro@formance.com <alessandro@formance.com>
- Added color-restriction-in-send-all test - Added color-inorder test with multiple color sources - All scripts copied exactly from interpreter_test.go without modifications - Continued systematic migration of remaining tests Co-Authored-By: alessandro@formance.com <alessandro@formance.com>
- Added color-inorder-send-all test - Added no-double-spending-in-colored-send-all test - Added no-double-spending-in-colored-send test - Added empty-color test - All scripts copied exactly from interpreter_test.go without modifications - Continued systematic migration of remaining tests Co-Authored-By: alessandro@formance.com <alessandro@formance.com>
- Added color-with-asset-precision test - Added update-balances test - All scripts copied exactly from interpreter_test.go without modifications - Continued systematic migration of remaining tests Co-Authored-By: alessandro@formance.com <alessandro@formance.com>
- Added update-balances-with-oneof test - Added send-when-negative-balance test - Added overdraft-when-negative-overdraft-in-send-all test - Added overdraft-when-negative-balance-in-send-all test - Added overdraft-when-negative-balance test - Added do-not-exceed-overdraft test - All scripts copied exactly from interpreter_test.go without modifications - Continued systematic migration of remaining tests Co-Authored-By: alessandro@formance.com <alessandro@formance.com>
- Added do-not-exceed-overdraft-on-send-all test - Added do-not-exceed-overdraft-when-double-spending test - All scripts copied exactly from interpreter_test.go without modifications - Completed systematic migration of remaining valid tests Co-Authored-By: alessandro@formance.com <alessandro@formance.com>
- Fixed script to use exact copy from TestZeroPostingsDestination - Corrected JSON posting format to match original CaseResult.Postings - Script now properly uses max [COIN 0] to @d1 with remaining to @D2 - Expected posting correctly shows COIN 100 from world to d2 Co-Authored-By: alessandro@formance.com <alessandro@formance.com>
…ons exactly - zero-postings.num: use correct script with @A and @world sources, amount 100 - zero-postings-explicit-inorder.num: use correct script with @A, @b, @c sources, amount 0 - zero-postings-explicit-allotment.num: use correct script with 1/2 from @A and @b sources, amount 0 All scripts now match their corresponding test functions in interpreter_test.go exactly. Co-Authored-By: alessandro@formance.com <alessandro@formance.com>
…ngs expected postings - Fixed expect.postings to include proper posting object instead of empty array - Posting now correctly shows asset: COIN, amount: 100, source: world, destination: dest - Matches original CaseResult.Postings from TestZeroPostings function exactly Co-Authored-By: alessandro@formance.com <alessandro@formance.com>
…ons exactly - balance-simple.num: Use USD/2 asset and @alice account instead of COIN/@world - balance-not-found.num: Use EUR/2 asset and @A account instead of COIN/@src - Add proper expected postings for balance-simple test - Both tests now match their original TestBalanceSimple and TestBalanceNotFound functions Co-Authored-By: alessandro@formance.com <alessandro@formance.com>
…wice function - Script uses USD/2 asset instead of COIN - JSON specs updated to match with USD/2 asset and amount 10 - Now matches original TestAskBalanceTwice function exactly Co-Authored-By: alessandro@formance.com <alessandro@formance.com>
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. 🗂️ Base branches to auto review (1)
Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the ✨ Finishing Touches🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## feat/specs-format #75 +/- ##
=====================================================
+ Coverage 65.98% 66.02% +0.04%
=====================================================
Files 39 39
Lines 4662 4662
=====================================================
+ Hits 3076 3078 +2
+ Misses 1452 1451 -1
+ Partials 134 133 -1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Bug: Snapshot Fix Uses Incorrect Assertion Field
The fixSnapshot function incorrectly uses failedAssertion.Expected in its switch statement to identify the assertion type. This comparison is flawed as failedAssertion.Expected contains the expected value, not the assertion name. It should use failedAssertion.Assertion. Consequently, the attempt to update t.ExpectPostings with failedAssertion.Expected.([]interpreter.Posting) is also incorrect; failedAssertion.Expected is the string "expect.postings" in this context, causing a runtime panic. The snapshot should be updated using failedAssertion.Got.
internal/cmd/test.go#L71-L75
numscript/internal/cmd/test.go
Lines 71 to 75 in c660580
Bug: Test Failure Flag Inverts Logic
The isTestFailed flag, used to count failed test files, has inverted logic. It currently checks if any test case passed (tc.Pass), causing files with passing tests to be incorrectly marked as failed. It should check if any test case failed (!tc.Pass).
internal/cmd/test.go#L265-L272
numscript/internal/cmd/test.go
Lines 265 to 272 in c660580
Was this report helpful? Give feedback by reacting with 👍 or 👎
2293b4f to
5d93aca
Compare
No description provided.