From 4d352efef01f2af80598636909fc14df97306988 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Pfeuffer?= Date: Tue, 12 May 2020 07:50:39 +0200 Subject: [PATCH] Remove wrong test The GitHunkParser has nothing to do with renames, so this test does not make any sense. --- .../scm/repository/spi/GitHunkParserTest.java | 28 ------------------- 1 file changed, 28 deletions(-) diff --git a/scm-plugins/scm-git-plugin/src/test/java/sonia/scm/repository/spi/GitHunkParserTest.java b/scm-plugins/scm-git-plugin/src/test/java/sonia/scm/repository/spi/GitHunkParserTest.java index 54c92a4346..fda99ed7bf 100644 --- a/scm-plugins/scm-git-plugin/src/test/java/sonia/scm/repository/spi/GitHunkParserTest.java +++ b/scm-plugins/scm-git-plugin/src/test/java/sonia/scm/repository/spi/GitHunkParserTest.java @@ -112,15 +112,6 @@ class GitHunkParserTest { " indent_size = 2\r\r\n" + " charset = utf-8\n"; - private static final String RENAMES = "diff --git a/a.txt b/a-copy.txt\n" + - "similarity index 100%\n" + - "rename from a.txt\n" + - "rename to a-copy.txt\n" + - "diff --git a/b.txt b/b-copy.txt\n" + - "similarity index 100%\n" + - "rename from b.txt\n" + - "rename to b-copy.txt"; - @Test void shouldParseHunks() { List hunks = new GitHunkParser().parse(DIFF_001); @@ -219,25 +210,6 @@ class GitHunkParserTest { assertThat(lines.hasNext()).isFalse(); } - @Test - void shouldHandleRenames() { - List hunks = new GitHunkParser().parse(RENAMES); - - Hunk hunk = hunks.get(0); - hunk.getRawHeader(); - - Iterator lines = hunk.iterator(); - - DiffLine line1 = lines.next(); - assertThat(line1.getOldLineNumber()).hasValue(10); - assertThat(line1.getNewLineNumber()).hasValue(10); - assertThat(line1.getContent()).isEqualTo("indent_style = space"); - - lines.next(); - lines.next(); - assertThat(lines.hasNext()).isFalse(); - } - private void assertHunk(Hunk hunk, int oldStart, int oldLineCount, int newStart, int newLineCount) { assertThat(hunk.getOldStart()).isEqualTo(oldStart); assertThat(hunk.getOldLineCount()).isEqualTo(oldLineCount);