I am using a self-defined function(assertFailsWith) within a function body, but getting ANTLR parser error in line "assertFailsWith(IllegalArgumentException::class) {" :
mismatched input '{' expecting {NL, '}',
I am using Kotlin grammar from https://github.com/antlr/grammars-v4/tree/master/kotlin/kotlin
Do I need any changes in the below part to remove the error:
functionBody
: block
| ASSIGNMENT NL* expression
;
block
: LCURL statements RCURL
;
@Test
fun `Create invalid test`() {
assertFailsWith(IllegalArgumentException::class) {
// Variables
val realVocabPath = "realVocabPath"
val realAlphabetPath = "realAlphabetPath"
val vocabFactory = VocabFactory(mockFileLoader, 0.6f)
// Execute
val vocab = vocabFactory.create(realVocabPath, realAlphabetPath, mockEngineSpec)
// Verify
assertEquals(mockWordPieceVocab, vocab)
}
}