@@ -0,0 +1,2606 @@
+/* LanguageTool, a natural language style checker%0A * Copyright (C) 2019 Daniel Naber (http://www.danielnaber.de)%0A *%0A * This library is free software; you can redistribute it and/or%0A * modify it under the terms of the GNU Lesser General Public%0A * License as published by the Free Software Foundation; either%0A * version 2.1 of the License, or (at your option) any later version.%0A *%0A * This library is distributed in the hope that it will be useful,%0A * but WITHOUT ANY WARRANTY; without even the implied warranty of%0A * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU%0A * Lesser General Public License for more details.%0A *%0A * You should have received a copy of the GNU Lesser General Public%0A * License along with this library; if not, write to the Free Software%0A * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301%0A * USA%0A */%0Apackage org.languagetool.rules.fr;%0A%0Aimport org.junit.Ignore;%0Aimport org.junit.Test;%0Aimport org.languagetool.JLanguageTool;%0Aimport org.languagetool.language.French;%0Aimport org.languagetool.markup.AnnotatedTextBuilder;%0Aimport org.languagetool.rules.RuleMatch;%0A%0Aimport java.io.IOException;%0A%0Aimport static org.junit.Assert.assertThat;%0Aimport static org.hamcrest.core.Is.is;%0A%0Apublic class AnnotatedTextTest %7B%0A%0A  private final JLanguageTool lt = new JLanguageTool(new French());%0A%0A  @Ignore(%22activate when #2118 is fixed%22)%0A  @Test%0A  public void test1() throws IOException %7B%0A    //%22%C3%A9chapatoire%22 should be %22%C3%A9chappatoire%22 with two 'p'%0A    String textToCheck = %22Une &eacute;chapatoire est possible.%22;%0A%0A    AnnotatedTextBuilder builder = new AnnotatedTextBuilder()%0A      .addText(%22Une %22)%0A      .addMarkup(%22&eacute;%22, %22%C3%A9%22)%0A      .addText(%22chapatoire est possible.%22);%0A    RuleMatch match = lt.check(builder.build()).get(0);%0A    %0A    String markedWord = textToCheck.substring(match.getFromPos(), match.getToPos());%0A    String wordThanShouldBeHighlighted = %22&eacute;chapatoire%22;%0A    assertThat(markedWord, is(wordThanShouldBeHighlighted));%0A  %7D%0A%0A  @Ignore(%22activate when #2118 is fixed%22)%0A  @Test%0A  public void test2() throws IOException %7B%0A    //%22trouuv%C3%A9%22 should be %22trouv%C3%A9%22%0A    String textToCheck = %22J'ai trouuv&eacute; le livre.%22;%0A%0A    AnnotatedTextBuilder builder = new AnnotatedTextBuilder()%0A      .addText(%22J'ai trouuv%22)%0A      .addMarkup(%22&eacute;%22, %22%C3%A9%22)%0A      .addText(%22 le livre.%22);%0A    RuleMatch match = lt.check(builder.build()).get(0);%0A    %0A    String markedWord = textToCheck.substring(match.getFromPos(), match.getToPos());%0A    String wordThanShouldBeHighlighted = %22trouuv&eacute;%22;%0A    assertThat(markedWord, is(wordThanShouldBeHighlighted));%0A  %7D%0A  %0A%7D%0A

add test for #2118 - commented out as it still fails