rename indentBulletPoint to indentRootBulletPoint where appropriate

This commit is contained in:
Robert Stoll
2020-12-22 21:15:55 +01:00
parent 14927ffdcc
commit 8fa03ed15e
36 changed files with 176 additions and 176 deletions

View File

@@ -93,8 +93,8 @@ abstract class CharSequenceAssertionsSpec(
val hello = TestTranslatable.HELLO.getDefault()
val welcome = TestTranslatable.WELCOME.getDefault()
val indentBulletPoint = " ".repeat(rootBulletPoint.length)
val valueWithIndent = "$indentBulletPoint$listBulletPoint$value"
val indentRootBulletPoint = " ".repeat(rootBulletPoint.length)
val valueWithIndent = "$indentRootBulletPoint$listBulletPoint$value"
describeFun(containsDefaultTranslationOf, containsNotDefaultTranslationOf) {

View File

@@ -68,8 +68,8 @@ abstract class CharSequenceContainsAtLeastAssertionsSpec(
val (containsNot, errorMsgContainsNot) = containsNotPair
val (exactly, errorMsgExactly) = exactlyPair
val indentBulletPoint = " ".repeat(rootBulletPoint.length)
val valueWithIndent = "$indentBulletPoint$listBulletPoint$value"
val indentRootBulletPoint = " ".repeat(rootBulletPoint.length)
val valueWithIndent = "$indentRootBulletPoint$listBulletPoint$value"
describeFun(containsAtLeast, containsAtLeastButAtMost) {

View File

@@ -54,8 +54,8 @@ abstract class CharSequenceContainsAtMostAssertionsSpec(
val (containsNot, errorMsgContainsNot) = containsNotPair
val (exactly, errorMsgExactly) = exactlyPair
val indentBulletPoint = " ".repeat(rootBulletPoint.length)
val valueWithIndent = "$indentBulletPoint$listBulletPoint$value"
val indentRootBulletPoint = " ".repeat(rootBulletPoint.length)
val valueWithIndent = "$indentRootBulletPoint$listBulletPoint$value"
describeFun(containsAtMost) {

View File

@@ -49,8 +49,8 @@ abstract class CharSequenceContainsContainsNotAssertionsSpec(
fun Assert<CharSequence>.containsNotFun(t: String, vararg tX: String)
= containsNotFunArr(t, tX)
val indentBulletPoint = " ".repeat(rootBulletPoint.length)
val valueWithIndent = "$indentBulletPoint$listBulletPoint$value"
val indentRootBulletPoint = " ".repeat(rootBulletPoint.length)
val valueWithIndent = "$indentRootBulletPoint$listBulletPoint$value"
val containsNotDescr = CONTAINS_NOT.getDefault()
describeFun(containsFunName, containsNot) {

View File

@@ -52,8 +52,8 @@ abstract class CharSequenceContainsExactlyAssertionsSpec(
val (containsNot, errorMsgContainsNot) = containsNotPair
val exactly = EXACTLY.getDefault()
val indentBulletPoint = " ".repeat(rootBulletPoint.length)
val valueWithIndent = "$indentBulletPoint$listBulletPoint$value"
val indentRootBulletPoint = " ".repeat(rootBulletPoint.length)
val valueWithIndent = "$indentRootBulletPoint$listBulletPoint$value"
describeFun(containsExactly) {
context("throws an $illegalArgumentException") {

View File

@@ -53,8 +53,8 @@ abstract class CharSequenceContainsNotAssertionsSpec(
val containsNotDescr = DescriptionCharSequenceAssertion.CONTAINS_NOT.getDefault()
val containsNotIgnoringCaseDescr = String.format(DescriptionCharSequenceAssertion.IGNORING_CASE.getDefault(), containsNotDescr)
val indentBulletPoint = " ".repeat(rootBulletPoint.length)
val valueWithIndent = "$indentBulletPoint$listBulletPoint$value"
val indentRootBulletPoint = " ".repeat(rootBulletPoint.length)
val valueWithIndent = "$indentRootBulletPoint$listBulletPoint$value"
describeFun(containsNot) {

View File

@@ -51,8 +51,8 @@ abstract class CharSequenceContainsNotOrAtMostAssertionsSpec(
val (containsNot, errorMsgContainsNot) = containsNotPair
val indentBulletPoint = " ".repeat(rootBulletPoint.length)
val valueWithIndent = "$indentBulletPoint$listBulletPoint$value"
val indentRootBulletPoint = " ".repeat(rootBulletPoint.length)
val valueWithIndent = "$indentRootBulletPoint$listBulletPoint$value"
describeFun(containsNotOrAtMost) {

View File

@@ -77,8 +77,8 @@ abstract class CharSequenceContainsRegexAssertionsSpec(
fun Assert<CharSequence>.containsAtMostIgnoringCaseFun(atLeast: Int, a: String, vararg aX: String)
= containsAtMostIgnoringCaseFunArr(atLeast, a, aX)
val indentBulletPoint = " ".repeat(rootBulletPoint.length)
val regexWithIndent = "$indentBulletPoint$listBulletPoint$stringMatchingRegex"
val indentRootBulletPoint = " ".repeat(rootBulletPoint.length)
val regexWithIndent = "$indentRootBulletPoint$listBulletPoint$stringMatchingRegex"
describeFun(containsRegex) {
context("throws an ${PatternSyntaxException::class.simpleName}") {

View File

@@ -42,12 +42,12 @@ abstract class IterableAllAssertionsSpec(
val all = DescriptionIterableAssertion.ALL.getDefault()
val hasElement = DescriptionIterableAssertion.HAS_ELEMENT.getDefault()
val indentBulletPoint = " ".repeat(rootBulletPoint.length)
val indentRootBulletPoint = " ".repeat(rootBulletPoint.length)
val indentFeatureArrow = " ".repeat(featureArrow.length)
val indentListBulletPoint = " ".repeat(listBulletPoint.length)
val explanatoryPointWithIndent = "$indentBulletPoint$indentListBulletPoint$explanatoryBulletPoint"
val explanatoryPointWithIndent = "$indentRootBulletPoint$indentListBulletPoint$explanatoryBulletPoint"
fun index(index: Int)
= listBulletPoint + String.format(DescriptionIterableAssertion.INDEX.getDefault(), index)
@@ -66,7 +66,7 @@ abstract class IterableAllAssertionsSpec(
}.toThrow<AssertionError> {
messageContains(
"$rootBulletPoint$featureArrow$hasElement: false$separator"+
"$indentBulletPoint$indentFeatureArrow$featureBulletPoint$isDescr: true"
"$indentRootBulletPoint$indentFeatureArrow$featureBulletPoint$isDescr: true"
)
}
}

View File

@@ -44,13 +44,13 @@ abstract class IterableContainsInAnyOrderOnlyEntriesAssertionsSpec(
fun Assert<Iterable<Double?>>.containsInAnyOrderOnlyNullableEntriesFun(t: (Assert<Double>.() -> Unit)?, vararg tX: (Assert<Double>.() -> Unit)?)
= containsInAnyOrderOnlyNullableEntriesArr(t, tX)
val indentBulletPoint = " ".repeat(rootBulletPoint.length)
val indentRootBulletPoint = " ".repeat(rootBulletPoint.length)
val indentSuccessfulBulletPoint = " ".repeat(successfulBulletPoint.length)
val indentFailingBulletPoint = " ".repeat(failingBulletPoint.length)
val indentListBulletPoint = " ".repeat(listBulletPoint.length)
val anEntryAfterSuccess = "$anEntryWhich: $separator$indentBulletPoint$indentSuccessfulBulletPoint$indentListBulletPoint$explanatoryBulletPoint"
val anEntryAfterFailing = "$anEntryWhich: $separator$indentBulletPoint$indentFailingBulletPoint$indentListBulletPoint$explanatoryBulletPoint"
val anEntryAfterSuccess = "$anEntryWhich: $separator$indentRootBulletPoint$indentSuccessfulBulletPoint$indentListBulletPoint$explanatoryBulletPoint"
val anEntryAfterFailing = "$anEntryWhich: $separator$indentRootBulletPoint$indentFailingBulletPoint$indentListBulletPoint$explanatoryBulletPoint"
nonNullableCases(describePrefix,
containsInAnyOrderOnlyEntriesPair,

View File

@@ -49,7 +49,7 @@ abstract class IterableContainsInOrderOnlyEntriesAssertionsSpec(
fun Assert<Iterable<Double?>>.containsInOrderOnlyNullableEntriesFun(t: (Assert<Double>.() -> Unit)?, vararg tX: (Assert<Double>.() -> Unit)?)
= containsInOrderOnlyNullableEntriesArr(t, tX)
val indentBulletPoint = " ".repeat(rootBulletPoint.length)
val indentRootBulletPoint = " ".repeat(rootBulletPoint.length)
val indentSuccessfulBulletPoint = " ".repeat(successfulBulletPoint.length)
val indentFailingBulletPoint = " ".repeat(failingBulletPoint.length)
val indentListBulletPoint = " ".repeat(listBulletPoint.length)
@@ -59,8 +59,8 @@ abstract class IterableContainsInOrderOnlyEntriesAssertionsSpec(
val explanatoryPointWithIndent = "$indentFeatureArrow$indentFeatureBulletPoint$indentListBulletPoint$explanatoryBulletPoint"
val entryWhichWithFeature = "$indentFeatureArrow$featureBulletPoint$anEntryWhich"
val anEntryAfterSuccess = "$entryWhichWithFeature: $separator$indentBulletPoint$indentSuccessfulBulletPoint$explanatoryPointWithIndent"
val anEntryAfterFailing = "$entryWhichWithFeature: $separator$indentBulletPoint$indentFailingBulletPoint$explanatoryPointWithIndent"
val anEntryAfterSuccess = "$entryWhichWithFeature: $separator$indentRootBulletPoint$indentSuccessfulBulletPoint$explanatoryPointWithIndent"
val anEntryAfterFailing = "$entryWhichWithFeature: $separator$indentRootBulletPoint$indentFailingBulletPoint$explanatoryPointWithIndent"
fun entry(index: Int)
= String.format(entryWithIndex, index)
@@ -68,13 +68,13 @@ abstract class IterableContainsInOrderOnlyEntriesAssertionsSpec(
fun Assert<CharSequence>.entrySuccess(index: Int, actual: Any, expected: String): Assert<CharSequence> {
return this.contains.exactly(1).regex(
"\\Q$successfulBulletPoint$featureArrow${entry(index)}: $actual\\E.*$separator" +
"$indentBulletPoint$indentSuccessfulBulletPoint$anEntryAfterSuccess$expected")
"$indentRootBulletPoint$indentSuccessfulBulletPoint$anEntryAfterSuccess$expected")
}
fun Assert<CharSequence>.entryFailing(index: Int, actual: Any, expected: String): Assert<CharSequence> {
return this.contains.exactly(1).regex(
"\\Q$failingBulletPoint$featureArrow${entry(index)}: $actual\\E.*$separator" +
"$indentBulletPoint$indentFailingBulletPoint$anEntryAfterFailing$expected")
"$indentRootBulletPoint$indentFailingBulletPoint$anEntryAfterFailing$expected")
}
nonNullableCases(describePrefix,

View File

@@ -45,7 +45,7 @@ abstract class IterableContainsInOrderOnlyGroupedEntriesAssertionsSpec(
fun Assert<Iterable<Double?>>.containsInOrderOnlyGroupedEntriesFun(t1: Group<(Assert<Double>.() -> Unit)?>, t2: Group<(Assert<Double>.() -> Unit)?>, vararg tX: Group<(Assert<Double>.() -> Unit)?>)
= containsInOrderOnlyGroupedEntriesFunArr(t1, t2, tX)
val indentBulletPoint = " ".repeat(rootBulletPoint.length)
val indentRootBulletPoint = " ".repeat(rootBulletPoint.length)
val indentSuccessfulBulletPoint = " ".repeat(successfulBulletPoint.length)
val indentFailingBulletPoint = " ".repeat(failingBulletPoint.length)
val indentListBulletPoint = " ".repeat(listBulletPoint.length)
@@ -62,17 +62,17 @@ abstract class IterableContainsInOrderOnlyGroupedEntriesAssertionsSpec(
fun index(fromIndex: Int, toIndex: Int)
= String.format(DescriptionIterableAssertion.INDEX_FROM_TO.getDefault(), fromIndex, toIndex)
fun entry(prefix: String, bulletPoint: String, indentBulletPoint: String, expected: Array<out String>)
fun entry(prefix: String, bulletPoint: String, indentRootBulletPoint: String, expected: Array<out String>)
= expected.joinToString(".*$separator") {
"$prefix\\Q$bulletPoint$anEntryWhich: \\E$separator" +
"$prefix$indentBulletPoint$indentListBulletPoint$explanatoryBulletPoint$it"
"$prefix$indentRootBulletPoint$indentListBulletPoint$explanatoryBulletPoint$it"
}
fun size(prefix: String, bulletPoint: String, actual: Int, expected: Int)
= "$prefix\\Q$bulletPoint\\E${featureArrow}size: $actual[^:]+: $expected"
val afterFail = "$indentBulletPoint$indentFailingBulletPoint$indentFeatureArrow$indentFeatureBulletPoint"
val afterFail = "$indentRootBulletPoint$indentFailingBulletPoint$indentFeatureArrow$indentFeatureBulletPoint"
fun failAfterFail(vararg expected: String)
= entry(afterFail, failingBulletPoint, indentFailingBulletPoint, expected)
@@ -96,7 +96,7 @@ abstract class IterableContainsInOrderOnlyGroupedEntriesAssertionsSpec(
= warning(additionalEntries, entryWithValue) { "${entryWithIndex(it.first)}: ${it.second}" }
val afterSuccess = "$indentBulletPoint$indentSuccessfulBulletPoint$indentFeatureArrow$indentFeatureBulletPoint"
val afterSuccess = "$indentRootBulletPoint$indentSuccessfulBulletPoint$indentFeatureArrow$indentFeatureBulletPoint"
fun successAfterSuccess(vararg expected: String)
= entry(afterSuccess, successfulBulletPoint, indentSuccessfulBulletPoint, expected)
@@ -107,14 +107,14 @@ abstract class IterableContainsInOrderOnlyGroupedEntriesAssertionsSpec(
fun Assert<CharSequence>.indexSuccess(index: Int, actual: Any, expected: String): Assert<CharSequence> {
return this.contains.exactly(1).regex(
"\\Q$successfulBulletPoint$featureArrow${index(index)}: $actual\\E.*$separator" +
"$indentBulletPoint$indentSuccessfulBulletPoint$indentFeatureArrow$featureBulletPoint$anEntryWhich: $separator" +
"$indentRootBulletPoint$indentSuccessfulBulletPoint$indentFeatureArrow$featureBulletPoint$anEntryWhich: $separator" +
"$afterSuccess$indentListBulletPoint$explanatoryBulletPoint$expected")
}
fun Assert<CharSequence>.indexSuccess(fromIndex: Int, toIndex: Int, actual: List<Double?>, vararg expected: String): Assert<CharSequence> {
return this.contains.exactly(1).regex(
"\\Q$successfulBulletPoint$featureArrow${index(fromIndex, toIndex)}: $actual\\E.*$separator" +
"$indentBulletPoint$indentFailingBulletPoint$indentFeatureArrow$featureBulletPoint$containsInAnyOrderOnly: $separator" +
"$indentRootBulletPoint$indentFailingBulletPoint$indentFeatureArrow$featureBulletPoint$containsInAnyOrderOnly: $separator" +
expected.joinToString(".*$separator")
)
@@ -123,14 +123,14 @@ abstract class IterableContainsInOrderOnlyGroupedEntriesAssertionsSpec(
fun Assert<CharSequence>.indexFail(index: Int, actual: Any, expected: String): Assert<CharSequence> {
return this.contains.exactly(1).regex(
"\\Q$failingBulletPoint$featureArrow${index(index)}: $actual\\E.*$separator" +
"$indentBulletPoint$indentFailingBulletPoint$indentFeatureArrow$featureBulletPoint$anEntryWhich: $separator" +
"$indentRootBulletPoint$indentFailingBulletPoint$indentFeatureArrow$featureBulletPoint$anEntryWhich: $separator" +
"$afterFail$indentListBulletPoint$explanatoryBulletPoint$expected")
}
fun Assert<CharSequence>.indexFail(fromIndex: Int, toIndex: Int, actual: List<Double?>, vararg expected: String): Assert<CharSequence> {
return this.contains.exactly(1).regex(
"\\Q$failingBulletPoint$featureArrow${index(fromIndex, toIndex)}: $actual\\E.*$separator" +
"$indentBulletPoint$indentFailingBulletPoint$indentFeatureArrow$featureBulletPoint$containsInAnyOrderOnly: $separator" +
"$indentRootBulletPoint$indentFailingBulletPoint$indentFeatureArrow$featureBulletPoint$containsInAnyOrderOnly: $separator" +
expected.joinToString(".*$separator")
)
}
@@ -253,7 +253,7 @@ abstract class IterableContainsInOrderOnlyGroupedEntriesAssertionsSpec(
successSizeAfterFail(3),
mismatchesAfterFail(4.0)
)
containsRegex(size(indentBulletPoint, successfulBulletPoint, 5, 5))
containsRegex(size(indentRootBulletPoint, successfulBulletPoint, 5, 5))
}
}
}
@@ -281,7 +281,7 @@ abstract class IterableContainsInOrderOnlyGroupedEntriesAssertionsSpec(
successAfterSuccess("$toBeDescr: 4.0"),
successSizeAfterFail(3)
)
containsRegex(size(indentBulletPoint, successfulBulletPoint, 5, 5))
containsRegex(size(indentRootBulletPoint, successfulBulletPoint, 5, 5))
}
}
}
@@ -301,7 +301,7 @@ abstract class IterableContainsInOrderOnlyGroupedEntriesAssertionsSpec(
successAfterSuccess("$toBeDescr: 4.0", "$toBeDescr: 2.0", "$toBeDescr: 3.0"),
successSizeAfterSuccess(3)
)
containsRegex(size(indentBulletPoint, failingBulletPoint, 5, 4))
containsRegex(size(indentRootBulletPoint, failingBulletPoint, 5, 4))
containsRegex(additional(4 to 4.0))
}
}
@@ -315,7 +315,7 @@ abstract class IterableContainsInOrderOnlyGroupedEntriesAssertionsSpec(
contains.exactly(1).value("$rootBulletPoint$containsInOrderOnlyGrouped:")
indexSuccess(0, 1.0, "$toBeDescr: 1.0")
indexFail(1, 2.0, "$toBeDescr: 4.0")
containsRegex(size(indentBulletPoint, failingBulletPoint, 5, 2))
containsRegex(size(indentRootBulletPoint, failingBulletPoint, 5, 2))
containsRegex(additional(2 to 3.0, 3 to 4.0, 4 to 4.0))
}
}
@@ -337,7 +337,7 @@ abstract class IterableContainsInOrderOnlyGroupedEntriesAssertionsSpec(
mismatchesAfterFail(2.0)
)
indexFail(2, 3.0, "$toBeDescr: 5.0")
containsRegex(size(indentBulletPoint, failingBulletPoint, 5, 3))
containsRegex(size(indentRootBulletPoint, failingBulletPoint, 5, 3))
containsRegex(additional(3 to 4.0, 4 to 4.0))
}
}
@@ -367,7 +367,7 @@ abstract class IterableContainsInOrderOnlyGroupedEntriesAssertionsSpec(
successAfterFail("$toBeDescr: 4.0"),
failSizeAfterFail(1, 2)
)
containsRegex(size(indentBulletPoint, failingBulletPoint, 5, 6))
containsRegex(size(indentRootBulletPoint, failingBulletPoint, 5, 6))
}
}
}

View File

@@ -52,7 +52,7 @@ abstract class IterableContainsInOrderOnlyGroupedValuesAssertionsSpec(
fun Assert<Iterable<Double?>>.containsInOrderOnlyGroupedNullableValuesFun(t1: Group<Double?>, t2: Group<Double?>, vararg tX: Group<Double?>)
= containsInOrderOnlyGroupedNullableValuesFunArr(t1,t2, tX)
val indentBulletPoint = " ".repeat(rootBulletPoint.length)
val indentRootBulletPoint = " ".repeat(rootBulletPoint.length)
val indentSuccessfulBulletPoint = " ".repeat(successfulBulletPoint.length)
val indentFailingBulletPoint = " ".repeat(failingBulletPoint.length)
val indentFeatureArrow = " ".repeat(featureArrow.length)
@@ -60,8 +60,8 @@ abstract class IterableContainsInOrderOnlyGroupedValuesAssertionsSpec(
val indentWarningBulletPoint = " ".repeat(warningBulletPoint.length)
val toBeWithFeature = "$indentFeatureArrow$featureBulletPoint${TO_BE.getDefault()}"
val toBeAfterSuccess = "$indentBulletPoint$indentSuccessfulBulletPoint$toBeWithFeature"
val toBeAfterFailing = "$indentBulletPoint$indentFailingBulletPoint$toBeWithFeature"
val toBeAfterSuccess = "$indentRootBulletPoint$indentSuccessfulBulletPoint$toBeWithFeature"
val toBeAfterFailing = "$indentRootBulletPoint$indentFailingBulletPoint$toBeWithFeature"
fun index(index: Int)
= String.format(DescriptionIterableAssertion.INDEX.getDefault(), index)
@@ -79,7 +79,7 @@ abstract class IterableContainsInOrderOnlyGroupedValuesAssertionsSpec(
= "$prefix\\Q$bulletPoint\\E${featureArrow}size: $actual[^:]+: $expected"
val afterFail = "$indentBulletPoint$indentFailingBulletPoint$indentFeatureArrow$indentFeatureBulletPoint"
val afterFail = "$indentRootBulletPoint$indentFailingBulletPoint$indentFeatureArrow$indentFeatureBulletPoint"
fun failAfterFail(vararg expected: Double?)
= entry(afterFail, failingBulletPoint, expected)
@@ -103,7 +103,7 @@ abstract class IterableContainsInOrderOnlyGroupedValuesAssertionsSpec(
= warning(additionalEntries, entryWithValue) { "${entryWithIndex(it.first)}: ${it.second}" }
val afterSuccess = "$indentBulletPoint$indentSuccessfulBulletPoint$indentFeatureArrow$indentFeatureBulletPoint"
val afterSuccess = "$indentRootBulletPoint$indentSuccessfulBulletPoint$indentFeatureArrow$indentFeatureBulletPoint"
fun successAfterSuccess(vararg expected: Double?)
= entry(afterSuccess, successfulBulletPoint, expected)
@@ -120,7 +120,7 @@ abstract class IterableContainsInOrderOnlyGroupedValuesAssertionsSpec(
fun Assert<CharSequence>.indexSuccess(fromIndex: Int, toIndex: Int, actual: List<Double?>, vararg expected: String): Assert<CharSequence> {
return this.contains.exactly(1).regex(
"\\Q$successfulBulletPoint$featureArrow${index(fromIndex, toIndex)}: $actual\\E.*$separator" +
"$indentBulletPoint$indentFailingBulletPoint$indentFeatureArrow$featureBulletPoint$containsInAnyOrderOnly: $separator" +
"$indentRootBulletPoint$indentFailingBulletPoint$indentFeatureArrow$featureBulletPoint$containsInAnyOrderOnly: $separator" +
expected.joinToString(".*$separator")
)
@@ -135,7 +135,7 @@ abstract class IterableContainsInOrderOnlyGroupedValuesAssertionsSpec(
fun Assert<CharSequence>.indexFail(fromIndex: Int, toIndex: Int, actual: List<Double?>, vararg expected: String): Assert<CharSequence> {
return this.contains.exactly(1).regex(
"\\Q$failingBulletPoint$featureArrow${index(fromIndex, toIndex)}: $actual\\E.*$separator" +
"$indentBulletPoint$indentFailingBulletPoint$indentFeatureArrow$featureBulletPoint$containsInAnyOrderOnly: $separator" +
"$indentRootBulletPoint$indentFailingBulletPoint$indentFeatureArrow$featureBulletPoint$containsInAnyOrderOnly: $separator" +
expected.joinToString(".*$separator")
)
}
@@ -231,7 +231,7 @@ abstract class IterableContainsInOrderOnlyGroupedValuesAssertionsSpec(
successSizeAfterFail(3),
mismatchesAfterFail(4.0)
)
containsRegex(size(indentBulletPoint, successfulBulletPoint, 5, 5))
containsRegex(size(indentRootBulletPoint, successfulBulletPoint, 5, 5))
}
}
}
@@ -247,7 +247,7 @@ abstract class IterableContainsInOrderOnlyGroupedValuesAssertionsSpec(
successAfterSuccess(4.0, 2.0, 3.0),
successSizeAfterSuccess(3)
)
containsRegex(size(indentBulletPoint, failingBulletPoint, 5, 4))
containsRegex(size(indentRootBulletPoint, failingBulletPoint, 5, 4))
containsRegex(additional(4 to 4.0))
}
}
@@ -261,7 +261,7 @@ abstract class IterableContainsInOrderOnlyGroupedValuesAssertionsSpec(
contains.exactly(1).value("$rootBulletPoint$containsInOrderOnlyGrouped:")
indexSuccess(0, 1.0)
indexFail(1, 2.0, 4.0)
containsRegex(size(indentBulletPoint, failingBulletPoint, 5, 2))
containsRegex(size(indentRootBulletPoint, failingBulletPoint, 5, 2))
containsRegex(additional(2 to 3.0, 3 to 4.0, 4 to 4.0))
}
}
@@ -279,7 +279,7 @@ abstract class IterableContainsInOrderOnlyGroupedValuesAssertionsSpec(
mismatchesAfterFail(2.0)
)
indexFail(2, 3.0, 5.0)
containsRegex(size(indentBulletPoint, failingBulletPoint, 5, 3))
containsRegex(size(indentRootBulletPoint, failingBulletPoint, 5, 3))
containsRegex(additional(3 to 4.0, 4 to 4.0))
}
}
@@ -299,7 +299,7 @@ abstract class IterableContainsInOrderOnlyGroupedValuesAssertionsSpec(
successAfterFail(4.0),
failSizeAfterFail(1, 2)
)
containsRegex(size(indentBulletPoint, failingBulletPoint, 5, 6))
containsRegex(size(indentRootBulletPoint, failingBulletPoint, 5, 6))
}
}
}
@@ -352,7 +352,7 @@ abstract class IterableContainsInOrderOnlyGroupedValuesAssertionsSpec(
failAfterFail(1.0),
successSizeAfterFail(2)
)
containsRegex(size(indentBulletPoint, successfulBulletPoint, 4, 4))
containsRegex(size(indentRootBulletPoint, successfulBulletPoint, 4, 4))
}
}
}

View File

@@ -44,14 +44,14 @@ abstract class IterableContainsInOrderOnlyValuesAssertionsSpec(
fun Assert<Iterable<Double?>>.containsInOrderOnlyNullableValuesFun(t: Double?, vararg tX: Double?)
= containsInOrderOnlyNullableValuesFunArr(t, tX)
val indentBulletPoint = " ".repeat(rootBulletPoint.length)
val indentRootBulletPoint = " ".repeat(rootBulletPoint.length)
val indentSuccessfulBulletPoint = " ".repeat(successfulBulletPoint.length)
val indentFailingBulletPoint = " ".repeat(failingBulletPoint.length)
val indentFeatureArrow = " ".repeat(featureArrow.length)
val toBeWithFeature = "$indentFeatureArrow$featureBulletPoint${TO_BE.getDefault()}"
val toBeAfterSuccess = "$indentBulletPoint$indentSuccessfulBulletPoint$toBeWithFeature"
val toBeAfterFailing = "$indentBulletPoint$indentFailingBulletPoint$toBeWithFeature"
val toBeAfterSuccess = "$indentRootBulletPoint$indentSuccessfulBulletPoint$toBeWithFeature"
val toBeAfterFailing = "$indentRootBulletPoint$indentFailingBulletPoint$toBeWithFeature"
fun entry(index: Int)
= String.format(entryWithIndex, index)

View File

@@ -49,17 +49,17 @@ abstract class IterableContainsNotEntriesAssertionsSpec(
val containsNotDescr = DescriptionIterableAssertion.CONTAINS_NOT.getDefault()
val hasElement = DescriptionIterableAssertion.HAS_ELEMENT.getDefault()
val indentBulletPoint = " ".repeat(rootBulletPoint.length)
val indentRootBulletPoint = " ".repeat(rootBulletPoint.length)
val indentSuccessfulBulletPoint = " ".repeat(successfulBulletPoint.length)
val indentFailingBulletPoint = " ".repeat(failingBulletPoint.length)
val indentListBulletPoint = " ".repeat(listBulletPoint.length)
val indentFeatureArrow = " ".repeat(featureArrow.length)
val featureSuccess = "$indentBulletPoint$indentListBulletPoint\\Q$successfulBulletPoint$featureArrow\\E"
val featureFailing = "$indentBulletPoint$indentListBulletPoint\\Q$failingBulletPoint$featureArrow\\E"
val isAfterFailing = "$indentBulletPoint$indentListBulletPoint$indentFailingBulletPoint$indentFeatureArrow\\Q$featureBulletPoint\\E$isDescr"
val isAfterSuccess = "$indentBulletPoint$indentListBulletPoint$indentSuccessfulBulletPoint$indentFeatureArrow\\Q$featureBulletPoint\\E$isDescr"
val afterExplanatory = "$indentBulletPoint$indentListBulletPoint$indentSuccessfulBulletPoint\\Q$explanatoryBulletPoint\\E"
val featureSuccess = "$indentRootBulletPoint$indentListBulletPoint\\Q$successfulBulletPoint$featureArrow\\E"
val featureFailing = "$indentRootBulletPoint$indentListBulletPoint\\Q$failingBulletPoint$featureArrow\\E"
val isAfterFailing = "$indentRootBulletPoint$indentListBulletPoint$indentFailingBulletPoint$indentFeatureArrow\\Q$featureBulletPoint\\E$isDescr"
val isAfterSuccess = "$indentRootBulletPoint$indentListBulletPoint$indentSuccessfulBulletPoint$indentFeatureArrow\\Q$featureBulletPoint\\E$isDescr"
val afterExplanatory = "$indentRootBulletPoint$indentListBulletPoint$indentSuccessfulBulletPoint\\Q$explanatoryBulletPoint\\E"
nonNullableCases(
describePrefix,
@@ -80,7 +80,7 @@ abstract class IterableContainsNotEntriesAssertionsSpec(
message {
containsRegex(
"\\Q$rootBulletPoint\\E$containsNotDescr: $separator" +
"$indentBulletPoint\\Q$listBulletPoint\\E$anEntryWhich: $separator"+
"$indentRootBulletPoint\\Q$listBulletPoint\\E$anEntryWhich: $separator"+
"$afterExplanatory$toBeDescr: 4.0.*$separator" +
"$featureSuccess$numberOfOccurrences: 0$separator"+
"$isAfterSuccess: 0.*$separator"+
@@ -115,7 +115,7 @@ abstract class IterableContainsNotEntriesAssertionsSpec(
message {
containsRegex(
"\\Q$rootBulletPoint\\E$containsNotDescr: $separator" +
"$indentBulletPoint\\Q$listBulletPoint\\E$anEntryWhich: $separator"+
"$indentRootBulletPoint\\Q$listBulletPoint\\E$anEntryWhich: $separator"+
"$afterExplanatory$isLessThanDescr: 4.0.*$separator" +
"$featureFailing$numberOfOccurrences: 3$separator"+
"$isAfterFailing: 0.*$separator"+
@@ -132,13 +132,13 @@ abstract class IterableContainsNotEntriesAssertionsSpec(
message {
containsRegex(
"\\Q$rootBulletPoint\\E$containsNotDescr: $separator" +
"$indentBulletPoint\\Q$listBulletPoint\\E$anEntryWhich: $separator"+
"$indentRootBulletPoint\\Q$listBulletPoint\\E$anEntryWhich: $separator"+
"$afterExplanatory$toBeDescr: 1.0.*$separator" +
"$featureFailing$numberOfOccurrences: 1$separator"+
"$isAfterFailing: 0.*$separator"+
"$featureSuccess$hasElement: true$separator" +
"$isAfterSuccess: true$separator"+
"$indentBulletPoint\\Q$listBulletPoint\\E$anEntryWhich: $separator"+
"$indentRootBulletPoint\\Q$listBulletPoint\\E$anEntryWhich: $separator"+
"$afterExplanatory$toBeDescr: 4.0.*$separator" +
"$featureFailing$numberOfOccurrences: 3$separator"+
"$isAfterFailing: 0.*$separator"+
@@ -178,7 +178,7 @@ abstract class IterableContainsNotEntriesAssertionsSpec(
message {
containsRegex(
"\\Q$rootBulletPoint\\E$containsNotDescr: $separator" +
"$indentBulletPoint\\Q$listBulletPoint\\E$anEntryWhich: $separator"+
"$indentRootBulletPoint\\Q$listBulletPoint\\E$anEntryWhich: $separator"+
"$afterExplanatory$isDescr: null$separator" +
"$featureFailing$numberOfOccurrences: 2$separator" +
"$isAfterFailing: 0.*$separator" +
@@ -196,7 +196,7 @@ abstract class IterableContainsNotEntriesAssertionsSpec(
message {
containsRegex(
"\\Q$rootBulletPoint\\E$containsNotDescr: $separator" +
"$indentBulletPoint\\Q$listBulletPoint\\E$anEntryWhich: $separator"+
"$indentRootBulletPoint\\Q$listBulletPoint\\E$anEntryWhich: $separator"+
"$afterExplanatory$isDescr: null$separator" +
"$featureFailing$numberOfOccurrences: 2$separator" +
"$isAfterFailing: 0.*$separator" +

View File

@@ -50,18 +50,18 @@ abstract class IterableContainsNotValuesAssertionsSpec(
val containsNotDescr = DescriptionIterableAssertion.CONTAINS_NOT.getDefault()
val hasElement = DescriptionIterableAssertion.HAS_ELEMENT.getDefault()
val indentBulletPoint = " ".repeat(rootBulletPoint.length)
val indentRootBulletPoint = " ".repeat(rootBulletPoint.length)
val indentSuccessfulBulletPoint = " ".repeat(successfulBulletPoint.length)
val indentFailingBulletPoint = " ".repeat(failingBulletPoint.length)
val indentListBulletPoint = " ".repeat(listBulletPoint.length)
val indentFeatureArrow = " ".repeat(featureArrow.length)
val featureSuccess = "$indentBulletPoint$indentListBulletPoint\\Q$successfulBulletPoint$featureArrow\\E"
val featureFailing = "$indentBulletPoint$indentListBulletPoint\\Q$failingBulletPoint$featureArrow\\E"
val isAfterFailing = "$indentBulletPoint$indentListBulletPoint$indentFailingBulletPoint$indentFeatureArrow\\Q$featureBulletPoint\\E$isDescr"
val isAfterSuccess = "$indentBulletPoint$indentListBulletPoint$indentSuccessfulBulletPoint$indentFeatureArrow\\Q$featureBulletPoint\\E$isDescr"
val featureSuccess = "$indentRootBulletPoint$indentListBulletPoint\\Q$successfulBulletPoint$featureArrow\\E"
val featureFailing = "$indentRootBulletPoint$indentListBulletPoint\\Q$failingBulletPoint$featureArrow\\E"
val isAfterFailing = "$indentRootBulletPoint$indentListBulletPoint$indentFailingBulletPoint$indentFeatureArrow\\Q$featureBulletPoint\\E$isDescr"
val isAfterSuccess = "$indentRootBulletPoint$indentListBulletPoint$indentSuccessfulBulletPoint$indentFeatureArrow\\Q$featureBulletPoint\\E$isDescr"
val anEntryWhichIsWithIndent = "$indentBulletPoint$listBulletPoint$anEntryWhichIs"
val anEntryWhichIsWithIndent = "$indentRootBulletPoint$listBulletPoint$anEntryWhichIs"
nonNullableCases(
describePrefix,

View File

@@ -46,17 +46,17 @@ abstract class IterableNoneAssertionsSpec(
val containsNotDescr = DescriptionIterableAssertion.CONTAINS_NOT.getDefault()
val hasElement = DescriptionIterableAssertion.HAS_ELEMENT.getDefault()
val indentBulletPoint = " ".repeat(rootBulletPoint.length)
val indentRootBulletPoint = " ".repeat(rootBulletPoint.length)
val indentSuccessfulBulletPoint = " ".repeat(successfulBulletPoint.length)
val indentFailingBulletPoint = " ".repeat(failingBulletPoint.length)
val indentListBulletPoint = " ".repeat(listBulletPoint.length)
val indentFeatureArrow = " ".repeat(featureArrow.length)
val featureSuccess = "$indentBulletPoint$indentListBulletPoint\\Q$successfulBulletPoint$featureArrow\\E"
val featureFailing = "$indentBulletPoint$indentListBulletPoint\\Q$failingBulletPoint$featureArrow\\E"
val isAfterFailing = "$indentBulletPoint$indentListBulletPoint$indentFailingBulletPoint$indentFeatureArrow\\Q$featureBulletPoint\\E$isDescr"
val isAfterSuccess = "$indentBulletPoint$indentListBulletPoint$indentSuccessfulBulletPoint$indentFeatureArrow\\Q$featureBulletPoint\\E$isDescr"
val afterExplanatory = "$indentBulletPoint$indentListBulletPoint$indentSuccessfulBulletPoint\\Q$explanatoryBulletPoint\\E"
val featureSuccess = "$indentRootBulletPoint$indentListBulletPoint\\Q$successfulBulletPoint$featureArrow\\E"
val featureFailing = "$indentRootBulletPoint$indentListBulletPoint\\Q$failingBulletPoint$featureArrow\\E"
val isAfterFailing = "$indentRootBulletPoint$indentListBulletPoint$indentFailingBulletPoint$indentFeatureArrow\\Q$featureBulletPoint\\E$isDescr"
val isAfterSuccess = "$indentRootBulletPoint$indentListBulletPoint$indentSuccessfulBulletPoint$indentFeatureArrow\\Q$featureBulletPoint\\E$isDescr"
val afterExplanatory = "$indentRootBulletPoint$indentListBulletPoint$indentSuccessfulBulletPoint\\Q$explanatoryBulletPoint\\E"
nonNullableCases(
describePrefix,
@@ -83,7 +83,7 @@ abstract class IterableNoneAssertionsSpec(
message {
containsRegex(
"\\Q$rootBulletPoint\\E$containsNotDescr: $separator" +
"$indentBulletPoint\\Q$listBulletPoint\\E$anEntryWhich: $separator"+
"$indentRootBulletPoint\\Q$listBulletPoint\\E$anEntryWhich: $separator"+
"$afterExplanatory$toBeDescr: 4.0.*$separator" +
"$featureFailing$numberOfOccurrences: 3$separator"+
"$isAfterFailing: 0.*$separator"+
@@ -112,7 +112,7 @@ abstract class IterableNoneAssertionsSpec(
message {
containsRegex(
"\\Q$rootBulletPoint\\E$containsNotDescr: $separator" +
"$indentBulletPoint\\Q$listBulletPoint\\E$anEntryWhich: $separator"+
"$indentRootBulletPoint\\Q$listBulletPoint\\E$anEntryWhich: $separator"+
"$afterExplanatory$isDescr: null$separator" +
"$featureFailing$numberOfOccurrences: 2$separator"+
"$isAfterFailing: 0.*$separator"+
@@ -130,7 +130,7 @@ abstract class IterableNoneAssertionsSpec(
message {
containsRegex(
"\\Q$rootBulletPoint\\E$containsNotDescr: $separator" +
"$indentBulletPoint\\Q$listBulletPoint\\E$anEntryWhich: $separator"+
"$indentRootBulletPoint\\Q$listBulletPoint\\E$anEntryWhich: $separator"+
"$afterExplanatory$toBeDescr: 1.0.*$separator" +
"$featureFailing$numberOfOccurrences: 1$separator"+
"$isAfterFailing: 0.*$separator"+

View File

@@ -52,8 +52,8 @@ abstract class CharSequenceContainsAtLeastAssertionsSpec(
atLeast: Int, atMost: Int, a: Any, vararg aX: Any
) = containsAtLeastButAtMostIgnoringCase(this, atLeast, atMost, a, aX)
val indentBulletPoint = " ".repeat(rootBulletPoint.length)
val valueWithIndent = "$indentBulletPoint$listBulletPoint$value"
val indentRootBulletPoint = " ".repeat(rootBulletPoint.length)
val valueWithIndent = "$indentRootBulletPoint$listBulletPoint$value"
describeFun(containsAtLeast.name, containsAtLeastButAtMost.name) {

View File

@@ -37,8 +37,8 @@ abstract class CharSequenceContainsAtMostAssertionsSpec(
fun Expect<CharSequence>.containsAtMostIgnoringCaseFun(atLeast: Int, a: Any, vararg aX: Any) =
containsAtMostIgnoringCase(this, atLeast, a, aX)
val indentBulletPoint = " ".repeat(rootBulletPoint.length)
val valueWithIndent = "$indentBulletPoint$listBulletPoint$value"
val indentRootBulletPoint = " ".repeat(rootBulletPoint.length)
val valueWithIndent = "$indentRootBulletPoint$listBulletPoint$value"
describeFun(containsAtMost.name, containsAtMostIgnoringCase.name) {

View File

@@ -31,8 +31,8 @@ abstract class CharSequenceContainsContainsNotAssertionsSpec(
fun Expect<CharSequence>.containsNotFun(t: String, vararg tX: String) = containsNot.invoke(this, t, tX)
val indentBulletPoint = " ".repeat(rootBulletPoint.length)
val valueWithIndent = "$indentBulletPoint$listBulletPoint$value"
val indentRootBulletPoint = " ".repeat(rootBulletPoint.length)
val valueWithIndent = "$indentRootBulletPoint$listBulletPoint$value"
val containsNotDescr = CONTAINS_NOT.getDefault()
describeFun(contains.name, containsNot.name) {

View File

@@ -38,8 +38,8 @@ abstract class CharSequenceContainsExactlyAssertionsSpec(
containsExactlyIgnoringCase(this, atLeast, a, aX)
val exactly = EXACTLY.getDefault()
val indentBulletPoint = " ".repeat(rootBulletPoint.length)
val valueWithIndent = "$indentBulletPoint$listBulletPoint$value"
val indentRootBulletPoint = " ".repeat(rootBulletPoint.length)
val valueWithIndent = "$indentRootBulletPoint$listBulletPoint$value"
describeFun(containsExactly.name, containsExactlyIgnoringCase.name) {

View File

@@ -40,8 +40,8 @@ abstract class CharSequenceContainsNotAssertionsSpec(
val containsNotIgnoringCaseDescr =
String.format(DescriptionCharSequenceAssertion.IGNORING_CASE.getDefault(), containsNotDescr)
val indentBulletPoint = " ".repeat(rootBulletPoint.length)
val valueWithIndent = "$indentBulletPoint$listBulletPoint$value"
val indentRootBulletPoint = " ".repeat(rootBulletPoint.length)
val valueWithIndent = "$indentRootBulletPoint$listBulletPoint$value"
describeFun(containsNot.name, containsNotIgnoringCase.name) {

View File

@@ -37,8 +37,8 @@ abstract class CharSequenceContainsNotOrAtMostAssertionsSpec(
fun Expect<CharSequence>.containsNotOrAtMostIgnoringCaseFun(atLeast: Int, a: Any, vararg aX: Any) =
containsNotOrAtMostIgnoringCase(this, atLeast, a, aX)
val indentBulletPoint = " ".repeat(rootBulletPoint.length)
val valueWithIndent = "$indentBulletPoint$listBulletPoint$value"
val indentRootBulletPoint = " ".repeat(rootBulletPoint.length)
val valueWithIndent = "$indentRootBulletPoint$listBulletPoint$value"
describeFun(containsNotOrAtMost.name, containsNotOrAtMostIgnoringCase.name) {

View File

@@ -61,8 +61,8 @@ abstract class CharSequenceContainsRegexAssertionsSpec(
fun Expect<CharSequence>.containsAtMostIgnoringCaseFun(atLeast: Int, a: String, vararg aX: String) =
containsAtMostIgnoringCase(this, atLeast, a, aX)
val indentBulletPoint = " ".repeat(rootBulletPoint.length)
val regexWithIndent = "$indentBulletPoint$listBulletPoint$stringMatchingRegex"
val indentRootBulletPoint = " ".repeat(rootBulletPoint.length)
val regexWithIndent = "$indentRootBulletPoint$listBulletPoint$stringMatchingRegex"
describeFun(containsRegex) {
context("throws an ${IllegalArgumentException::class.simpleName}") {

View File

@@ -37,12 +37,12 @@ abstract class IterableAllAssertionsSpec(
val allDescr = DescriptionIterableAssertion.ALL.getDefault()
val hasElement = DescriptionIterableAssertion.HAS_ELEMENT.getDefault()
val indentBulletPoint = " ".repeat(rootBulletPoint.length)
val indentRootBulletPoint = " ".repeat(rootBulletPoint.length)
val indentFeatureArrow = " ".repeat(featureArrow.length)
val indentListBulletPoint = " ".repeat(listBulletPoint.length)
val explanatoryPointWithIndent = "$indentBulletPoint$indentListBulletPoint$explanatoryBulletPoint"
val explanatoryPointWithIndent = "$indentRootBulletPoint$indentListBulletPoint$explanatoryBulletPoint"
fun index(index: Int) = listBulletPoint + String.format(DescriptionIterableAssertion.INDEX.getDefault(), index)
@@ -59,7 +59,7 @@ abstract class IterableAllAssertionsSpec(
}.toThrow<AssertionError> {
messageContains(
"$rootBulletPoint$featureArrow$hasElement: false$separator" +
"$indentBulletPoint$indentFeatureArrow$featureBulletPoint$isDescr: true"
"$indentRootBulletPoint$indentFeatureArrow$featureBulletPoint$isDescr: true"
)
}
}

View File

@@ -50,14 +50,14 @@ abstract class IterableContainsInAnyOrderOnlyEntriesAssertionsSpec(
vararg tX: (Expect<Double>.() -> Unit)?
) = containsInAnyOrderOnlyNullableEntries(this, t, tX)
val indentBulletPoint = " ".repeat(rootBulletPoint.length)
val indentRootBulletPoint = " ".repeat(rootBulletPoint.length)
val indentSuccessfulBulletPoint = " ".repeat(successfulBulletPoint.length)
val indentFailingBulletPoint = " ".repeat(failingBulletPoint.length)
val indentListBulletPoint = " ".repeat(listBulletPoint.length)
//@formatter:off
val anEntryAfterSuccess = "$anElementWhich: $separator$indentBulletPoint$indentSuccessfulBulletPoint$indentListBulletPoint$explanatoryBulletPoint"
val anEntryAfterFailing = "$anElementWhich: $separator$indentBulletPoint$indentFailingBulletPoint$indentListBulletPoint$explanatoryBulletPoint"
val anEntryAfterSuccess = "$anElementWhich: $separator$indentRootBulletPoint$indentSuccessfulBulletPoint$indentListBulletPoint$explanatoryBulletPoint"
val anEntryAfterFailing = "$anElementWhich: $separator$indentRootBulletPoint$indentFailingBulletPoint$indentListBulletPoint$explanatoryBulletPoint"
//@formatter:on
nonNullableCases(

View File

@@ -53,7 +53,7 @@ abstract class IterableContainsInOrderOnlyEntriesAssertionsSpec(
vararg tX: (Expect<Double>.() -> Unit)?
) = containsInOrderOnlyNullableEntries(this, t, tX)
val indentBulletPoint = " ".repeat(rootBulletPoint.length)
val indentRootBulletPoint = " ".repeat(rootBulletPoint.length)
val indentSuccessfulBulletPoint = " ".repeat(successfulBulletPoint.length)
val indentFailingBulletPoint = " ".repeat(failingBulletPoint.length)
val indentFeatureArrow = " ".repeat(featureArrow.length)
@@ -62,7 +62,7 @@ abstract class IterableContainsInOrderOnlyEntriesAssertionsSpec(
fun Expect<String>.elementSuccess(index: Int, actual: Any, expected: String): Expect<String> {
return this.contains.exactly(1).regex(
"\\Q$successfulBulletPoint$featureArrow${elementWithIndex(index)}: $actual\\E.*$separator" +
"$indentBulletPoint$indentSuccessfulBulletPoint$indentFeatureArrow$featureBulletPoint$expected"
"$indentRootBulletPoint$indentSuccessfulBulletPoint$indentFeatureArrow$featureBulletPoint$expected"
)
}
@@ -74,7 +74,7 @@ abstract class IterableContainsInOrderOnlyEntriesAssertionsSpec(
): Expect<String> {
return this.contains.exactly(1).regex(
"\\Q$failingBulletPoint$featureArrow${elementWithIndex(index)}: $actual\\E.*$separator" +
"$indentBulletPoint$indentFailingBulletPoint$indentFeatureArrow${if (explaining) "$indentFeatureBulletPoint$explanatoryBulletPoint" else featureBulletPoint}$expected"
"$indentRootBulletPoint$indentFailingBulletPoint$indentFeatureArrow${if (explaining) "$indentFeatureBulletPoint$explanatoryBulletPoint" else featureBulletPoint}$expected"
)
}

View File

@@ -61,7 +61,7 @@ abstract class IterableContainsInOrderOnlyGroupedEntriesAssertionsSpec(
vararg tX: Group<(Expect<Double>.() -> Unit)?>
) = containsInOrderOnlyGroupedEntries(this, t1, t2, tX)
val indentBulletPoint = " ".repeat(rootBulletPoint.length)
val indentRootBulletPoint = " ".repeat(rootBulletPoint.length)
val indentSuccessfulBulletPoint = " ".repeat(successfulBulletPoint.length)
val indentFailingBulletPoint = " ".repeat(failingBulletPoint.length)
val indentListBulletPoint = " ".repeat(listBulletPoint.length)
@@ -69,17 +69,17 @@ abstract class IterableContainsInOrderOnlyGroupedEntriesAssertionsSpec(
val indentFeatureBulletPoint = " ".repeat(featureBulletPoint.length)
val indentWarningBulletPoint = " ".repeat(warningBulletPoint.length)
fun element(prefix: String, bulletPoint: String, indentBulletPoint: String, expected: Array<out String>) =
fun element(prefix: String, bulletPoint: String, indentRootBulletPoint: String, expected: Array<out String>) =
expected.joinToString(".*$separator") {
"$prefix\\Q$bulletPoint$anElementWhich: \\E$separator" +
"$prefix$indentBulletPoint$indentListBulletPoint$explanatoryBulletPoint$it"
"$prefix$indentRootBulletPoint$indentListBulletPoint$explanatoryBulletPoint$it"
}
fun size(prefix: String, bulletPoint: String, actual: Int, expected: Int) =
"$prefix\\Q$bulletPoint\\E${featureArrow}${DescriptionCollectionAssertion.SIZE.getDefault()}: $actual[^:]+: $expected"
val afterFail = "$indentBulletPoint$indentFailingBulletPoint$indentFeatureArrow$indentFeatureBulletPoint"
val afterFail = "$indentRootBulletPoint$indentFailingBulletPoint$indentFeatureArrow$indentFeatureBulletPoint"
fun failAfterFail(vararg expected: String) =
element(afterFail, failingBulletPoint, indentFailingBulletPoint, expected)
@@ -100,7 +100,7 @@ abstract class IterableContainsInOrderOnlyGroupedEntriesAssertionsSpec(
warning(additionalElements, entryWithValue) { "${elementWithIndex(it.first)}: ${it.second}" }
val afterSuccess = "$indentBulletPoint$indentSuccessfulBulletPoint$indentFeatureArrow$indentFeatureBulletPoint"
val afterSuccess = "$indentRootBulletPoint$indentSuccessfulBulletPoint$indentFeatureArrow$indentFeatureBulletPoint"
fun successAfterSuccess(vararg expected: String) =
element(afterSuccess, successfulBulletPoint, indentSuccessfulBulletPoint, expected)
@@ -110,7 +110,7 @@ abstract class IterableContainsInOrderOnlyGroupedEntriesAssertionsSpec(
fun Expect<String>.indexSuccess(index: Int, actual: Any, expected: String): Expect<String> {
return this.contains.exactly(1).regex(
"\\Q$successfulBulletPoint$featureArrow${index(index)}: $actual\\E.*$separator" +
"$indentBulletPoint$indentSuccessfulBulletPoint$indentFeatureArrow$featureBulletPoint$expected"
"$indentRootBulletPoint$indentSuccessfulBulletPoint$indentFeatureArrow$featureBulletPoint$expected"
)
}
@@ -122,7 +122,7 @@ abstract class IterableContainsInOrderOnlyGroupedEntriesAssertionsSpec(
): Expect<String> {
return this.contains.exactly(1).regex(
"\\Q$successfulBulletPoint$featureArrow${index(fromIndex, toIndex)}: $actual\\E.*$separator" +
"$indentBulletPoint$indentFailingBulletPoint$indentFeatureArrow$featureBulletPoint$containsInAnyOrderOnly: $separator" +
"$indentRootBulletPoint$indentFailingBulletPoint$indentFeatureArrow$featureBulletPoint$containsInAnyOrderOnly: $separator" +
expected.joinToString(".*$separator")
)
@@ -131,7 +131,7 @@ abstract class IterableContainsInOrderOnlyGroupedEntriesAssertionsSpec(
fun Expect<String>.indexFail(index: Int, actual: Any, expected: String): Expect<String> {
return this.contains.exactly(1).regex(
"\\Q$failingBulletPoint$featureArrow${index(index)}: $actual\\E.*$separator" +
"$indentBulletPoint$indentFailingBulletPoint$indentFeatureArrow$featureBulletPoint$expected"
"$indentRootBulletPoint$indentFailingBulletPoint$indentFeatureArrow$featureBulletPoint$expected"
)
}
@@ -151,7 +151,7 @@ abstract class IterableContainsInOrderOnlyGroupedEntriesAssertionsSpec(
): Expect<String> {
return this.contains.exactly(1).regex(
"\\Q$failingBulletPoint$featureArrow${index(fromIndex, toIndex)}: $actual\\E.*$separator" +
"$indentBulletPoint$indentFailingBulletPoint$indentFeatureArrow$featureBulletPoint$containsInAnyOrderOnly: $separator" +
"$indentRootBulletPoint$indentFailingBulletPoint$indentFeatureArrow$featureBulletPoint$containsInAnyOrderOnly: $separator" +
expected.joinToString(".*$separator")
)
}
@@ -280,7 +280,7 @@ abstract class IterableContainsInOrderOnlyGroupedEntriesAssertionsSpec(
successSizeAfterFail(3),
mismatchesAfterFail(4.0)
)
containsRegex(size(indentBulletPoint, successfulBulletPoint, 5, 5))
containsRegex(size(indentRootBulletPoint, successfulBulletPoint, 5, 5))
}
}
}
@@ -308,7 +308,7 @@ abstract class IterableContainsInOrderOnlyGroupedEntriesAssertionsSpec(
successAfterSuccess("$toBeDescr: 4.0"),
successSizeAfterFail(3)
)
containsRegex(size(indentBulletPoint, successfulBulletPoint, 5, 5))
containsRegex(size(indentRootBulletPoint, successfulBulletPoint, 5, 5))
}
}
}
@@ -328,7 +328,7 @@ abstract class IterableContainsInOrderOnlyGroupedEntriesAssertionsSpec(
successAfterSuccess("$toBeDescr: 4.0", "$toBeDescr: 2.0", "$toBeDescr: 3.0"),
successSizeAfterSuccess(3)
)
containsRegex(size(indentBulletPoint, failingBulletPoint, 5, 4))
containsRegex(size(indentRootBulletPoint, failingBulletPoint, 5, 4))
containsRegex(additional(4 to 4.0))
}
}
@@ -346,7 +346,7 @@ abstract class IterableContainsInOrderOnlyGroupedEntriesAssertionsSpec(
contains.exactly(1).value("$rootBulletPoint$containsInOrderOnlyGrouped:")
indexSuccess(0, 1.0, "$toBeDescr: 1.0")
indexFail(1, 2.0, "$toBeDescr: 4.0")
containsRegex(size(indentBulletPoint, failingBulletPoint, 5, 2))
containsRegex(size(indentRootBulletPoint, failingBulletPoint, 5, 2))
containsRegex(additional(2 to 3.0, 3 to 4.0, 4 to 4.0))
}
}
@@ -368,7 +368,7 @@ abstract class IterableContainsInOrderOnlyGroupedEntriesAssertionsSpec(
mismatchesAfterFail(2.0)
)
indexFail(2, 3.0, "$toBeDescr: 5.0")
containsRegex(size(indentBulletPoint, failingBulletPoint, 5, 3))
containsRegex(size(indentRootBulletPoint, failingBulletPoint, 5, 3))
containsRegex(additional(3 to 4.0, 4 to 4.0))
}
}
@@ -398,7 +398,7 @@ abstract class IterableContainsInOrderOnlyGroupedEntriesAssertionsSpec(
successAfterFail("$toBeDescr: 4.0"),
failSizeAfterFail(1, 2)
)
containsRegex(size(indentBulletPoint, failingBulletPoint, 5, 6))
containsRegex(size(indentRootBulletPoint, failingBulletPoint, 5, 6))
}
}
}

View File

@@ -41,7 +41,7 @@ abstract class IterableContainsInOrderOnlyGroupedValuesAssertionsSpec(
vararg tX: Group<Double?>
) = containsInOrderOnlyGroupedNullableValues(this, t1, t2, tX)
val indentBulletPoint = " ".repeat(rootBulletPoint.length)
val indentRootBulletPoint = " ".repeat(rootBulletPoint.length)
val indentSuccessfulBulletPoint = " ".repeat(successfulBulletPoint.length)
val indentFailingBulletPoint = " ".repeat(failingBulletPoint.length)
val indentFeatureArrow = " ".repeat(featureArrow.length)
@@ -49,8 +49,8 @@ abstract class IterableContainsInOrderOnlyGroupedValuesAssertionsSpec(
val indentWarningBulletPoint = " ".repeat(warningBulletPoint.length)
val toBeWithFeature = "$indentFeatureArrow$featureBulletPoint$toBeDescr"
val toBeAfterSuccess = "$indentBulletPoint$indentSuccessfulBulletPoint$toBeWithFeature"
val toBeAfterFailing = "$indentBulletPoint$indentFailingBulletPoint$toBeWithFeature"
val toBeAfterSuccess = "$indentRootBulletPoint$indentSuccessfulBulletPoint$toBeWithFeature"
val toBeAfterFailing = "$indentRootBulletPoint$indentFailingBulletPoint$toBeWithFeature"
fun element(prefix: String, bulletPoint: String, expected: Array<out Double?>) =
@@ -59,7 +59,7 @@ abstract class IterableContainsInOrderOnlyGroupedValuesAssertionsSpec(
fun size(prefix: String, bulletPoint: String, actual: Int, expected: Int) =
"$prefix\\Q$bulletPoint\\E${featureArrow}${DescriptionCollectionAssertion.SIZE.getDefault()}: $actual[^:]+: $expected"
val afterFail = "$indentBulletPoint$indentFailingBulletPoint$indentFeatureArrow$indentFeatureBulletPoint"
val afterFail = "$indentRootBulletPoint$indentFailingBulletPoint$indentFeatureArrow$indentFeatureBulletPoint"
fun failAfterFail(vararg expected: Double?) = element(afterFail, failingBulletPoint, expected)
fun successAfterFail(vararg expected: Double?) = element(afterFail, successfulBulletPoint, expected)
@@ -78,7 +78,7 @@ abstract class IterableContainsInOrderOnlyGroupedValuesAssertionsSpec(
warning(additionalElements, entryWithValue) { "${elementWithIndex(it.first)}: ${it.second}" }
val afterSuccess = "$indentBulletPoint$indentSuccessfulBulletPoint$indentFeatureArrow$indentFeatureBulletPoint"
val afterSuccess = "$indentRootBulletPoint$indentSuccessfulBulletPoint$indentFeatureArrow$indentFeatureBulletPoint"
fun successAfterSuccess(vararg expected: Double?) = element(afterSuccess, successfulBulletPoint, expected)
fun successSizeAfterSuccess(size: Int) = size(afterSuccess, successfulBulletPoint, size, size)
@@ -99,7 +99,7 @@ abstract class IterableContainsInOrderOnlyGroupedValuesAssertionsSpec(
): Expect<String> {
return this.contains.exactly(1).regex(
"\\Q$successfulBulletPoint$featureArrow${index(fromIndex, toIndex)}: $actual\\E.*$separator" +
"$indentBulletPoint$indentFailingBulletPoint$indentFeatureArrow$featureBulletPoint$containsInAnyOrderOnly: $separator" +
"$indentRootBulletPoint$indentFailingBulletPoint$indentFeatureArrow$featureBulletPoint$containsInAnyOrderOnly: $separator" +
expected.joinToString(".*$separator")
)
@@ -120,7 +120,7 @@ abstract class IterableContainsInOrderOnlyGroupedValuesAssertionsSpec(
): Expect<String> {
return this.contains.exactly(1).regex(
"\\Q$failingBulletPoint$featureArrow${index(fromIndex, toIndex)}: $actual\\E.*$separator" +
"$indentBulletPoint$indentFailingBulletPoint$indentFeatureArrow$featureBulletPoint$containsInAnyOrderOnly: $separator" +
"$indentRootBulletPoint$indentFailingBulletPoint$indentFeatureArrow$featureBulletPoint$containsInAnyOrderOnly: $separator" +
expected.joinToString(".*$separator")
)
}
@@ -222,7 +222,7 @@ abstract class IterableContainsInOrderOnlyGroupedValuesAssertionsSpec(
successSizeAfterFail(3),
mismatchesAfterFail(4.0)
)
containsRegex(size(indentBulletPoint, successfulBulletPoint, 5, 5))
containsRegex(size(indentRootBulletPoint, successfulBulletPoint, 5, 5))
}
}
}
@@ -239,7 +239,7 @@ abstract class IterableContainsInOrderOnlyGroupedValuesAssertionsSpec(
successAfterSuccess(4.0, 2.0, 3.0),
successSizeAfterSuccess(3)
)
containsRegex(size(indentBulletPoint, failingBulletPoint, 5, 4))
containsRegex(size(indentRootBulletPoint, failingBulletPoint, 5, 4))
containsRegex(additional(4 to 4.0))
}
}
@@ -253,7 +253,7 @@ abstract class IterableContainsInOrderOnlyGroupedValuesAssertionsSpec(
contains.exactly(1).value("$rootBulletPoint$containsInOrderOnlyGrouped:")
indexSuccess(0, 1.0)
indexFail(1, 2.0, 4.0)
containsRegex(size(indentBulletPoint, failingBulletPoint, 5, 2))
containsRegex(size(indentRootBulletPoint, failingBulletPoint, 5, 2))
containsRegex(additional(2 to 3.0, 3 to 4.0, 4 to 4.0))
}
}
@@ -272,7 +272,7 @@ abstract class IterableContainsInOrderOnlyGroupedValuesAssertionsSpec(
mismatchesAfterFail(2.0)
)
indexFail(2, 3.0, 5.0)
containsRegex(size(indentBulletPoint, failingBulletPoint, 5, 3))
containsRegex(size(indentRootBulletPoint, failingBulletPoint, 5, 3))
containsRegex(additional(3 to 4.0, 4 to 4.0))
}
}
@@ -294,7 +294,7 @@ abstract class IterableContainsInOrderOnlyGroupedValuesAssertionsSpec(
successAfterFail(4.0),
failSizeAfterFail(1, 2)
)
containsRegex(size(indentBulletPoint, failingBulletPoint, 5, 6))
containsRegex(size(indentRootBulletPoint, failingBulletPoint, 5, 6))
}
}
}
@@ -347,7 +347,7 @@ abstract class IterableContainsInOrderOnlyGroupedValuesAssertionsSpec(
failAfterFail(1.0),
successSizeAfterFail(2)
)
containsRegex(size(indentBulletPoint, successfulBulletPoint, 4, 4))
containsRegex(size(indentRootBulletPoint, successfulBulletPoint, 4, 4))
}
}
}

View File

@@ -32,15 +32,15 @@ abstract class IterableContainsInOrderOnlyValuesAssertionsSpec(
fun Expect<Iterable<Double?>>.containsInOrderOnlyNullableValuesFun(t: Double?, vararg tX: Double?) =
containsInOrderOnlyNullableValues(this, t, tX)
val indentBulletPoint = " ".repeat(rootBulletPoint.length)
val indentRootBulletPoint = " ".repeat(rootBulletPoint.length)
val indentSuccessfulBulletPoint = " ".repeat(successfulBulletPoint.length)
val indentFailingBulletPoint = " ".repeat(failingBulletPoint.length)
val indentFeatureArrow = " ".repeat(featureArrow.length)
val indentFeatureBulletPoint = " ".repeat(featureBulletPoint.length)
val toBeWithFeature = "$indentFeatureArrow$featureBulletPoint$toBeDescr"
val toBeAfterSuccess = "$indentBulletPoint$indentSuccessfulBulletPoint$toBeWithFeature"
val toBeAfterFailing = "$indentBulletPoint$indentFailingBulletPoint$toBeWithFeature"
val toBeAfterSuccess = "$indentRootBulletPoint$indentSuccessfulBulletPoint$toBeWithFeature"
val toBeAfterFailing = "$indentRootBulletPoint$indentFailingBulletPoint$toBeWithFeature"
fun Expect<String>.elementSuccess(index: Int, expected: String): Expect<String> {
return this.contains.exactly(1).regex(
@@ -61,7 +61,7 @@ abstract class IterableContainsInOrderOnlyValuesAssertionsSpec(
fun Expect<String>.elementNonExisting(index: Int, expected: Double): Expect<String> {
return this.contains.exactly(1).regex(
"\\Q$failingBulletPoint$featureArrow${elementWithIndex(index)}: $sizeExceeded\\E.*$separator" +
"$indentBulletPoint$indentFailingBulletPoint$indentFeatureArrow$indentFeatureBulletPoint$explanatoryBulletPoint$toBeDescr: $expected"
"$indentRootBulletPoint$indentFailingBulletPoint$indentFeatureArrow$indentFeatureBulletPoint$explanatoryBulletPoint$toBeDescr: $expected"
)
}

View File

@@ -54,18 +54,18 @@ abstract class IterableContainsNotEntriesAssertionsSpec(
val containsNotDescr = DescriptionIterableAssertion.CONTAINS_NOT.getDefault()
val hasElement = DescriptionIterableAssertion.HAS_ELEMENT.getDefault()
val indentBulletPoint = " ".repeat(rootBulletPoint.length)
val indentRootBulletPoint = " ".repeat(rootBulletPoint.length)
val indentSuccessfulBulletPoint = " ".repeat(successfulBulletPoint.length)
val indentFailingBulletPoint = " ".repeat(failingBulletPoint.length)
val indentListBulletPoint = " ".repeat(listBulletPoint.length)
val indentFeatureArrow = " ".repeat(featureArrow.length)
//@formatter:off
val featureSuccess = "$indentBulletPoint$indentListBulletPoint\\Q$successfulBulletPoint$featureArrow\\E"
val featureFailing = "$indentBulletPoint$indentListBulletPoint\\Q$failingBulletPoint$featureArrow\\E"
val isAfterFailing = "$indentBulletPoint$indentListBulletPoint$indentFailingBulletPoint$indentFeatureArrow\\Q$featureBulletPoint\\E$isDescr"
val isAfterSuccess = "$indentBulletPoint$indentListBulletPoint$indentSuccessfulBulletPoint$indentFeatureArrow\\Q$featureBulletPoint\\E$isDescr"
val afterExplanatory = "$indentBulletPoint$indentListBulletPoint$indentSuccessfulBulletPoint\\Q$explanatoryBulletPoint\\E"
val featureSuccess = "$indentRootBulletPoint$indentListBulletPoint\\Q$successfulBulletPoint$featureArrow\\E"
val featureFailing = "$indentRootBulletPoint$indentListBulletPoint\\Q$failingBulletPoint$featureArrow\\E"
val isAfterFailing = "$indentRootBulletPoint$indentListBulletPoint$indentFailingBulletPoint$indentFeatureArrow\\Q$featureBulletPoint\\E$isDescr"
val isAfterSuccess = "$indentRootBulletPoint$indentListBulletPoint$indentSuccessfulBulletPoint$indentFeatureArrow\\Q$featureBulletPoint\\E$isDescr"
val afterExplanatory = "$indentRootBulletPoint$indentListBulletPoint$indentSuccessfulBulletPoint\\Q$explanatoryBulletPoint\\E"
//@formatter:on
nonNullableCases(
@@ -89,7 +89,7 @@ abstract class IterableContainsNotEntriesAssertionsSpec(
message {
containsRegex(
"\\Q$rootBulletPoint\\E$containsNotDescr: $separator" +
"$indentBulletPoint\\Q$listBulletPoint\\E$anElementWhich: $separator" +
"$indentRootBulletPoint\\Q$listBulletPoint\\E$anElementWhich: $separator" +
"$afterExplanatory$toBeDescr: 4.0.*$separator" +
"$featureSuccess$numberOfOccurrences: 0$separator" +
"$isAfterSuccess: 0.*$separator" +
@@ -123,7 +123,7 @@ abstract class IterableContainsNotEntriesAssertionsSpec(
message {
containsRegex(
"\\Q$rootBulletPoint\\E$containsNotDescr: $separator" +
"$indentBulletPoint\\Q$listBulletPoint\\E$anElementWhich: $separator" +
"$indentRootBulletPoint\\Q$listBulletPoint\\E$anElementWhich: $separator" +
"$afterExplanatory$isLessThanDescr: 4.0.*$separator" +
"$featureFailing$numberOfOccurrences: 3$separator" +
"$isAfterFailing: 0.*$separator" +
@@ -140,13 +140,13 @@ abstract class IterableContainsNotEntriesAssertionsSpec(
message {
containsRegex(
"\\Q$rootBulletPoint\\E$containsNotDescr: $separator" +
"$indentBulletPoint\\Q$listBulletPoint\\E$anElementWhich: $separator" +
"$indentRootBulletPoint\\Q$listBulletPoint\\E$anElementWhich: $separator" +
"$afterExplanatory$toBeDescr: 1.0.*$separator" +
"$featureFailing$numberOfOccurrences: 1$separator" +
"$isAfterFailing: 0.*$separator" +
"$featureSuccess$hasElement: true$separator" +
"$isAfterSuccess: true$separator" +
"$indentBulletPoint\\Q$listBulletPoint\\E$anElementWhich: $separator" +
"$indentRootBulletPoint\\Q$listBulletPoint\\E$anElementWhich: $separator" +
"$afterExplanatory$toBeDescr: 4.0.*$separator" +
"$featureFailing$numberOfOccurrences: 3$separator" +
"$isAfterFailing: 0.*$separator" +
@@ -186,7 +186,7 @@ abstract class IterableContainsNotEntriesAssertionsSpec(
message {
containsRegex(
"\\Q$rootBulletPoint\\E$containsNotDescr: $separator" +
"$indentBulletPoint\\Q$listBulletPoint\\E$anElementWhich: $separator" +
"$indentRootBulletPoint\\Q$listBulletPoint\\E$anElementWhich: $separator" +
"$afterExplanatory$isDescr: null$separator" +
"$featureFailing$numberOfOccurrences: 2$separator" +
"$isAfterFailing: 0.*$separator" +
@@ -204,7 +204,7 @@ abstract class IterableContainsNotEntriesAssertionsSpec(
message {
containsRegex(
"\\Q$rootBulletPoint\\E$containsNotDescr: $separator" +
"$indentBulletPoint\\Q$listBulletPoint\\E$anElementWhich: $separator" +
"$indentRootBulletPoint\\Q$listBulletPoint\\E$anElementWhich: $separator" +
"$afterExplanatory$isDescr: null$separator" +
"$featureFailing$numberOfOccurrences: 2$separator" +
"$isAfterFailing: 0.*$separator" +

View File

@@ -36,20 +36,20 @@ abstract class IterableContainsNotValuesAssertionsSpec(
val containsNotDescr = DescriptionIterableAssertion.CONTAINS_NOT.getDefault()
val hasElement = DescriptionIterableAssertion.HAS_ELEMENT.getDefault()
val indentBulletPoint = " ".repeat(rootBulletPoint.length)
val indentRootBulletPoint = " ".repeat(rootBulletPoint.length)
val indentSuccessfulBulletPoint = " ".repeat(successfulBulletPoint.length)
val indentFailingBulletPoint = " ".repeat(failingBulletPoint.length)
val indentListBulletPoint = " ".repeat(listBulletPoint.length)
val indentFeatureArrow = " ".repeat(featureArrow.length)
//@formatter:off
val featureSuccess = "$indentBulletPoint$indentListBulletPoint\\Q$successfulBulletPoint$featureArrow\\E"
val featureFailing = "$indentBulletPoint$indentListBulletPoint\\Q$failingBulletPoint$featureArrow\\E"
val isAfterFailing = "$indentBulletPoint$indentListBulletPoint$indentFailingBulletPoint$indentFeatureArrow\\Q$featureBulletPoint\\E$isDescr"
val isAfterSuccess = "$indentBulletPoint$indentListBulletPoint$indentSuccessfulBulletPoint$indentFeatureArrow\\Q$featureBulletPoint\\E$isDescr"
val featureSuccess = "$indentRootBulletPoint$indentListBulletPoint\\Q$successfulBulletPoint$featureArrow\\E"
val featureFailing = "$indentRootBulletPoint$indentListBulletPoint\\Q$failingBulletPoint$featureArrow\\E"
val isAfterFailing = "$indentRootBulletPoint$indentListBulletPoint$indentFailingBulletPoint$indentFeatureArrow\\Q$featureBulletPoint\\E$isDescr"
val isAfterSuccess = "$indentRootBulletPoint$indentListBulletPoint$indentSuccessfulBulletPoint$indentFeatureArrow\\Q$featureBulletPoint\\E$isDescr"
//@formatter:on
val anElementWhichIsWithIndent = "$indentBulletPoint$listBulletPoint$anElementWhichIs"
val anElementWhichIsWithIndent = "$indentRootBulletPoint$listBulletPoint$anElementWhichIs"
nonNullableCases(
describePrefix,

View File

@@ -38,18 +38,18 @@ abstract class IterableNoneAssertionsSpec(
val containsNotDescr = DescriptionIterableAssertion.CONTAINS_NOT.getDefault()
val hasElement = DescriptionIterableAssertion.HAS_ELEMENT.getDefault()
val indentBulletPoint = " ".repeat(rootBulletPoint.length)
val indentRootBulletPoint = " ".repeat(rootBulletPoint.length)
val indentSuccessfulBulletPoint = " ".repeat(successfulBulletPoint.length)
val indentFailingBulletPoint = " ".repeat(failingBulletPoint.length)
val indentListBulletPoint = " ".repeat(listBulletPoint.length)
val indentFeatureArrow = " ".repeat(featureArrow.length)
//@formatter:off
val featureSuccess = "$indentBulletPoint$indentListBulletPoint\\Q$successfulBulletPoint$featureArrow\\E"
val featureFailing = "$indentBulletPoint$indentListBulletPoint\\Q$failingBulletPoint$featureArrow\\E"
val isAfterFailing = "$indentBulletPoint$indentListBulletPoint$indentFailingBulletPoint$indentFeatureArrow\\Q$featureBulletPoint\\E$isDescr"
val isAfterSuccess = "$indentBulletPoint$indentListBulletPoint$indentSuccessfulBulletPoint$indentFeatureArrow\\Q$featureBulletPoint\\E$isDescr"
val afterExplanatory = "$indentBulletPoint$indentListBulletPoint$indentSuccessfulBulletPoint\\Q$explanatoryBulletPoint\\E"
val featureSuccess = "$indentRootBulletPoint$indentListBulletPoint\\Q$successfulBulletPoint$featureArrow\\E"
val featureFailing = "$indentRootBulletPoint$indentListBulletPoint\\Q$failingBulletPoint$featureArrow\\E"
val isAfterFailing = "$indentRootBulletPoint$indentListBulletPoint$indentFailingBulletPoint$indentFeatureArrow\\Q$featureBulletPoint\\E$isDescr"
val isAfterSuccess = "$indentRootBulletPoint$indentListBulletPoint$indentSuccessfulBulletPoint$indentFeatureArrow\\Q$featureBulletPoint\\E$isDescr"
val afterExplanatory = "$indentRootBulletPoint$indentListBulletPoint$indentSuccessfulBulletPoint\\Q$explanatoryBulletPoint\\E"
//@formatter:on
nonNullableCases(
@@ -85,7 +85,7 @@ abstract class IterableNoneAssertionsSpec(
message {
containsRegex(
"\\Q$rootBulletPoint\\E$containsNotDescr: $separator" +
"$indentBulletPoint\\Q$listBulletPoint\\E$anElementWhich: $separator" +
"$indentRootBulletPoint\\Q$listBulletPoint\\E$anElementWhich: $separator" +
"$afterExplanatory$toBeDescr: 4.0.*$separator" +
"$featureFailing$numberOfOccurrences: 3$separator" +
"$isAfterFailing: 0.*$separator" +
@@ -115,7 +115,7 @@ abstract class IterableNoneAssertionsSpec(
message {
containsRegex(
"\\Q$rootBulletPoint\\E$containsNotDescr: $separator" +
"$indentBulletPoint\\Q$listBulletPoint\\E$anElementWhich: $separator" +
"$indentRootBulletPoint\\Q$listBulletPoint\\E$anElementWhich: $separator" +
"$afterExplanatory$isDescr: null$separator" +
"$featureFailing$numberOfOccurrences: 2$separator" +
"$isAfterFailing: 0.*$separator" +
@@ -133,7 +133,7 @@ abstract class IterableNoneAssertionsSpec(
message {
containsRegex(
"\\Q$rootBulletPoint\\E$containsNotDescr: $separator" +
"$indentBulletPoint\\Q$listBulletPoint\\E$anElementWhich: $separator" +
"$indentRootBulletPoint\\Q$listBulletPoint\\E$anElementWhich: $separator" +
"$afterExplanatory$toBeDescr: 1.0.*$separator" +
"$featureFailing$numberOfOccurrences: 1$separator" +
"$isAfterFailing: 0.*$separator" +

View File

@@ -91,7 +91,7 @@ abstract class MapContainsInOrderOnlyKeyValueAssertionsSpec(
val keyValueBulletPoint = if (explaining) explanatoryBulletPoint else featureBulletPoint
val indentKeyValueBulletPoint = " ".repeat(keyValueBulletPoint.length)
val indentToKeyValue =
"$indentBulletPoint$indent$indentFeatureArrow" + (if (explaining) indentFeatureBulletPoint else "")
"$indentRootBulletPoint$indent$indentFeatureArrow" + (if (explaining) indentFeatureBulletPoint else "")
return this.contains.exactly(1).regex(
"\\Q$successFailureBulletPoint$featureArrow${entry(index)}: $actual\\E.*$separator" +

View File

@@ -58,7 +58,7 @@ abstract class MapContainsInOrderOnlyKeyValuePairsAssertionsSpec(
val keyValueBulletPoint = if (explaining) explanatoryBulletPoint else featureBulletPoint
val indentKeyValueBulletPoint = " ".repeat(keyValueBulletPoint.length)
val indentToKeyValue =
"$indentBulletPoint$indent$indentFeatureArrow" + (if (explaining) indentFeatureBulletPoint else "")
"$indentRootBulletPoint$indent$indentFeatureArrow" + (if (explaining) indentFeatureBulletPoint else "")
return this.contains.exactly(1).regex(
"\\Q$successFailureBulletPoint$featureArrow${entry(index)}: $actual\\E.*$separator" +

View File

@@ -29,7 +29,7 @@ abstract class MapLikeContainsFormatSpecBase(
Companion.featureArrow = featureArrow
Companion.featureBulletPoint = featureBulletPoint
indentBulletPoint = " ".repeat(rootBulletPoint.length)
indentRootBulletPoint = " ".repeat(rootBulletPoint.length)
indentSuccessfulBulletPoint = " ".repeat(successfulBulletPoint.length)
indentFailingBulletPoint = " ".repeat(failingBulletPoint.length)
indentListBulletPoint = " ".repeat(listBulletPoint.length)
@@ -49,7 +49,7 @@ abstract class MapLikeContainsFormatSpecBase(
var explanatoryBulletPoint = ""
var featureArrow = ""
var featureBulletPoint = ""
var indentBulletPoint = " "
var indentRootBulletPoint = " "
var indentSuccessfulBulletPoint = ""
var indentFailingBulletPoint = ""
var indentListBulletPoint = ""
@@ -84,29 +84,29 @@ abstract class MapLikeContainsFormatSpecBase(
fun Expect<String>.entrySuccess(key: String, actual: Any?, expected: String): Expect<String> {
return this.contains.exactly(1).regex(
"$indentBulletPoint\\Q$successfulBulletPoint$featureArrow${entry(key)}: $actual\\E.*${separator}" +
"$indentBulletPoint$indentSuccessfulBulletPoint$indentFeatureArrow$featureBulletPoint$expected"
"$indentRootBulletPoint\\Q$successfulBulletPoint$featureArrow${entry(key)}: $actual\\E.*${separator}" +
"$indentRootBulletPoint$indentSuccessfulBulletPoint$indentFeatureArrow$featureBulletPoint$expected"
)
}
fun Expect<String>.entryFailing(key: String?, actual: Any?, expected: String): Expect<String> {
return this.contains.exactly(1).regex(
"\\Q$failingBulletPoint$featureArrow${entry(key)}: $actual\\E.*${separator}" +
"$indentBulletPoint$indentSuccessfulBulletPoint$indentFeatureArrow$featureBulletPoint$expected"
"$indentRootBulletPoint$indentSuccessfulBulletPoint$indentFeatureArrow$featureBulletPoint$expected"
)
}
fun Expect<String>.entryFailingExplaining(key: String?, actual: Any?, expected: String): Expect<String> {
return this.contains.exactly(1).regex(
"\\Q$failingBulletPoint$featureArrow${entry(key)}: $actual\\E.*${separator}" +
"$indentBulletPoint$indentSuccessfulBulletPoint$indentFeatureArrow$indentFeatureBulletPoint$explanatoryBulletPoint$expected"
"$indentRootBulletPoint$indentSuccessfulBulletPoint$indentFeatureArrow$indentFeatureBulletPoint$explanatoryBulletPoint$expected"
)
}
fun Expect<String>.entryNonExisting(key: String, expected: String): Expect<String> {
return this.contains.exactly(1).regex(
"\\Q$failingBulletPoint$featureArrow${entry(key)}: $keyDoesNotExist\\E.*${separator}" +
"$indentBulletPoint$indentSuccessfulBulletPoint$indentFeatureArrow$indentFeatureBulletPoint$explanatoryBulletPoint$expected"
"$indentRootBulletPoint$indentSuccessfulBulletPoint$indentFeatureArrow$indentFeatureBulletPoint$explanatoryBulletPoint$expected"
)
}