@@ -24,15 +24,15 @@ set output_file $temp_dir/output.txt
24
24
25
25
# Test _fzf_cmd_history without options
26
26
setup_mocked_history
27
- $output_file < ( echo " command1" | _fzf_cmd_history)
27
+ echo command1 | _fzf_cmd_history > $output_file
28
28
29
29
set selected_command_without_equals (string replace ' =' ' ' (cat $output_file ))
30
30
@test " selected command is correct" " $selected_command_without_equals " = command1
31
31
32
32
# Test _fzf_cmd_history with custom prompt name
33
33
setup_mocked_history
34
34
setup_mocked_fzf
35
- output_file < ( echo " command2" | _fzf_cmd_history --prompt-name " CustomPrompt" )
35
+ echo command2 | _fzf_cmd_history --prompt-name CustomPrompt > $output_file
36
36
37
37
set selected_command_without_equals (string replace ' =' ' ' (cat $output_file ))
38
38
@test " selected command is correct with custom prompt name" " $selected_command_without_equals " = command2
@@ -41,7 +41,7 @@ set selected_command_without_equals (string replace '=' '' (cat $output_file))
41
41
# Test _fzf_cmd_history with allow-execute option
42
42
setup_mocked_history
43
43
setup_mocked_fzf
44
- $output_file < ( echo " command3" | _fzf_cmd_history --allow-execute )
44
+ echo command3 | _fzf_cmd_history --allow-execute > $output_file
45
45
46
46
set selected_command_without_equals (string replace ' =' ' ' (cat $output_file ))
47
47
@test " selected command is correct with allow-execute option" " $selected_command_without_equals " = command3
@@ -50,15 +50,15 @@ set selected_command_without_equals (string replace '=' '' (cat $output_file))
50
50
# Test _fzf_cmd_history with both prompt name and allow-execute options
51
51
setup_mocked_history
52
52
setup_mocked_fzf
53
- $output_file < ( echo " command4" | _fzf_cmd_history --prompt-name " CustomPrompt" --allow-execute )
53
+ echo command4 | _fzf_cmd_history --prompt-name CustomPrompt --allow-execute > $output_file
54
54
55
55
set selected_command_without_equals (string replace ' =' ' ' (cat $output_file ))
56
56
@test " selected command is correct with both options" " $selected_command_without_equals " = command4
57
57
@test " prompt name in fzf is correct" $FZF_PROMPT_NAME = CustomPrompt
58
58
59
59
# Test _fzf_cmd_history with allow-execute option (execution validation)
60
60
setup_mocked_history
61
- $output_file < ( echo " command5" | _fzf_cmd_history --allow-execute )
61
+ echo command5 | _fzf_cmd_history --allow-execute > $output_file
62
62
eval (cat $output_file )
63
63
@test " command execution with allow-execute is successful" $status -eq 0
64
64
0 commit comments