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

Fix tree entry leaks by srajko · Pull Request #1138 · nodegit/nodegit · GitHub

Repository navigation

Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension .js  (1) All 1 file type selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
Prev Previous commit
Add tree entry leak test
  • Loading branch information
srajko committed Oct 7, 2016
commit 0a707b00a43d2d39109e37fae71b62a75245824f
13 changes: 13 additions & 0 deletions test/tests/tree_entry.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ var assert = require("assert");
var path = require("path");
var local = path.join.bind(path, __dirname);

var leakTest = require("../utils/leak_test");

describe("TreeEntry", function() {
var NodeGit = require("../../");
var Repository = NodeGit.Repository;
Expand Down Expand Up @@ -153,4 +155,15 @@ describe("TreeEntry", function() {
assert.equal(entry.isSubmodule(), false);
});
});

it("does not leak", function() {
var test = this;

return leakTest(NodeGit.TreeEntry, function() {
return test.commit.getTree()
.then(function(tree) {
return tree.entryByPath("example");
});
});
});
});

Back | FazBrowse Home | New Git URL