Search in sources :

Example 16 with ValidationProblem

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

the class BlockWhitespaceRuleTest method testMatch3.

public void testMatch3() {
    final String markup = "\n\n\nbc..\nfoo";
    ValidationProblem problem = rule.findProblem(markup, 0, markup.length());
    assertNotNull(problem);
    assertEquals(3, problem.getOffset());
}
Also used : ValidationProblem(org.eclipse.mylyn.wikitext.validation.ValidationProblem)

Example 17 with ValidationProblem

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

the class BlockWhitespaceRuleTest method testNoMatch.

public void testNoMatch() {
    final String markup = "bc. \nfoo";
    ValidationProblem problem = rule.findProblem(markup, 0, markup.length());
    assertNull(problem);
}
Also used : ValidationProblem(org.eclipse.mylyn.wikitext.validation.ValidationProblem)

Example 18 with ValidationProblem

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

the class ListWhitespaceValidationRuleTest method testPositiveMatchFirstItemNotMultipleOf3.

public void testPositiveMatchFirstItemNotMultipleOf3() {
    String markup = "some text\n\n  * a bad list item\n      * not a list item\n\nmore text";
    ValidationProblem problem = rule.findProblem(markup, 0, markup.length());
    assertNotNull(problem);
    assertEquals(11, problem.getOffset());
}
Also used : ValidationProblem(org.eclipse.mylyn.wikitext.validation.ValidationProblem)

Example 19 with ValidationProblem

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

the class ListWhitespaceValidationRuleTest method testNegativeMatch.

public void testNegativeMatch() {
    String markup = "some text\n\n   * a valid list item\n      * another valid list item\n\nmore text";
    ValidationProblem problem = rule.findProblem(markup, 0, markup.length());
    assertNull(problem);
}
Also used : ValidationProblem(org.eclipse.mylyn.wikitext.validation.ValidationProblem)

Example 20 with ValidationProblem

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

the class ListWhitespaceValidationRuleTest method testPositiveMatchNumeric.

public void testPositiveMatchNumeric() {
    String markup = "some text\n\n  1. a bad list item\n      1. another valid list item\n\nmore text";
    ValidationProblem problem = rule.findProblem(markup, 0, markup.length());
    assertNotNull(problem);
    assertEquals(11, problem.getOffset());
}
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