From 8187405dbd018d425d0205235edac0658d92f168 Mon Sep 17 00:00:00 2001 From: "anastasiia.spaseeva" Date: Thu, 12 Dec 2019 11:20:04 +0300 Subject: [PATCH] [Spec tests] fix test parser exceptions handler --- .../kotlin.nothing-1/p-1/pos/1.2.kt | 2 +- .../kotlin.nothing-1/p-1/pos/1.3.kt | 2 +- .../kotlin.nothing-1/p-1/pos/1.4.kt | 2 +- .../kotlin.nothing-1/p-1/pos/1.5.kt | 2 +- .../kotlin.nothing-1/p-1/pos/1.6.kt | 2 +- .../kotlin.nothing-1/p-1/pos/1.7.kt | 2 +- .../kotlin.nothing-1/p-1/pos/1.8.kt | 2 +- .../kotlin.nothing-1/p-1/pos/1.9.kt | 2 +- .../kotlin.nothing-1/testsMap.json | 16 +++--- .../cast-expression/p-1/pos/1.1.kt | 2 +- .../expressions/cast-expression/testsMap.json | 2 +- .../conditional-expressions/p-1/neg/1.1.kt | 1 - .../conditional-expressions/testsMap.json | 8 +-- .../kotlin/spec/utils/parsers/Patterns.kt | 2 +- .../spec/utils/parsers/TestCasesParser.kt | 10 +++- .../spec/utils/parsers/TestInfoParser.kt | 52 ++++++++++--------- .../utils/validators/AbstractTestValidator.kt | 5 +- 17 files changed, 63 insertions(+), 51 deletions(-) diff --git a/compiler/tests-spec/testData/codegen/box/linked/expressions/built-in-types-and-their-semantics/kotlin.nothing-1/p-1/pos/1.2.kt b/compiler/tests-spec/testData/codegen/box/linked/expressions/built-in-types-and-their-semantics/kotlin.nothing-1/p-1/pos/1.2.kt index 078252d534b..74f6751baef 100644 --- a/compiler/tests-spec/testData/codegen/box/linked/expressions/built-in-types-and-their-semantics/kotlin.nothing-1/p-1/pos/1.2.kt +++ b/compiler/tests-spec/testData/codegen/box/linked/expressions/built-in-types-and-their-semantics/kotlin.nothing-1/p-1/pos/1.2.kt @@ -6,7 +6,7 @@ * SPEC VERSION: 0.1-213 * PLACE: expressions, built-in-types-and-their-semantics, kotlin.nothing-1 -> paragraph 1 -> sentence 1 * NUMBER: 2 - * DESCRIPTION: + * DESCRIPTION: check kotlin.Nothing type */ fun box(): String { diff --git a/compiler/tests-spec/testData/codegen/box/linked/expressions/built-in-types-and-their-semantics/kotlin.nothing-1/p-1/pos/1.3.kt b/compiler/tests-spec/testData/codegen/box/linked/expressions/built-in-types-and-their-semantics/kotlin.nothing-1/p-1/pos/1.3.kt index c2aed375993..c0df1225d69 100644 --- a/compiler/tests-spec/testData/codegen/box/linked/expressions/built-in-types-and-their-semantics/kotlin.nothing-1/p-1/pos/1.3.kt +++ b/compiler/tests-spec/testData/codegen/box/linked/expressions/built-in-types-and-their-semantics/kotlin.nothing-1/p-1/pos/1.3.kt @@ -6,7 +6,7 @@ * SPEC VERSION: 0.1-213 * PLACE: expressions, built-in-types-and-their-semantics, kotlin.nothing-1 -> paragraph 1 -> sentence 1 * NUMBER: 3 - * DESCRIPTION: + * DESCRIPTION: check kotlin.Nothing type */ fun box(): String { diff --git a/compiler/tests-spec/testData/codegen/box/linked/expressions/built-in-types-and-their-semantics/kotlin.nothing-1/p-1/pos/1.4.kt b/compiler/tests-spec/testData/codegen/box/linked/expressions/built-in-types-and-their-semantics/kotlin.nothing-1/p-1/pos/1.4.kt index 75a551ecbe2..e0f021ecac5 100644 --- a/compiler/tests-spec/testData/codegen/box/linked/expressions/built-in-types-and-their-semantics/kotlin.nothing-1/p-1/pos/1.4.kt +++ b/compiler/tests-spec/testData/codegen/box/linked/expressions/built-in-types-and-their-semantics/kotlin.nothing-1/p-1/pos/1.4.kt @@ -6,7 +6,7 @@ * SPEC VERSION: 0.1-213 * PLACE: expressions, built-in-types-and-their-semantics, kotlin.nothing-1 -> paragraph 1 -> sentence 1 * NUMBER: 4 - * DESCRIPTION: + * DESCRIPTION: check kotlin.Nothing type */ diff --git a/compiler/tests-spec/testData/codegen/box/linked/expressions/built-in-types-and-their-semantics/kotlin.nothing-1/p-1/pos/1.5.kt b/compiler/tests-spec/testData/codegen/box/linked/expressions/built-in-types-and-their-semantics/kotlin.nothing-1/p-1/pos/1.5.kt index faaef87f8ad..83e2ea5f468 100644 --- a/compiler/tests-spec/testData/codegen/box/linked/expressions/built-in-types-and-their-semantics/kotlin.nothing-1/p-1/pos/1.5.kt +++ b/compiler/tests-spec/testData/codegen/box/linked/expressions/built-in-types-and-their-semantics/kotlin.nothing-1/p-1/pos/1.5.kt @@ -6,7 +6,7 @@ * SPEC VERSION: 0.1-213 * PLACE: expressions, built-in-types-and-their-semantics, kotlin.nothing-1 -> paragraph 1 -> sentence 1 * NUMBER: 5 - * DESCRIPTION: + * DESCRIPTION: check kotlin.Nothing type */ diff --git a/compiler/tests-spec/testData/codegen/box/linked/expressions/built-in-types-and-their-semantics/kotlin.nothing-1/p-1/pos/1.6.kt b/compiler/tests-spec/testData/codegen/box/linked/expressions/built-in-types-and-their-semantics/kotlin.nothing-1/p-1/pos/1.6.kt index 65e4ff3f8d9..02a1c15c3f6 100644 --- a/compiler/tests-spec/testData/codegen/box/linked/expressions/built-in-types-and-their-semantics/kotlin.nothing-1/p-1/pos/1.6.kt +++ b/compiler/tests-spec/testData/codegen/box/linked/expressions/built-in-types-and-their-semantics/kotlin.nothing-1/p-1/pos/1.6.kt @@ -6,7 +6,7 @@ * SPEC VERSION: 0.1-213 * PLACE: expressions, built-in-types-and-their-semantics, kotlin.nothing-1 -> paragraph 1 -> sentence 1 * NUMBER: 6 - * DESCRIPTION: + * DESCRIPTION: check kotlin.Nothing type */ diff --git a/compiler/tests-spec/testData/codegen/box/linked/expressions/built-in-types-and-their-semantics/kotlin.nothing-1/p-1/pos/1.7.kt b/compiler/tests-spec/testData/codegen/box/linked/expressions/built-in-types-and-their-semantics/kotlin.nothing-1/p-1/pos/1.7.kt index 32f58082169..0e2ed3059a3 100644 --- a/compiler/tests-spec/testData/codegen/box/linked/expressions/built-in-types-and-their-semantics/kotlin.nothing-1/p-1/pos/1.7.kt +++ b/compiler/tests-spec/testData/codegen/box/linked/expressions/built-in-types-and-their-semantics/kotlin.nothing-1/p-1/pos/1.7.kt @@ -7,7 +7,7 @@ * SPEC VERSION: 0.1-213 * PLACE: expressions, built-in-types-and-their-semantics, kotlin.nothing-1 -> paragraph 1 -> sentence 1 * NUMBER: 7 - * DESCRIPTION: + * DESCRIPTION: check kotlin.Nothing type */ import java.util.* diff --git a/compiler/tests-spec/testData/codegen/box/linked/expressions/built-in-types-and-their-semantics/kotlin.nothing-1/p-1/pos/1.8.kt b/compiler/tests-spec/testData/codegen/box/linked/expressions/built-in-types-and-their-semantics/kotlin.nothing-1/p-1/pos/1.8.kt index 2867c0cbcec..c3e8a2645f8 100644 --- a/compiler/tests-spec/testData/codegen/box/linked/expressions/built-in-types-and-their-semantics/kotlin.nothing-1/p-1/pos/1.8.kt +++ b/compiler/tests-spec/testData/codegen/box/linked/expressions/built-in-types-and-their-semantics/kotlin.nothing-1/p-1/pos/1.8.kt @@ -6,7 +6,7 @@ * SPEC VERSION: 0.1-213 * PLACE: expressions, built-in-types-and-their-semantics, kotlin.nothing-1 -> paragraph 1 -> sentence 1 * NUMBER: 8 - * DESCRIPTION: + * DESCRIPTION: check kotlin.Nothing type */ fun box(): String { diff --git a/compiler/tests-spec/testData/codegen/box/linked/expressions/built-in-types-and-their-semantics/kotlin.nothing-1/p-1/pos/1.9.kt b/compiler/tests-spec/testData/codegen/box/linked/expressions/built-in-types-and-their-semantics/kotlin.nothing-1/p-1/pos/1.9.kt index acd3df1c328..5181f9a9f47 100644 --- a/compiler/tests-spec/testData/codegen/box/linked/expressions/built-in-types-and-their-semantics/kotlin.nothing-1/p-1/pos/1.9.kt +++ b/compiler/tests-spec/testData/codegen/box/linked/expressions/built-in-types-and-their-semantics/kotlin.nothing-1/p-1/pos/1.9.kt @@ -7,7 +7,7 @@ * SPEC VERSION: 0.1-213 * PLACE: expressions, built-in-types-and-their-semantics, kotlin.nothing-1 -> paragraph 1 -> sentence 1 * NUMBER: 9 - * DESCRIPTION: + * DESCRIPTION: check kotlin.Nothing type */ fun box(): String { diff --git a/compiler/tests-spec/testData/codegen/box/linked/expressions/built-in-types-and-their-semantics/kotlin.nothing-1/testsMap.json b/compiler/tests-spec/testData/codegen/box/linked/expressions/built-in-types-and-their-semantics/kotlin.nothing-1/testsMap.json index 497e261a5ed..21f9e744303 100644 --- a/compiler/tests-spec/testData/codegen/box/linked/expressions/built-in-types-and-their-semantics/kotlin.nothing-1/testsMap.json +++ b/compiler/tests-spec/testData/codegen/box/linked/expressions/built-in-types-and-their-semantics/kotlin.nothing-1/testsMap.json @@ -5,25 +5,25 @@ { "specVersion": "0.1-213", "casesNumber": 0, - "description": "", + "description": "check kotlin.Nothing type", "unexpectedBehaviour": false }, { "specVersion": "0.1-213", "casesNumber": 0, - "description": "", + "description": "check kotlin.Nothing type", "unexpectedBehaviour": false }, { "specVersion": "0.1-213", "casesNumber": 0, - "description": "", + "description": "check kotlin.Nothing type", "unexpectedBehaviour": false }, { "specVersion": "0.1-213", "casesNumber": 0, - "description": "", + "description": "check kotlin.Nothing type", "unexpectedBehaviour": false }, { @@ -35,25 +35,25 @@ { "specVersion": "0.1-213", "casesNumber": 0, - "description": "", + "description": "check kotlin.Nothing type", "unexpectedBehaviour": false }, { "specVersion": "0.1-213", "casesNumber": 0, - "description": "", + "description": "check kotlin.Nothing type", "unexpectedBehaviour": false }, { "specVersion": "0.1-213", "casesNumber": 0, - "description": "", + "description": "check kotlin.Nothing type", "unexpectedBehaviour": false }, { "specVersion": "0.1-213", "casesNumber": 0, - "description": "", + "description": "check kotlin.Nothing type", "unexpectedBehaviour": false }, { diff --git a/compiler/tests-spec/testData/codegen/box/linked/expressions/cast-expression/p-1/pos/1.1.kt b/compiler/tests-spec/testData/codegen/box/linked/expressions/cast-expression/p-1/pos/1.1.kt index 5c7016e5115..4d960f60c09 100644 --- a/compiler/tests-spec/testData/codegen/box/linked/expressions/cast-expression/p-1/pos/1.1.kt +++ b/compiler/tests-spec/testData/codegen/box/linked/expressions/cast-expression/p-1/pos/1.1.kt @@ -6,7 +6,7 @@ * SPEC VERSION: 0.1-213 * PLACE: expressions, cast-expression -> paragraph 1 -> sentence 1 * NUMBER: 1 - * DESCRIPTION: check of the cast operators as or as? + * DESCRIPTION: check of the cast operators as or as? */ fun box(): String { diff --git a/compiler/tests-spec/testData/codegen/box/linked/expressions/cast-expression/testsMap.json b/compiler/tests-spec/testData/codegen/box/linked/expressions/cast-expression/testsMap.json index 2d10f339a39..c822e879664 100644 --- a/compiler/tests-spec/testData/codegen/box/linked/expressions/cast-expression/testsMap.json +++ b/compiler/tests-spec/testData/codegen/box/linked/expressions/cast-expression/testsMap.json @@ -5,7 +5,7 @@ { "specVersion": "0.1-213", "casesNumber": 0, - "description": " check of the cast operators as or as?", + "description": "check of the cast operators as or as?", "unexpectedBehaviour": false } ] diff --git a/compiler/tests-spec/testData/diagnostics/linked/control--and-data-flow-analysis/control-flow-graph/expressions-1/conditional-expressions/p-1/neg/1.1.kt b/compiler/tests-spec/testData/diagnostics/linked/control--and-data-flow-analysis/control-flow-graph/expressions-1/conditional-expressions/p-1/neg/1.1.kt index 77f1dac389b..6d0b8f12020 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/control--and-data-flow-analysis/control-flow-graph/expressions-1/conditional-expressions/p-1/neg/1.1.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/control--and-data-flow-analysis/control-flow-graph/expressions-1/conditional-expressions/p-1/neg/1.1.kt @@ -9,7 +9,6 @@ * PLACE: control--and-data-flow-analysis, control-flow-graph, expressions-1, conditional-expressions -> paragraph 1 -> sentence 1 * NUMBER: 1 * DESCRIPTION: check if-expressions must have both branches. - * HELPERS: */ // TESTCASE NUMBER: 1 diff --git a/compiler/tests-spec/testData/diagnostics/linked/control--and-data-flow-analysis/control-flow-graph/expressions-1/conditional-expressions/testsMap.json b/compiler/tests-spec/testData/diagnostics/linked/control--and-data-flow-analysis/control-flow-graph/expressions-1/conditional-expressions/testsMap.json index 37ddf0ae351..f7f1a1e30e5 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/control--and-data-flow-analysis/control-flow-graph/expressions-1/conditional-expressions/testsMap.json +++ b/compiler/tests-spec/testData/diagnostics/linked/control--and-data-flow-analysis/control-flow-graph/expressions-1/conditional-expressions/testsMap.json @@ -5,7 +5,7 @@ { "specVersion": "0.1-213", "casesNumber": 2, - "description": "* HELPERS: checkType", + "description": "check any if-statement in kotlin may be trivially turned into such an expression by replacing the missing branch with a kotlin.Unit object expression.", "unexpectedBehaviour": false } ], @@ -13,7 +13,7 @@ { "specVersion": "0.1-213", "casesNumber": 2, - "description": "* HELPERS:", + "description": "check if-expressions must have both branches.", "unexpectedBehaviour": false } ] @@ -23,7 +23,7 @@ { "specVersion": "0.1-213", "casesNumber": 2, - "description": "* HELPERS: checkType, functions", + "description": "check any if-statement in kotlin may be trivially turned into such an expression by replacing the missing branch with a kotlin.Unit object expression.", "unexpectedBehaviour": false } ], @@ -31,7 +31,7 @@ { "specVersion": "0.1-213", "casesNumber": 3, - "description": "* HELPERS: checkType, functions", + "description": "check if-expressions must have both branches.", "unexpectedBehaviour": false }, { diff --git a/compiler/tests-spec/tests/org/jetbrains/kotlin/spec/utils/parsers/Patterns.kt b/compiler/tests-spec/tests/org/jetbrains/kotlin/spec/utils/parsers/Patterns.kt index 188d300f9af..6f4124fa876 100644 --- a/compiler/tests-spec/tests/org/jetbrains/kotlin/spec/utils/parsers/Patterns.kt +++ b/compiler/tests-spec/tests/org/jetbrains/kotlin/spec/utils/parsers/Patterns.kt @@ -39,7 +39,7 @@ object CommonPatterns { """${SINGLE_LINE_COMMENT_REGEX.format("""[\w\s]+:""")}|${MULTILINE_COMMENT_REGEX.format(""" $ASTERISK_REGEX [\w\s]+:[\s\S]*?""")}""" val testAreaRegex = """(?${TestArea.joinedValues})""" val testTypeRegex = """(?${TestType.joinedValues})""" - val testInfoElementPattern: Pattern = Pattern.compile("""(?: \* )?(?[A-Z ]+?)(?::\s*(?.*?))?\n""") + val testInfoElementPattern: Pattern = Pattern.compile("""(?: \* )?(?[A-Z ]+?)(?::[ ]?(?.*?))?\n""") val testPathBaseRegexTemplate = """^.*?$ps(?diagnostics|psi|(?:codegen${ps}box))$ps%s""" val testPathRegexTemplate = """$testPathBaseRegexTemplate$ps(?pos|neg)$ps%s$""" val issuesPattern: Pattern = Pattern.compile("""(KT-[1-9]\d*)(,\s*KT-[1-9]\d*)*""") diff --git a/compiler/tests-spec/tests/org/jetbrains/kotlin/spec/utils/parsers/TestCasesParser.kt b/compiler/tests-spec/tests/org/jetbrains/kotlin/spec/utils/parsers/TestCasesParser.kt index 8f24b78c1b8..217d6a1ed43 100644 --- a/compiler/tests-spec/tests/org/jetbrains/kotlin/spec/utils/parsers/TestCasesParser.kt +++ b/compiler/tests-spec/tests/org/jetbrains/kotlin/spec/utils/parsers/TestCasesParser.kt @@ -13,6 +13,8 @@ import org.jetbrains.kotlin.spec.utils.models.SpecTestCaseInfoElementType import org.jetbrains.kotlin.spec.utils.models.SpecTestInfoElements import org.jetbrains.kotlin.spec.utils.parsers.TestCasePatterns.testCaseInfoPattern import org.jetbrains.kotlin.spec.utils.parsers.CommonParser.splitByComma +import org.jetbrains.kotlin.spec.utils.validators.SpecTestValidationException +import org.jetbrains.kotlin.spec.utils.validators.SpecTestValidationFailedReason import java.util.* private operator fun SpecTestCase.plusAssign(addTestCase: SpecTestCase) { @@ -30,7 +32,13 @@ private fun SpecTestCase.save( caseInfoElements: SpecTestInfoElements ) { val testCaseNumbers = - caseInfoElements[SpecTestCaseInfoElementType.TESTCASE_NUMBER]!!.content.splitByComma().map { it.trim().toInt() } + caseInfoElements[SpecTestCaseInfoElementType.TESTCASE_NUMBER]!!.content.splitByComma().map { + it.trim().toIntOrNull() + ?: throw SpecTestValidationException( + SpecTestValidationFailedReason.TEST_CASE_NUMBER_FORMAT, + "impossible to parse number '${it.trim()}'" + ) + } val startPosition = this.ranges[0].first testCaseNumbers.forEach { testCaseNumber -> diff --git a/compiler/tests-spec/tests/org/jetbrains/kotlin/spec/utils/parsers/TestInfoParser.kt b/compiler/tests-spec/tests/org/jetbrains/kotlin/spec/utils/parsers/TestInfoParser.kt index e7ca6f5ff2f..4e37cd1e7fe 100644 --- a/compiler/tests-spec/tests/org/jetbrains/kotlin/spec/utils/parsers/TestInfoParser.kt +++ b/compiler/tests-spec/tests/org/jetbrains/kotlin/spec/utils/parsers/TestInfoParser.kt @@ -31,33 +31,37 @@ data class ParsedTestFile( ) fun parseTestInfo(testFilePath: String, testFiles: TestFiles, linkedTestType: SpecTestLinkedType): ParsedTestFile { - val patterns = linkedTestType.patterns.value - val testInfoByFilenameMatcher = patterns.testPathPattern.matcher(testFilePath) + try { + val patterns = linkedTestType.patterns.value + val testInfoByFilenameMatcher = patterns.testPathPattern.matcher(testFilePath) - if (!testInfoByFilenameMatcher.find()) - throw SpecTestValidationException(SpecTestValidationFailedReason.FILENAME_NOT_VALID) + if (!testInfoByFilenameMatcher.find()) + throw SpecTestValidationException(SpecTestValidationFailedReason.FILENAME_NOT_VALID) - val testInfoByContentMatcher = patterns.testInfoPattern.matcher(FileUtil.loadFile(File(testFilePath), true)) + val testInfoByContentMatcher = patterns.testInfoPattern.matcher(FileUtil.loadFile(File(testFilePath), true)) - if (!testInfoByContentMatcher.find()) - throw SpecTestValidationException(SpecTestValidationFailedReason.TESTINFO_NOT_VALID) + if (!testInfoByContentMatcher.find()) + throw SpecTestValidationException(SpecTestValidationFailedReason.TESTINFO_NOT_VALID) - val testInfoElements = CommonParser.parseTestInfoElements( - arrayOf(*CommonInfoElementType.values(), *CommonSpecTestFileInfoElementType.values(), *linkedTestType.infoElements.value), - testInfoByContentMatcher.group("infoElements") - ) - val helpers = testInfoElements[CommonSpecTestFileInfoElementType.HELPERS]?.content?.splitByComma()?.toSet() + val testInfoElements = CommonParser.parseTestInfoElements( + arrayOf(*CommonInfoElementType.values(), *CommonSpecTestFileInfoElementType.values(), *linkedTestType.infoElements.value), + testInfoByContentMatcher.group("infoElements") + ) + val helpers = testInfoElements[CommonSpecTestFileInfoElementType.HELPERS]?.content?.splitByComma()?.toSet() - return ParsedTestFile( - testArea = TestArea.valueOf(testInfoByContentMatcher.group("testArea").withUnderscores()), - testType = TestType.valueOf(testInfoByContentMatcher.group("testType")), - testNumber = testInfoElements[CommonSpecTestFileInfoElementType.NUMBER]!!.content.toInt(), - testDescription = testInfoElements[CommonSpecTestFileInfoElementType.DESCRIPTION]!!.content, - testInfoElements = testInfoElements, - testCasesSet = parseTestCases(testFiles), - unexpectedBehavior = testInfoElements.contains(CommonInfoElementType.UNEXPECTED_BEHAVIOUR), - issues = CommonParser.parseIssues(testInfoElements[CommonInfoElementType.ISSUES]), - helpers = helpers, - exception = testInfoElements[CommonInfoElementType.EXCEPTION]?.content?.let { TestsExceptionType.fromValue(it) } - ) + return ParsedTestFile( + testArea = TestArea.valueOf(testInfoByContentMatcher.group("testArea").withUnderscores()), + testType = TestType.valueOf(testInfoByContentMatcher.group("testType")), + testNumber = testInfoElements[CommonSpecTestFileInfoElementType.NUMBER]!!.content.toInt(), + testDescription = testInfoElements[CommonSpecTestFileInfoElementType.DESCRIPTION]!!.content, + testInfoElements = testInfoElements, + testCasesSet = parseTestCases(testFiles), + unexpectedBehavior = testInfoElements.contains(CommonInfoElementType.UNEXPECTED_BEHAVIOUR), + issues = CommonParser.parseIssues(testInfoElements[CommonInfoElementType.ISSUES]), + helpers = helpers, + exception = testInfoElements[CommonInfoElementType.EXCEPTION]?.content?.let { TestsExceptionType.fromValue(it) } + ) + } catch (e: Exception) { + error("Wrong format of file:\nfile://$testFilePath \n${e.message}") + } } diff --git a/compiler/tests-spec/tests/org/jetbrains/kotlin/spec/utils/validators/AbstractTestValidator.kt b/compiler/tests-spec/tests/org/jetbrains/kotlin/spec/utils/validators/AbstractTestValidator.kt index 15b56b8f187..2b742d9a7a6 100644 --- a/compiler/tests-spec/tests/org/jetbrains/kotlin/spec/utils/validators/AbstractTestValidator.kt +++ b/compiler/tests-spec/tests/org/jetbrains/kotlin/spec/utils/validators/AbstractTestValidator.kt @@ -23,10 +23,11 @@ enum class SpecTestValidationFailedReason(val description: String) { UNKNOWN_FRONTEND_EXCEPTION("Unknown frontend exception. Manual analysis is required."), UNMATCHED_FRONTEND_EXCEPTION("Unmatched frontend exception. Manual analysis is required."), UNKNOWN("Unknown validation error."), - INCONSISTENT_REASONS("Inconsistent fail reasons: all test cases should have one fail reason within one test.") + INCONSISTENT_REASONS("Inconsistent fail reasons: all test cases should have one fail reason within one test."), + TEST_CASE_NUMBER_FORMAT("Wrong format of testcase number: only integers are allowed.") } -class SpecTestValidationException(reason: SpecTestValidationFailedReason, details: String = "") : Exception() { +class SpecTestValidationException(reason: SpecTestValidationFailedReason, details: String = "") : Exception("${reason.description} \nDetails: $details") { val description = "${reason.description} $details" }