FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Failing test. · codercatdev/nodegit@9096eb6 · GitHub

Repository navigation

Commit 9096eb6

Browse files
committed
Failing test.
1 parent a3f6bd4 commit 9096eb6

1 file changed

Lines changed: 28 additions & 0 deletions

File tree

‎test/tests/diff.js‎

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ describe("Diff", function() {
88
var NodeGit = require("../../");
99
var Repository = NodeGit.Repository;
1010
var Diff = NodeGit.Diff;
11+
var Blob = NodeGit.Blob;
1112

1213
var reposPath = local("../repos/workdir");
1314
var oid = "fce88902e66c72b5b93e75bdb5ae717038b221f6";
@@ -220,6 +221,33 @@ describe("Diff", function() {
220221
});
221222
});
222223

224+
it("can diff the contents of a file to a string with unicode characters",
225+
function(done) {
226+
var evilString = "Unicode’s fun!\nAnd it’s good for you!\n";
227+
var buffer = new Buffer(evilString);
228+
var oid = Blob.createFromBuffer(this.repository, buffer, buffer.length);
229+
Blob.lookup(this.repository, oid)
230+
.then(function(blob) {
231+
blob.repo = this.repository;
232+
return Diff.blobToBuffer(
233+
blob,
234+
null,
235+
evilString,
236+
null,
237+
null,
238+
null,
239+
null,
240+
function(delta, hunk, payload) {
241+
assert.fail(
242+
"There aren't any changes so this shouldn't be called.");
243+
done();
244+
});
245+
})
246+
.then(function() {
247+
done();
248+
});
249+
});
250+
223251
it("can diff with a null tree", function() {
224252
var repo = this.repository;
225253
var tree = this.masterCommitTree;

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL