test(facade): pin empty-input round-trip uniformly across all codecs (#70)#71
Conversation
|
Warning Rate limit exceeded
You’ve run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
Summary
Pins the empty-input round-trip contract uniformly across all 32 facade pairs in
yabase/facade. Without this test, a future refactor could silently flip the rule for one codec; with it, that surfaces as a single-test diff. Closes #70. Companion to yabase#63 / #64 / #65 (which all addressed non-empty inputs).Changes
test/empty_input_round_trip_test.gleam(new): one test per facade pair, asserting:encode_*:decode_*(encode_*(<<>>)) == Ok(<<>>).Result-returning encoders (encode_z85,encode_rfc1924_base85):let assert Ok(encoded) = encode_*(<<>>)then the same round-trip onencoded.decode_*("") == Ok(<<>>)directly.CHANGELOG.md: notes the new test under[Unreleased].Design Decisions
forall_round_trip: metamon is not a dev-dep of yabase, and the empty case is a single fixed input — aforallover input length would just amplify the work for a constant whose answer the test is defining. Listing every facade pair makes adding a new codec obviously incomplete (the new pair has to be added here too).decode("")only pinned for the RFC 4648 family: non-RFC-4648 codecs (Bech32, Base58Check) have their own conventions for""(no version byte, no checksum) and shouldn't be coerced to a uniform contract. The issue explicitly notes this split.Limitations
gleam testreports 747 vs. 715 before).Closes #70