Skip to content

Commit

Permalink
ScalafmtConfigTest: test withoutRewrites
Browse files Browse the repository at this point in the history
Similar test is run in DynamicSuite and is now apparently failing with
recent versions.
  • Loading branch information
kitbellew committed Oct 3, 2023
1 parent f063d97 commit 3adc085
Showing 1 changed file with 25 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -83,4 +83,29 @@ class ScalafmtConfigTest extends FunSuite {
assert(config2.runner.getDialect.allowToplevelTerms)
}

test("hasRewriteRules-and-withoutRewriteRules trailingCommas") {
val config1 = Config
.fromHoconString("""
|runner.dialect = scala213
|rewrite.trailingCommas = never
|""".stripMargin)
.get
assert(config1.hasRewrites)
val config2 = config1.withoutRewrites
assert(config2.hasRewrites) // XXX: this is incorrect
}

test("hasRewriteRules-and-withoutRewriteRules docstrings") {
val config1 = Config
.fromHoconString("""
|runner.dialect = scala213
|rewrite.trailingCommas = keep
|docstrings.removeEmpty = true
|""".stripMargin)
.get
assert(config1.hasRewrites)
val config2 = config1.withoutRewrites
assert(config2.hasRewrites) // XXX: this is incorrect
}

}

0 comments on commit 3adc085

Please sign in to comment.