Ask a question to get started
Enter to send•Shift+Enter new line
SandboxIntegrationTests()
BaseStandardTests
Test that no standard tests are overridden.
Base directory used by sandbox file-operation tests.
Whether the sandbox supports sync methods.
Whether the sandbox supports async methods.
Build a path under the configured sandbox test directory.
Provide the sandbox backend under test.
Resets the shared test directory before yielding.
Yield a clean sandbox backend and tear it down after the class.
Create an isolated sandbox root directory for each test case.
Write a new file and verify it can be read back via command execution.
Write a file and verify read() returns expected contents.
read()
Upload a binary file and verify read() returns base64-encoded content.
Read should return base64 content for a 100 KiB binary file.
Read should error when a binary file exceeds the preview size limit.
Execute should handle a command that emits about 500 KiB of stdout.
Edit a file and assert exactly one occurrence was replaced.
Create files and verify ls() lists them.
ls()
Create files and verify glob() returns expected matches.
glob()
Verify grep() performs literal matching on special characters.
grep()
Upload one file and verify its contents on the sandbox.
Upload then download a file and verify bytes match.
Upload then download and verify bytes survive a roundtrip.
Uploading multiple files should preserve input order in responses.
Downloading multiple files should preserve input order in responses.
Upload and download binary bytes (0..255) without corruption.
Upload a ~10 MiB file, verify its size, then download it again.
Downloading a missing file should return error="file_not_found".
error="file_not_found"
Downloading a directory should fail with a reasonable error code.
Downloading a chmod 000 file should fail with a reasonable error code.
Downloading a relative path should fail with error="invalid_path".
error="invalid_path"
Uploading into a missing parent dir should error or roundtrip.
Some sandboxes auto-create parent directories; others return an error.
Uploading to a relative path should fail with error="invalid_path".
Writing into a missing nested directory should succeed.
Writing to an existing file should return an error without overwriting.
Writing should preserve shell-sensitive characters exactly.
Writing empty content should still create the file.
Writing should support file paths containing spaces.
Writing should preserve unicode content.
Writing should tolerate normalized paths with consecutive slashes.
Writing moderately long multi-line content should succeed.
Writing newline-only content should preserve the newline count.
Reading a missing file should return a file-not-found style error.
Reading an empty file should succeed with empty-or-empty-notice content.
Reading with offset should skip the requested number of lines.
Reading with limit should cap the number of returned lines.
Reading with offset and limit should return the expected slice.
Reading unicode content should preserve non-ASCII text.
Reading files with long lines should still succeed.
Reading with limit=0 should not include file content.
limit=0
Reading beyond EOF should return no file lines.
Reading exactly at EOF should return no file lines.
Repeated offset+limit reads should cover different slices of a large file.
Editing multiple matches without replace_all should fail.
replace_all
Editing multiple matches with replace_all should replace each match.
Editing a missing string should return a not-found style error.
Editing a missing file should return a file-not-found style error.
Editing should treat special characters as literal strings.
Editing should support replacing multi-line strings.
Listing should include nested directories and immediate child files.
Listing should preserve unicode filenames.
Listing a larger directory should include all created entries.
Listing a path with a trailing slash should match the normalized path.
Listing should preserve filenames with shell metacharacters.
Listing an injected path should not execute attacker-controlled code.
Reading an injected path should return an error without executing it.
Grep should return matches across multiple files.
Grep should honor the file glob filter.
Grep with no matches should return an empty match list.
Grep should report multiple matches from a single file with line numbers.
Grep should treat the search pattern literally rather than as regex.
Grep should match unicode patterns in unicode content.
Grep should be case-sensitive by default.
Grep should treat special characters in the pattern literally.
Grep in an empty directory should return no matches.
Grep should recurse into nested directories.
Grep with a glob filter should still find nested matching files.
Grep should report the original file line number for a match.
Glob should match basic wildcard patterns.
Glob should support recursive patterns with **.
**
Glob with no matches should return an empty match list.
Glob should include directories and mark them with is_dir.
is_dir
Glob should match hidden files when the pattern explicitly requests them.
Glob should support character classes in patterns.
Glob should support single-character wildcards.
Async write should allow a large text file to be read back non-empty.
Async paginated reads should reconstruct the full large text payload.
Async download should preserve the full large text payload exactly.
Sync large-text roundtrips should preserve escaped and unicode content.
Async large-text roundtrips should preserve escaped and unicode content.
Async read should return base64-encoded content for a binary image file.
Async read should return base64 content for a 100 KiB binary file.
Async read should error when a binary file exceeds the preview size limit.
Async execute should handle five parallel 500 KiB stdout commands.
Async upload/download should preserve a ~10 MiB payload exactly.
Standard integration tests for a SandboxBackendProtocol implementation.
SandboxBackendProtocol