Skip to content
This repository has been archived by the owner on Sep 6, 2021. It is now read-only.

Commit

Permalink
Merge pull request #6535 from adobe/irichter/unittest-for-6441
Browse files Browse the repository at this point in the history
added testcase for #6441
  • Loading branch information
ingorichter committed Feb 5, 2014
2 parents aee29f2 + 1d4cf78 commit f56d35e
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions test/spec/CodeInspection-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -536,6 +536,42 @@ define(function (require, exports, module) {
});
});

it("should handle missing or negative line numbers gracefully (https://github.com/adobe/brackets/issues/6441)", function () {
var codeInspector1 = createCodeInspector("NoLineNumberLinter", {
errors: [
{
pos: { line: -1, ch: 0 },
message: "Some errors here and there",
type: CodeInspection.Type.WARNING
}
]
});

var codeInspector2 = createCodeInspector("NoLineNumberLinter2", {
errors: [
{
pos: { line: "all", ch: 0 },
message: "Some errors here and there",
type: CodeInspection.Type.WARNING
}
]
});
CodeInspection.register("javascript", codeInspector1);
CodeInspection.register("javascript", codeInspector2);

waitsForDone(SpecRunnerUtils.openProjectFiles(["errors.js"]), "open test file");

runs(function () {
var $problemPanelTitle = $("#problems-panel .title").text();
expect($problemPanelTitle).toBe("2 Problems");

var $statusBar = $("#status-inspection");
expect($statusBar.is(":visible")).toBe(true);

var tooltip = $statusBar.attr("title");
expect(tooltip).toBe("2 Problems");
});
});
});

describe("Code Inspector Registration", function () {
Expand Down

0 comments on commit f56d35e

Please sign in to comment.