Results for “all”
Small, practical examples. Search by task or narrow things down below.
Handle a failed string-to-integer conversion
C++: stoi throws invalid_argument when no conversion can be performed.
C++✓ Tested
Handle a form without navigating
Handle a form without navigating with a small React component and explicit browser behavior.
React✓ Tested
Handle a missing file without treating it as an empty file
C: Inspect errno after a failed fopen to distinguish the documented missing-path condition.
C✓ Tested
Handle a terminating error
Catch conversion failures and produce a clear fallback.
try catch✓ Tested
Handle an asynchronous failure
Handle an asynchronous failure with a small React component and explicit browser behavior.
React✓ Tested
Handle an Escape key press
Handle an Escape key press with a small React component and explicit browser behavior.
React✓ Tested
Handle an expected child-process failure
Python: Catch CalledProcessError when check=True reports a nonzero exit status.
Python✓ Tested
Handle malformed JSON
C#: Catch JsonException for malformed JSON without swallowing unrelated failures.
C#✓ Tested
Handle three possible outcomes
C++: Check high, normal and low values with an ordered conditional chain.
C++✓ Tested
Handle three possible outcomes
C: Check high, normal and low values with an ordered conditional chain.
C✓ Tested
Ignore a result after its effect is cleaned up
Ignore a result after its effect is cleaned up with a small React component and explicit browser behavior.
React✓ Tested
Include every row tied for the highest score
SQL: Compare with MAX rather than limiting to an arbitrary number of rows.
SQL✓ Tested