FIND YOUR NEXT FEW LINES

Results for “Test-Path”

Small, practical examples. Search by task or narrow things down below.

1055 snippets foundClear filters
C#LINQ transformations

Test whether any or all values match

C#: Any and All short-circuit instead of materializing filtered collections.

C#✓ Tested
GitBranches & ancestry

Test whether one revision is an ancestor of another

Git: merge-base --is-ancestor reports its answer through the exit status.

Git✓ Tested
GitInspecting the working tree

Test whether tracked working files changed

Git: A quiet diff returns status one for differences, so handle it in a conditional.

Git✓ Tested
GitRestoring & revising local work

Uncommit the latest local change while keeping it staged

Git: A soft reset moves the branch tip but preserves both index and working files.

Git✓ Tested
RustFiles & paths

Append to a file without truncating it

Append to a file without truncating it in a complete Rust program using the standard library.

Rust✓ Tested
RustTesting & reusable patterns

Assert approximate floating-point equality

Assert approximate floating-point equality in a complete Rust program using the standard library.

Rust✓ Tested
RustTesting & reusable patterns

Borrow text until a modification is needed

Borrow text until a modification is needed in a complete Rust program using the standard library.

Rust✓ Tested
RustTesting & reusable patterns

Check a deterministic result with an assertion

Check a deterministic result with an assertion in a complete Rust program using the standard library.

Rust✓ Tested
GoTesting & reusable helpers

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
Bash ScriptsFiles & reliability

Check that a file is present and nonempty

Test file content availability before reading it.

file check✓ Tested
Linux CommandsArchive integrity & packaging

Check the integrity of a gzip stream

Linux Commands: Use gzip -t to verify a compressed file without extracting it.

Linux Commands✓ Tested
GoTesting & reusable helpers

Check whether bytes contain valid JSON

Check whether bytes contain valid JSON using a complete Go program with explicit sample inputs.

Go✓ Tested