From 2bd406a754f2b6ca5b89f3c875c04508eae1afde Mon Sep 17 00:00:00 2001 From: Subhajit Mallick <153619690+subhajitxyz@users.noreply.github.com> Date: Mon, 11 Nov 2024 13:50:10 +0530 Subject: [PATCH] fix exemptions --- .../android/scripts/todo/TodoOpenCheckTest.kt | 62 +++++++++---------- 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/scripts/src/javatests/org/oppia/android/scripts/todo/TodoOpenCheckTest.kt b/scripts/src/javatests/org/oppia/android/scripts/todo/TodoOpenCheckTest.kt index fd47f3a2bc6..b6eea8a281e 100644 --- a/scripts/src/javatests/org/oppia/android/scripts/todo/TodoOpenCheckTest.kt +++ b/scripts/src/javatests/org/oppia/android/scripts/todo/TodoOpenCheckTest.kt @@ -84,37 +84,6 @@ class TodoOpenCheckTest { assertThat(outContent.toString().trim()).isEqualTo(TODO_CHECK_PASSED_OUTPUT_INDICATOR) } - @Test - fun testTodoCheck_PrPresent_checkShouldFail() { - setUpGitHubService( - issueNumbers = listOf(11004, 11003, 11002, 11001), - pullRequestNumbers = listOf(11001) - ) - val tempFile1 = tempFolder.newFile("testfiles/TempFile1.kt") - val tempFile2 = tempFolder.newFile("testfiles/TempFile2.kt") - val testContent1 = - """ - // TODO(#11002): test summary 1. - # TODO(#11004): test summary 2. - # TODO(#11001): test summary 3. - test Todo - test TODO - """.trimIndent() - val testContent2 = - """ - // TODO(#11001): test summary 3. - todo - - - """.trimIndent() - tempFile1.writeText(testContent1) - tempFile2.writeText(testContent2) - - runScript() - - assertThat(outContent.toString().trim()).isEqualTo(TODO_SYNTAX_CHECK_FAILED_OUTPUT_INDICATOR) - } - @Test fun testTodoCheck_onlyPoorlyFormattedTodosPresent_checkShouldFail() { setUpGitHubService(issueNumbers = emptyList()) @@ -808,6 +777,37 @@ class TodoOpenCheckTest { assertThat(outContent.toString().trim()).isEqualTo(failureMessage) } + @Test + fun testTodoCheck_PrPresent_checkShouldFail() { + setUpGitHubService( + issueNumbers = listOf(11004, 11003, 11002, 11001), + pullRequestNumbers = listOf(11001) + ) + val tempFile1 = tempFolder.newFile("testfiles/TempFile1.kt") + val tempFile2 = tempFolder.newFile("testfiles/TempFile2.kt") + val testContent1 = + """ + // TODO(#11002): test summary 1. + # TODO(#11004): test summary 2. + # TODO(#11001): test summary 3. + test Todo + test TODO + """.trimIndent() + val testContent2 = + """ + // TODO(#11001): test summary 3. + todo + + + """.trimIndent() + tempFile1.writeText(testContent1) + tempFile2.writeText(testContent2) + + runScript() + + assertThat(outContent.toString().trim()).isEqualTo(TODO_SYNTAX_CHECK_FAILED_OUTPUT_INDICATOR) + } + private fun setUpGitHubService( issueNumbers: List, pullRequestNumbers: List = emptyList()