Skip to content

Commit 2b0ee55

Browse files
author
John Haley
committed
Updated diff workdir with index test
1 parent 97a8e38 commit 2b0ee55

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

test/tests/diff.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -88,15 +88,15 @@ describe("Diff", function() {
8888
it.only("can diff the workdir with index", function() {
8989
var patches = this.workdirDiff.patches();
9090
assert.equal(patches.length, 1);
91+
assert(patches[0].isUntracked());
9192

92-
var hunks = patches[0].hunks();
93-
assert.equal(hunks.length, 1);
93+
var oldFile = patches[0].delta.oldFile();
94+
assert.equal(oldFile.path(), "wddiff.txt");
95+
assert.equal(oldFile.size(), 0);
9496

95-
var lines = hunks[0].lines();
96-
assert.equal(
97-
lines[0].content().substr(0, lines[0].contentLen()),
98-
"1 line\n"
99-
);
97+
var newFile = patches[0].delta.newFile();
98+
assert.equal(newFile.path(), "wddiff.txt");
99+
assert.equal(newFile.size(), 23);
100100
});
101101

102102
it("can diff with a null tree", function() {

0 commit comments

Comments
 (0)