Skip to content

Commit

Permalink
add test for #131
Browse files Browse the repository at this point in the history
When diff starts in the first three lines

Closes #120
  • Loading branch information
stevemao committed Mar 21, 2016
1 parent 506d301 commit e90dd5b
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
18 changes: 18 additions & 0 deletions test/fixtures/first-three-line.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
commit fbf440dd9c32a60f9bc97693a6bd7b5ca87ec9fc
Author: Steve Mao <maochenyan@gmail.com>
Date: Wed Mar 9 19:21:27 2016 +1100

0.6.2

diff --git package.json package.json
index 7379c98..3cba6ee 100644
--- package.json
+++ package.json
@@ -1,6 +1,6 @@
{
"name": "diff-so-fancy",
- "version": "0.6.1",
+ "version": "0.6.2",
"description": "Good-lookin' diffs with diff-highlight and more",
"bin": {
"diff-so-fancy": "diff-so-fancy",
6 changes: 6 additions & 0 deletions test/header_clean.bats
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,12 @@ output=$( load_fixture "file-moves" | $diff_so_fancy )
refute_output --partial 'Use of uninitialized value'
}

@test "Hunk formatting: @@ -1,6 +1,6 @@" {
# stderr forced into output
output=$( load_fixture "first-three-line" | $diff_so_fancy )
assert_output --partial '@ package.json:3 @'
}

@test "mnemonicprefix handling" {
output=$( load_fixture "mnemonicprefix" | $diff_so_fancy )
assert_output --partial 'modified: test/header_clean.bats'
Expand Down

0 comments on commit e90dd5b

Please sign in to comment.