diff --git a/.idea/modules/languagetool-languageserver_test.iml b/.idea/modules/languagetool-languageserver_test.iml index a654ab6..9f68c3d 100644 --- a/.idea/modules/languagetool-languageserver_test.iml +++ b/.idea/modules/languagetool-languageserver_test.iml @@ -17,6 +17,7 @@ + @@ -80,6 +81,7 @@ + diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..9bcf999 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,3 @@ +language: java +jdk: + - oraclejdk8 diff --git a/build.gradle b/build.gradle index 7084568..e23179d 100644 --- a/build.gradle +++ b/build.gradle @@ -45,8 +45,8 @@ repositories { dependencies { testCompile group: 'org.junit.jupiter', name: 'junit-jupiter-api', version: '5.0.0-M4' -// Enabling makes the Gradle plugin work but breaks IDEA -// testRuntime group: 'org.junit.jupiter', name: 'junit-jupiter-engine', version: '5.0.0-M4' + // Enabling makes the Gradle plugin work but breaks IDEA + testRuntime group: 'org.junit.jupiter', name: 'junit-jupiter-engine', version: '5.0.0-M4' compile group: 'org.languagetool', name: 'language-all', version: '3.7' diff --git a/src/test/java/DocumentPositionCalculatorTest.java b/src/test/java/DocumentPositionCalculatorTest.java index d3934ce..e7865c4 100644 --- a/src/test/java/DocumentPositionCalculatorTest.java +++ b/src/test/java/DocumentPositionCalculatorTest.java @@ -5,41 +5,41 @@ public class DocumentPositionCalculatorTest { public final DocumentPositionCalculator sut = new DocumentPositionCalculator("Hello\n" + - "Enthusiastic\r\n" + - "Reader!"); + "Enthusiastic\r\n" + + "Reader!"); @Test - public void testGetPosition_first_character(){ + public void testGetPosition_first_character() { Position position = sut.getPosition(0); - Assertions.assertEquals(new Position(0, 0),position); + Assertions.assertEquals(new Position(0, 0), position); } @Test - public void testGetPosition_starts_with_newline(){ - Position position = sut.getPosition(1); + public void testGetPosition_starts_with_newline() { + Position position = new DocumentPositionCalculator("\nHi").getPosition(1); - Assertions.assertEquals(new Position(1, 0),position); + Assertions.assertEquals(new Position(1, 0), position); } @Test - public void testGetPosition_second_start(){ + public void testGetPosition_second_line_start() { Position position = sut.getPosition(6); - Assertions.assertEquals(new Position(1, 0),position); + Assertions.assertEquals(new Position(1, 0), position); } @Test - public void testGetPosition_second_line_second_character(){ + public void testGetPosition_second_line_second_character() { Position position = sut.getPosition(7); - Assertions.assertEquals(new Position(1, 1),position); + Assertions.assertEquals(new Position(1, 1), position); } @Test - public void testGetPosition(){ + public void testGetPosition_arbitrary_position() { Position position = sut.getPosition(12); - Assertions.assertEquals(new Position(1, 6),position); + Assertions.assertEquals(new Position(1, 6), position); } } \ No newline at end of file