From e067bb400f4577f69c57d17eeb04c99ab89a386c Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 27 Sep 2025 01:24:02 +0000 Subject: [PATCH] Add symlink command documentation and comprehensive error testing Co-authored-by: imjasonh <210737+imjasonh@users.noreply.github.com> --- README.md | 1 + tests/builtin_commands.rs | 16 ++++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/README.md b/README.md index 703179a..f387e4f 100644 --- a/README.md +++ b/README.md @@ -127,6 +127,7 @@ Test scripts use the [`txtar`](https://pkg.go.dev/github.com/rogpeppe/go-interna - **mv** - Move/rename files - **rm** - Remove files/directories - **chmod** - Change file permissions +- **symlink** - Create symbolic links - **env** - Set environment variables - **cmpenv** - Compare files with environment variable substitution - **stdin** - Set stdin for next command diff --git a/tests/builtin_commands.rs b/tests/builtin_commands.rs index 4ae6127..3e58b2f 100644 --- a/tests/builtin_commands.rs +++ b/tests/builtin_commands.rs @@ -206,3 +206,19 @@ original content"#; let result = run_test(&script_path); assert!(result.is_ok(), "Symlink test failed: {:?}", result); } + +#[test] +fn test_symlink_error_cases() { + let temp_dir = TempDir::new().unwrap(); + let script_path = temp_dir.path().join("symlink_error_test.txt"); + + let script_content = r#"# Test symlink error cases +! symlink +! symlink only_one_arg +! symlink too many arguments here"#; + + fs::write(&script_path, script_content).unwrap(); + + let result = run_test(&script_path); + assert!(result.is_ok(), "Symlink error test failed: {:?}", result); +}