File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed
Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -121,6 +121,19 @@ func TestHookScripts_HandleEdgeCases(t *testing.T) {
121121 "echo \" Usage:" ,
122122 },
123123 },
124+ {
125+ name : "zsh hook supports no-arg cd" ,
126+ shell : "zsh" ,
127+ requiredLogic : []string {
128+ "if [[ -z \" $2\" ]]" , // No-arg branch
129+ "target_dir=$(command wtp cd" , // Uses `wtp cd` default behavior
130+ "target_dir=$(command wtp cd \" $2" , // Uses explicit worktree name when present
131+ },
132+ notContains : []string {
133+ "Usage: wtp cd <worktree>" ,
134+ "echo \" Usage:" ,
135+ },
136+ },
124137 {
125138 name : "fish hook supports no-arg cd" ,
126139 shell : "fish" ,
@@ -144,6 +157,8 @@ func TestHookScripts_HandleEdgeCases(t *testing.T) {
144157 switch tt .shell {
145158 case "bash" :
146159 require .NoError (t , printBashHook (& buf ))
160+ case "zsh" :
161+ require .NoError (t , printZshHook (& buf ))
147162 case "fish" :
148163 require .NoError (t , printFishHook (& buf ))
149164 }
You can’t perform that action at this time.
0 commit comments