Skip to content

Commit 068c0ec

Browse files
Force some test to look at specific lines
1 parent 9bb5bc7 commit 068c0ec

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

test/diff-so-fancy.bats

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -175,13 +175,17 @@ output=$( load_fixture "ls-function" | $diff_so_fancy )
175175

176176
@test "Reworked hunks (deleted files)" {
177177
output=$( load_fixture "dotfiles" | $diff_so_fancy )
178-
assert_output --partial '@ diff-so-fancy:1 @'
178+
run printf "%s" "$output"
179+
180+
assert_line --index 188 --partial "@ diff-so-fancy:1 @"
179181
}
180182

181183
@test "Hunk formatting: @@@ -A,B -C,D +E,F @@@" {
182184
# stderr forced into output
183185
output=$( load_fixture "complex-hunks" | $diff_so_fancy 2>&1 )
184-
assert_output --partial '@ header_clean.pl:107 @'
186+
run printf "%s" "$output"
187+
188+
assert_line --index 4 --partial "@ header_clean.pl:107 @"
185189
refute_output --partial 'Use of uninitialized value'
186190
}
187191

@@ -214,6 +218,8 @@ output=$( load_fixture "ls-function" | $diff_so_fancy )
214218

215219
@test "non-git diff parsing" {
216220
output=$( load_fixture "weird" | $diff_so_fancy )
217-
assert_output --partial 'modified: doc/manual.xml.head'
218-
assert_output --partial '@ manual.xml.head:8355 @'
221+
run printf "%s" "$output"
222+
223+
assert_line --index 1 --partial "modified: doc/manual.xml.head"
224+
assert_line --index 3 --partial "@ manual.xml.head:8355 @"
219225
}

0 commit comments

Comments
 (0)