Skip to content

Commit

Permalink
update test
Browse files Browse the repository at this point in the history
  • Loading branch information
PatrickF1 committed Oct 10, 2022
1 parent afe3828 commit bd7fee6
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 11 deletions.
26 changes: 26 additions & 0 deletions tests/_resources/alphabet 26 lines
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
aaaaaaaaaaa
bbbbbbbbbbb
ccccccccccc
ddddddddddd
eeeeeeeeeee
fffffffffff
ggggggggggg
hhhhhhhhhhh
iiiiiiiiiii
jjjjjjjjjjj
kkkkkkkkkkk
lllllllllll
mmmmmmmmmmm
nnnnnnnnnnn
ooooooooooo
ppppppppppp
qqqqqqqqqqq
rrrrrrrrrrr
sssssssssss
ttttttttttt
uuuuuuuuuuu
vvvvvvvvvvv
wwwwwwwwwww
xxxxxxxxxxx
yyyyyyyyyyy
zzzzzzzzzzz
17 changes: 17 additions & 0 deletions tests/preview_changed_file/renamed_path_modifications.fish
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
set orig_path "tests/_resources/alphabet 26 lines"
set renamed_path "tests/_resources/alphabet lines"
set added_line a-very-unique-line
git mv $orig_path $renamed_path
echo $added_line >>$renamed_path
git add $renamed_path

set output (_fzf_preview_changed_file "R \"$orig_path\" -> \"$renamed_path\"")

# test that the added line shows up in the diff but not the entire file
# "aaaaaaaaaa" is the first line in the file
string match --entire --quiet $added_line $output &&
not string match --entire aaaaaaaaaa $output
@test "shows only the modifications made to renamed file" $status -eq 0

git mv $renamed_path $orig_path
git restore --staged --worktree $orig_path
11 changes: 0 additions & 11 deletions tests/preview_changed_file/renamed_path_with_spaces.fish

This file was deleted.

0 comments on commit bd7fee6

Please sign in to comment.