Search in sources :

Example 6 with IssueBuilder

use of com.googlecode.jslint4java.Issue.IssueBuilder in project jslint4java by happygiraffe.

the class PlainFormatterTest method shouldCopeWithCharacterZero.

/**
 * We don't expect this to happen, but we shouldn't blow up either. @see issue 85
 */
@Test
public void shouldCopeWithCharacterZero() throws Exception {
    String nl = System.getProperty("line.separator");
    String name = "foo/bar.js";
    Issue issue = new IssueBuilder(name, 0, 0, "oops").evidence("BANG").build();
    JSLintResult result = new JSLintResult.ResultBuilder(name).addIssue(issue).build();
    StringBuilder sb = new StringBuilder(name);
    sb.append(":0:0: oops").append(nl);
    sb.append("BANG").append(nl);
    sb.append("^").append(nl);
    assertThat(rf.format(result), is(sb.toString()));
}
Also used : Issue(com.googlecode.jslint4java.Issue) JSLintResult(com.googlecode.jslint4java.JSLintResult) IssueBuilder(com.googlecode.jslint4java.Issue.IssueBuilder) Test(org.junit.Test)

Aggregations

IssueBuilder (com.googlecode.jslint4java.Issue.IssueBuilder)6 Test (org.junit.Test)6 Issue (com.googlecode.jslint4java.Issue)5 JSLintResult (com.googlecode.jslint4java.JSLintResult)3 File (java.io.File)2