Skip to content

Commit edf278c

Browse files
strulovichfacebook-github-bot
authored andcommitted
Remove printOps from default test running
Summary: I agreed with Nick Reid this was a bit too much, and the fact Github actions prints it all makes looking at breaks on Github mightily annoying. (vs. Meta infra not showing prints unless a test fails) An alternative is changing the code so the ops are extractable, but I went with time saving since I don't think we have many bugs needing this information right now. Reviewed By: cgrushko Differential Revision: D35611026 fbshipit-source-id: 17eb2a029f562dabe2caf573862f24ed01efc897
1 parent d82fa63 commit edf278c

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

core/src/test/java/com/facebook/ktfmt/testutil/KtfmtTruth.kt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,12 +74,11 @@ fun assertThatFormatting(code: String): FormattedCodeSubject {
7474

7575
class FormattedCodeSubject(metadata: FailureMetadata, private val code: String) :
7676
Subject(metadata, code) {
77-
private var options: FormattingOptions =
78-
FormattingOptions(debuggingPrintOpsAfterFormatting = true)
77+
private var options: FormattingOptions = FormattingOptions()
7978
private var allowTrailingWhitespace = false
8079

8180
fun withOptions(options: FormattingOptions): FormattedCodeSubject {
82-
this.options = options.copy(debuggingPrintOpsAfterFormatting = true)
81+
this.options = options
8382
return this
8483
}
8584

@@ -109,6 +108,9 @@ class FormattedCodeSubject(metadata: FailureMetadata, private val code: String)
109108
println("#".repeat(20))
110109
println(expectedFormatting)
111110
println("#".repeat(20))
111+
println(
112+
"Need more information about the break operations?" +
113+
"Run test with assertion with \"FormattingOptions(debuggingPrintOpsAfterFormatting = true)\"")
112114
}
113115
} catch (e: Error) {
114116
reportError(code)

0 commit comments

Comments
 (0)