Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ internal class DefaultUsageHintGroupTextPreRenderer : TypedTextPreRenderer<Usage
reportable: UsageHintGroup,
controlObject: TextPreRenderControlObject
): List<OutputNode> {
if (controlObject.explainsProof) return emptyList()
val newControlObject = controlObject.copy(prefix = Icon.BULB, indentLevel = controlObject.indentLevel + 1)
return OutputNode.singleWithoutColumnsNotOwnLevel(children = reportable.children.flatMap { child ->
controlObject.transformChildIncludingIndentationAndPrefix(child, newControlObject)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -764,6 +764,73 @@ class CreateReportTest {
)
}

@Test
fun proofExplanation_With_UsageHint() {
val builder = buildRootGroup {
proofGroup(Text("not to contain"), Text.EMPTY) {
invisibleFailingProofGroup {
proofExplanation {
simpleProof(Text("to be greater than"), 2) { false }
usageHintGroup {
add(ErrorMessages.FORGOT_DO_DEFINE_EXPECTATION)
addAll(defaultHintsAtLeastOneExpectationDefined)
}
}
}
}
}

expectForReporterWithoutAnsi(
builder,
"""
|a verb : "representation"
|(f) not to contain :${' '}
| » to be greater than : 2
""".trimMargin()
)

expectForReporterWithAnsi(
builder,
"""
|a verb : "representation"
|$x not to contain :${' '}
| » to be greater than : 2
""".trimMargin()
)
}
@Test
fun proofExplanation_With_UsageHint_Not_As_Direct_Child() {

val builder = buildRootGroup {

proofGroup(Text("Elements need all"), Text.EMPTY){
invisibleFailingProofGroup {
proofExplanation {
feature(Text("password"), Text("should not be shown")) {
simpleProof(Text("not to equal"), "qwerty") { false }
usageHintGroup {
add(ErrorMessages.FORGOT_DO_DEFINE_EXPECTATION)
addAll(defaultHintsAtLeastOneExpectationDefined)
}


}
}
}
}
}
expectForReporterWithoutAnsi(
builder,
"""
|a verb : "representation"
|(f) Elements need all :${' '}
| » > password :${' '}
| • not to equal : "qwerty"
""".trimMargin()

)
}

@Test
fun row_withIconAndWithoutBorder() {
val builder = buildRootGroup {
Expand Down
Loading