Skip to content

Commit 7f7a929

Browse files
committed
chore: make sure output file is created
1 parent 7266846 commit 7f7a929

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

tests/_test_fzf_cmd_history.fish

+5-5
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,15 @@ set output_file $temp_dir/output.txt
2424

2525
# Test _fzf_cmd_history without options
2626
setup_mocked_history
27-
$output_file <(echo "command1" | _fzf_cmd_history)
27+
echo command1 | _fzf_cmd_history >$output_file
2828

2929
set selected_command_without_equals (string replace '=' '' (cat $output_file))
3030
@test "selected command is correct" "$selected_command_without_equals" = command1
3131

3232
# Test _fzf_cmd_history with custom prompt name
3333
setup_mocked_history
3434
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
3636

3737
set selected_command_without_equals (string replace '=' '' (cat $output_file))
3838
@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))
4141
# Test _fzf_cmd_history with allow-execute option
4242
setup_mocked_history
4343
setup_mocked_fzf
44-
$output_file <(echo "command3" | _fzf_cmd_history --allow-execute)
44+
echo command3 | _fzf_cmd_history --allow-execute >$output_file
4545

4646
set selected_command_without_equals (string replace '=' '' (cat $output_file))
4747
@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))
5050
# Test _fzf_cmd_history with both prompt name and allow-execute options
5151
setup_mocked_history
5252
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
5454

5555
set selected_command_without_equals (string replace '=' '' (cat $output_file))
5656
@test "selected command is correct with both options" "$selected_command_without_equals" = command4
5757
@test "prompt name in fzf is correct" $FZF_PROMPT_NAME = CustomPrompt
5858

5959
# Test _fzf_cmd_history with allow-execute option (execution validation)
6060
setup_mocked_history
61-
$output_file <(echo "command5" | _fzf_cmd_history --allow-execute)
61+
echo command5 | _fzf_cmd_history --allow-execute >$output_file
6262
eval (cat $output_file)
6363
@test "command execution with allow-execute is successful" $status -eq 0
6464

0 commit comments

Comments
 (0)