()
| 91 | /// `--upload` with a single file (not a directory) should work. |
| 92 | #[tokio::test] |
| 93 | async fn create_with_upload_single_file() { |
| 94 | let tmpdir = tempfile::tempdir().expect("create tmpdir"); |
| 95 | let file_path = tmpdir.path().join("config.txt"); |
| 96 | fs::write(&file_path, "single-file-upload-test").expect("write config.txt"); |
| 97 | |
| 98 | let file_str = file_path.to_str().expect("file path is UTF-8"); |
| 99 | |
| 100 | let mut guard = SandboxGuard::create_with_upload( |
| 101 | file_str, |
| 102 | "/sandbox", |
| 103 | &["cat", "/sandbox/config.txt"], |
| 104 | ) |
| 105 | .await |
| 106 | .expect("sandbox create --upload single file"); |
| 107 | |
| 108 | let clean = strip_ansi(&guard.create_output); |
| 109 | assert!( |
| 110 | clean.contains("single-file-upload-test"), |
| 111 | "expected single-file content in sandbox output:\n{clean}" |
| 112 | ); |
| 113 | |
| 114 | guard.cleanup().await; |
| 115 | } |
nothing calls this directly
no test coverage detected