test(core): expand TempArtifact unit coverage#824
Conversation
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
|
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: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (1)
✨ 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 |
Motivation
sink::TempArtifactwrapper to exercise lifecycle behavior and encoding edge-cases.read_to_string()preserves replacement-character semantics for invalid UTF-8.Description
std::threadandstd::time::Durationto support polling of filesystem cleanup in tests.temp_artifact_exposes_live_path_and_deletes_on_droptest that assertsTempArtifact::path()points to an existing file while alive and that the tempfile is removed after the wrapper is dropped.temp_artifact_read_to_string_replaces_invalid_utf8test that verifiesread_to_string()surfaces the Unicode replacement character for invalid UTF-8 bytes via the publicsink::TempArtifactAPI.new_stringandnew_bytes) intact to preserve basic coverage.Testing
cargo test -p uselesskey-core temp_artifact_exposes_live_path_and_deletes_on_drop -- --nocapture, which passed.cargo test -p uselesskey-core sink::mod::tests -- --nocapture; the command executed in the CI-like workspace (initially produced zero selected tests due to filter matching), and the follow-up exact test run passed.Codex Task