Search in sources :

Example 26 with ValidationProblem

use of org.eclipse.mylyn.wikitext.validation.ValidationProblem in project mylyn.docs by eclipse.

the class CommentValidationRuleTest method testFail2.

public void testFail2() {
    String markup = "a <!--- bogus comment ----->";
    ValidationProblem problem = rule.findProblem(markup, 0, markup.length());
    assertNotNull(problem);
    int offset = problem.getOffset() + problem.getLength();
    problem = rule.findProblem(markup, offset, markup.length() - offset);
    assertNotNull(problem);
    assertEquals(22, problem.getOffset());
    assertEquals(6, problem.getLength());
}
Also used : ValidationProblem(org.eclipse.mylyn.wikitext.validation.ValidationProblem)

Example 27 with ValidationProblem

use of org.eclipse.mylyn.wikitext.validation.ValidationProblem in project mylyn.docs by eclipse.

the class CommentValidationRuleTest method testFail1.

public void testFail1() {
    String markup = "a <!--- bogus comment -->";
    ValidationProblem problem = rule.findProblem(markup, 0, markup.length());
    assertNotNull(problem);
    assertEquals(2, problem.getOffset());
    assertEquals(5, problem.getLength());
}
Also used : ValidationProblem(org.eclipse.mylyn.wikitext.validation.ValidationProblem)

Aggregations

ValidationProblem (org.eclipse.mylyn.wikitext.validation.ValidationProblem)27 Matcher (java.util.regex.Matcher)4 ArrayList (java.util.ArrayList)2 HashMap (java.util.HashMap)2 BuildException (org.apache.tools.ant.BuildException)2 StandaloneMarkupValidator (org.eclipse.mylyn.wikitext.validation.StandaloneMarkupValidator)2 Map (java.util.Map)1 IMarker (org.eclipse.core.resources.IMarker)1 BadLocationException (org.eclipse.jface.text.BadLocationException)1 ISynchronizable (org.eclipse.jface.text.ISynchronizable)1 Position (org.eclipse.jface.text.Position)1 Annotation (org.eclipse.jface.text.source.Annotation)1 IAnnotationModelExtension (org.eclipse.jface.text.source.IAnnotationModelExtension)1 MarkdownLanguage (org.eclipse.mylyn.wikitext.markdown.MarkdownLanguage)1 LinkDefinitionUsageTracker (org.eclipse.mylyn.wikitext.markdown.internal.LinkDefinitionUsageTracker)1 Position (org.eclipse.mylyn.wikitext.markdown.internal.LinkDefinitionUsageTracker.Position)1 MarkdownContentState (org.eclipse.mylyn.wikitext.markdown.internal.MarkdownContentState)1 MarkupParser (org.eclipse.mylyn.wikitext.parser.MarkupParser)1 Severity (org.eclipse.mylyn.wikitext.validation.ValidationProblem.Severity)1