Results for “read only”
Small, practical examples. Search by task or narrow things down below.
Check a function with table-driven cases
Check a function with table-driven cases using a complete Go program with explicit sample inputs.
Go✓ Tested
Check a literal prefix in C++17
C++: Use string compare because starts_with was introduced after C++17.
C++✓ Tested
Check a literal prefix with ordinal comparison
C#: Choose StringComparison.Ordinal when a prefix is a protocol token rather than culture-dependent text.
C#✓ Tested
Check a literal suffix in C++17
C++: Check lengths before subtracting to avoid an unsigned underflow.
C++✓ Tested
Check an extension without case sensitivity
C#: Use an explicit ordinal case-insensitive comparison for a known filename suffix.
C#✓ Tested
Check an upper integer bound before adding
C++: For these nonnegative values, compare against the maximum minus the addend first.
C++✓ Tested
Check available disk space
Show total, used, and available filesystem space for the current directory in human-readable units.
disk✓ Tested
Check memory usage
Show memory and swap totals in human-readable units. The available column estimates memory usable by new applications.
memory✓ Tested
Check out another branch in a second working tree
Git: A linked worktree shares repository objects while maintaining a separate checked-out branch.
Git✓ Tested
Check that a file is present and nonempty
Test file content availability before reading it.
file check✓ Tested
Check what kind of Git object a revision names
Git: cat-file -t distinguishes a commit, tree, blob, or annotated tag.
Git✓ Tested
Check whether a floating-point value is finite
Check whether a floating-point value is finite in a complete Rust program using the standard library.
Rust✓ Tested