FAILURE MAP
← Case archive

FA-96922 / Recipe scaling and nutrition / Member archive

Volume-to-mass ingredient converter: small-mass decimal threshold · case 02

7.5 g of flour prints "8 g" and exactly 10 g prints "10.0 g" under the attempted fix.

Member previewVariant 2 · 3 implementations · 8 checks per implementation

Case contract

Convert amount (fraction string) of cup/tbsp/tsp/ml to grams. 1 cup = 16 tbsp = 48 tsp = 236.5 ml. Grams per cup: flour 120, sugar 200, brown sugar 145 (213 when prefixed "packed "), butter 227, honey 340, water 236. Names are trimmed and case-insensitive; a ", sifted" suffix multiplies density by 9/10. Results below 10 g print one decimal ("%.1f g"), otherwise whole grams, both half-up. Unknown ingredient or unit returns an error string.

Why this case matters

Recipe apps convert American volume measures to weights for scaling and nutrition lookup.

One recorded failure

Sample boundary fixture

This sample comes from the broken implementation of a controlled reproducer.

Boundary fixtureActualExpectedOutcome
regression: small-mass decimal threshold"4 g""3.7 g"Failed

MEMBER ARCHIVE

The complete case is available to members.

This record includes three runnable implementations, regression fixtures, execution results, and source hashes.

Member access is invitation-based. Sign in with your invited account to inspect the sources.

Sign in to the archive ↗