From 397addcf277aab76ea6721252ad7c48538515576 Mon Sep 17 00:00:00 2001 From: Ilya Muradyan Date: Tue, 9 May 2023 23:43:47 +0200 Subject: [PATCH] Add test confirmation for #413 --- .../kotlinx/jupyter/test/repl/ReplTests.kt | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/test/kotlin/org/jetbrains/kotlinx/jupyter/test/repl/ReplTests.kt b/src/test/kotlin/org/jetbrains/kotlinx/jupyter/test/repl/ReplTests.kt index 781fc159d..e8c9c654c 100644 --- a/src/test/kotlin/org/jetbrains/kotlinx/jupyter/test/repl/ReplTests.kt +++ b/src/test/kotlin/org/jetbrains/kotlinx/jupyter/test/repl/ReplTests.kt @@ -26,6 +26,7 @@ import org.jetbrains.kotlinx.jupyter.repl.ListErrorsResult import org.jetbrains.kotlinx.jupyter.test.getOrFail import org.jetbrains.kotlinx.jupyter.withPath import org.junit.jupiter.api.Test +import org.junit.jupiter.api.assertThrows import java.io.File import java.nio.file.Path import kotlin.script.experimental.api.SourceCode @@ -544,4 +545,16 @@ class ReplTests : AbstractSingleReplTest() { eval("fun b() = a") eval("b()").renderedValue shouldBe 1 } + + @Test + fun testRegexBug413() { + val code = """ + Regex("(?[0-9]*)").matchEntire("123456789")?.groups?.get("x")?.value + """.trimIndent() + + eval(code) + assertThrows { + eval(code) + } + } }