Skip to content

Commit

Permalink
refactor: add newline indent test for anonymous fn
Browse files Browse the repository at this point in the history
  • Loading branch information
themartdev committed Sep 15, 2024
1 parent 129977a commit 5faa401
Showing 1 changed file with 18 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,24 @@ class GleamNewlineIndentTest : LightPlatformCodeInsightFixture4TestCase() {
testNewlineIndentation(before, after)
}

@Test
fun testAnonymousFn() {
val before = """
fn main() {
let x = fn() {<caret>}
}
""".trimIndent()

val after = """
fn main() {
let x = fn() {
<caret>
}
}
""".trimIndent()
testNewlineIndentation(before, after)
}

private fun testNewlineIndentation(before: String, after: String) {
myFixture.configureByText(GleamFileType, before)
myFixture.type('\n')
Expand Down

0 comments on commit 5faa401

Please sign in to comment.