Results for “Input constraints”
Small, practical examples. Search by task or narrow things down below.
Test an HTTP handler without a server
Test an HTTP handler without a server using a complete Go program with explicit sample inputs.
Go✓ Tested
Test whether a number is even
Test whether a number is even using a complete Go program with explicit sample inputs.
Go✓ Tested
Test whether one revision is an ancestor of another
Git: merge-base --is-ancestor reports its answer through the exit status.
Git✓ Tested
Test whether tracked working files changed
Git: A quiet diff returns status one for differences, so handle it in a conditional.
Git✓ Tested
Transform each item with Select
C#: Project each input value into a new value without modifying the source array.
C#✓ Tested
Transform each stream value
Java: Use map to turn each input into a corresponding output.
Java✓ Tested
Treat an empty trimmed value as missing
SQL: NULLIF converts an empty string to NULL before a fallback is applied.
SQL✓ Tested
Treat an empty trimmed value as missing
SQL Server: NULLIF converts an empty string to NULL before a fallback is applied.
SQL Server✓ Tested
Treat an empty trimmed value as missing
Postgres: NULLIF converts an empty string to NULL before a fallback is applied.
Postgres✓ Tested
Treat an empty trimmed value as missing
SQLite: NULLIF converts an empty string to NULL before a fallback is applied.
SQLite✓ Tested
Trim surrounding whitespace
Trim surrounding whitespace using a complete Go program with explicit sample inputs.
Go✓ Tested
Try a channel receive without blocking
Try a channel receive without blocking using a complete Go program with explicit sample inputs.
Go✓ Tested