Repository navigation
Show sizes that round to 1000 MB in GB - #81
Conversation
Term.size checked for 1 GB before rounding, so 999,999,999 bytes came out as "1000 MB". Anything from 999.5 MB up now takes the GB branch and shows "1.0 GB", with a selftest check covering the boundary on both sides. Fixes omlahore#73.
|
Note Currently processing new changes in this PR. This may take a few minutes, please wait... ⚙️ Run configuration
📒 Files selected for processing: 2
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to
|
# Conflicts: # Sources/removemacai/SelfTest.swift
Term.size checked for 1 GB before rounding, so 999,999,999 bytes came out as "1000 MB". Anything from 999.5 MB up now takes the GB branch and shows "1.0 GB" instead.
Includes a selftest check covering the boundary on both sides (999,499,999 stays "999 MB"; 999,500,000 and 999,999,999 show "1.0 GB") plus the unchanged 1 GB and small-MB paths.
Testing: I could not run swift build/selftest locally (Linux checkout, no Swift toolchain, macOS-15.1 target), so this relies on CI's build + self-test gate. The boundary logic was verified separately: old code prints "1000 MB" for 999,999,999 and 999,500,000; fixed code prints "1.0 GB", and a sweep of every byte from 999,499,990 to 1,000,000,009 never prints "1000 MB".
Fixes #73.
Summary by CodeRabbit