Skip to content

Commit

Permalink
adjust tests to new layout
Browse files Browse the repository at this point in the history
  • Loading branch information
robstoll committed Dec 27, 2024
1 parent 8b385b7 commit 8f0901f
Show file tree
Hide file tree
Showing 223 changed files with 2,423 additions and 2,046 deletions.
1 change: 1 addition & 0 deletions .github/workflows/quality-assurance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ jobs:
run: node .github/workflows/matrix.js

build-and-test:
name: b&t ${{ matrix.name }}
needs: generate-matrix
runs-on: ${{ matrix.os }}
strategy:
Expand Down
126 changes: 63 additions & 63 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -350,15 +350,15 @@ I expected subject : () -> kotlin.Nothing (readme.examples.ToThrowExample
🚩️ ▶ thrown exception when called : java.lang.IllegalArgumentException
🚫️ to be an instance of type : IllegalStateException (java.lang.IllegalStateException)
ℹ️ Properties of the unexpected IllegalArgumentException
» message : "name is empty"
» stacktrace :
• readme.examples.ToThrowExamples$ex-toThrow1$1.invoke(ToThrowExamples.kt:18)
• readme.examples.ToThrowExamples$ex-toThrow1$1.invoke(ToThrowExamples.kt:16)
• readme.examples.ToThrowExamples.ex-toThrow1(ToThrowExamples.kt:47)
• java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
• java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
• java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
• java.base/java.lang.reflect.Method.invoke(Method.java:566)
» message : "name is empty"
» stacktrace :
• readme.examples.ToThrowExamples$ex-toThrow1$1.invoke(ToThrowExamples.kt:18)
• readme.examples.ToThrowExamples$ex-toThrow1$1.invoke(ToThrowExamples.kt:16)
• readme.examples.ToThrowExamples.ex-toThrow1(ToThrowExamples.kt:47)
• java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
• java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
• java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
• java.base/java.lang.reflect.Method.invoke(Method.java:566)
```
</ex-toThrow1>

Expand Down Expand Up @@ -435,19 +435,19 @@ expect {
I expected subject : () -> kotlin.Nothing (readme.examples.ToThrowExamples$ex-notToThrow$1 <1234789>)
🚩️ ▶ invoke() : ❗❗ threw java.lang.IllegalArgumentException
ℹ️ Properties of the unexpected IllegalArgumentException
» message : "name is empty"
» stacktrace :
• readme.examples.ToThrowExamples$ex-notToThrow$1.invoke(ToThrowExamples.kt:42)
• readme.examples.ToThrowExamples$ex-notToThrow$1.invoke(ToThrowExamples.kt:40)
• readme.examples.ToThrowExamples.ex-notToThrow(ToThrowExamples.kt:43)
• java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
• java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
• java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
• java.base/java.lang.reflect.Method.invoke(Method.java:566)
» cause : java.lang.RuntimeException
» message : "a cause"
» stacktrace :
• readme.examples.ToThrowExamples$ex-notToThrow$1.invoke(ToThrowExamples.kt:42)
» message : "name is empty"
» stacktrace :
• readme.examples.ToThrowExamples$ex-notToThrow$1.invoke(ToThrowExamples.kt:42)
• readme.examples.ToThrowExamples$ex-notToThrow$1.invoke(ToThrowExamples.kt:40)
• readme.examples.ToThrowExamples.ex-notToThrow(ToThrowExamples.kt:43)
• java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
• java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
• java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
• java.base/java.lang.reflect.Method.invoke(Method.java:566)
» cause : java.lang.RuntimeException
» message : "a cause"
» stacktrace :
• readme.examples.ToThrowExamples$ex-notToThrow$1.invoke(ToThrowExamples.kt:42)
```
</ex-notToThrow>

Expand Down Expand Up @@ -1763,23 +1763,23 @@ expect(-10).notToBeNegative()
I expected subject : -10
🚩️ not to be : negative
ℹ️ Properties of the unexpected AssertionError
» message : """
Expecting actual:
-10
to be greater than or equal to:
0
"""
» stacktrace :
• readme.examples.ThirdPartyExamples$ex-third-party-2$notToBeNegative$1.invoke(ThirdPartyExamples.kt:39)
• readme.examples.ThirdPartyExamples$ex-third-party-2$notToBeNegative$1.invoke(ThirdPartyExamples.kt:37)
• readme.examples.ThirdPartyExamples.ex_third_party_2$notToBeNegative(ThirdPartyExamples.kt:37)
• readme.examples.ThirdPartyExamples.ex-third-party-2(ThirdPartyExamples.kt:49)
• java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
• java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
• java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
• java.base/java.lang.reflect.Method.invoke(Method.java:566)
» message : """
Expecting actual:
-10
to be greater than or equal to:
0
"""
» stacktrace :
• readme.examples.ThirdPartyExamples$ex-third-party-2$notToBeNegative$1.invoke(ThirdPartyExamples.kt:39)
• readme.examples.ThirdPartyExamples$ex-third-party-2$notToBeNegative$1.invoke(ThirdPartyExamples.kt:37)
• readme.examples.ThirdPartyExamples.ex_third_party_2$notToBeNegative(ThirdPartyExamples.kt:37)
• readme.examples.ThirdPartyExamples.ex-third-party-2(ThirdPartyExamples.kt:49)
• java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
• java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
• java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
• java.base/java.lang.reflect.Method.invoke(Method.java:566)
```
</ex-third-party-2>

Expand Down Expand Up @@ -2113,19 +2113,19 @@ I expected subject : () -> kotlin.Nothing (readme.examples.MostExamples$e
• value : "no no no"
» but no match was found
ℹ️ Properties of the unexpected IllegalArgumentException
» message : "no no no..."
» stacktrace :
• readme.examples.MostExamples$ex-add-info-3$1.invoke(MostExamples.kt:117)
• readme.examples.MostExamples$ex-add-info-3$1.invoke(MostExamples.kt:113)
• readme.examples.MostExamples.ex-add-info-3(MostExamples.kt:148)
• java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
• java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
• java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
• java.base/java.lang.reflect.Method.invoke(Method.java:566)
» cause : java.lang.UnsupportedOperationException
» message : "not supported"
» stacktrace :
• readme.examples.MostExamples$ex-add-info-3$1.invoke(MostExamples.kt:115)
» message : "no no no..."
» stacktrace :
• readme.examples.MostExamples$ex-add-info-3$1.invoke(MostExamples.kt:117)
• readme.examples.MostExamples$ex-add-info-3$1.invoke(MostExamples.kt:113)
• readme.examples.MostExamples.ex-add-info-3(MostExamples.kt:148)
• java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
• java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
• java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
• java.base/java.lang.reflect.Method.invoke(Method.java:566)
» cause : java.lang.UnsupportedOperationException
» message : "not supported"
» stacktrace :
• readme.examples.MostExamples$ex-add-info-3$1.invoke(MostExamples.kt:115)
```
</ex-add-info-3>

Expand Down Expand Up @@ -2311,17 +2311,17 @@ expect(MyDomainModel(alpha1 = 1204)).toComplyValidation()
I expected subject : MyDomainModel(alpha1=1204) (readme.examples.ThirdPartyExamples.MyDomainModel <1234789>)
🚩️ to comply : validation
ℹ️ Properties of the unexpected IllegalStateException
» message : "threshold value for alpha1 exceeded, expected <= 1000, was 1204"
» stacktrace :
• readme.examples.ThirdPartyExamples.validateMaxThreshold(ThirdPartyExamples.kt:76)
• readme.examples.ThirdPartyExamples$ex-third-party-10$toComplyValidation$1.invoke(ThirdPartyExamples.kt:84)
• readme.examples.ThirdPartyExamples$ex-third-party-10$toComplyValidation$1.invoke(ThirdPartyExamples.kt:82)
• readme.examples.ThirdPartyExamples.ex_third_party_10$toComplyValidation(ThirdPartyExamples.kt:82)
• readme.examples.ThirdPartyExamples.ex-third-party-10(ThirdPartyExamples.kt:88)
• java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
• java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
• java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
• java.base/java.lang.reflect.Method.invoke(Method.java:566)
» message : "threshold value for alpha1 exceeded, expected <= 1000, was 1204"
» stacktrace :
• readme.examples.ThirdPartyExamples.validateMaxThreshold(ThirdPartyExamples.kt:76)
• readme.examples.ThirdPartyExamples$ex-third-party-10$toComplyValidation$1.invoke(ThirdPartyExamples.kt:84)
• readme.examples.ThirdPartyExamples$ex-third-party-10$toComplyValidation$1.invoke(ThirdPartyExamples.kt:82)
• readme.examples.ThirdPartyExamples.ex_third_party_10$toComplyValidation(ThirdPartyExamples.kt:82)
• readme.examples.ThirdPartyExamples.ex-third-party-10(ThirdPartyExamples.kt:88)
• java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
• java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
• java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
• java.base/java.lang.reflect.Method.invoke(Method.java:566)
```
</ex-third-party-10>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import ch.tutteli.atrium.logic.utils.toVarArg
import ch.tutteli.kbox.glue
import kotlin.jvm.JvmName

//TODO 2.0.0 switch to disjoint search, no idea why I used non-disjoint back then
/**
* Finishes the specification of the sophisticated `to contain` expectation where the [expected] object shall be searched,
* using a non-disjoint search.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ fun <E, T : IterableLike> EntryPointStep<E, T, InOrderOnlyGroupedWithinSearchBeh
firstGroup: Group<E>,
secondGroup: Group<E>,
vararg otherExpectedGroups: Group<E>,
//TODO 2.0.0 consider to introduce an own Option class as showOnlyFailingIfMoreExpectedElementsThan is a bit misleading in the context of groups
//i.e. OnlyReportingOptions
report: InOrderOnlyReportingOptions.() -> Unit = {},
reportInGroup: InAnyOrderOnlyReportingOptions.() -> Unit = {}
): Expect<T> = _logicAppend {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,6 @@ class AnyExpectationsSpec : ch.tutteli.atrium.specs.integration.AnyExpectationsS
}

//regression for #298, should compile without the need for E : Any or List<E?>
@Suppress("unused")
@Suppress("unused", "UNUSED_VALUE")
fun <E> Expect<List<E>>.firstIs(value: E) = get(0) { toEqual(value) }
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ object ArrayAsListExpectationsSpec : ch.tutteli.atrium.specs.integration.ArrayAs
Expect<BooleanArray>::asList
) {

@Suppress("unused")
@Suppress("unused", "UNUSED_VARIABLE", "UNUSED_VALUE")
private fun ambiguityTest() {
var a1: Expect<Array<Int>> = notImplemented()
var a2: Expect<Array<out Int>> = notImplemented()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class CharSequenceExpectationsSpec : ch.tutteli.atrium.specs.integration.CharSeq
fun1<CharSequence, Regex>(Expect<CharSequence>::toMatch),
fun1<CharSequence, Regex>(Expect<CharSequence>::notToMatch)
) {
@Suppress("unused")
@Suppress("unused", "UNUSED_VALUE")
private fun ambiguityTest() {
val a1: Expect<String> = notImplemented()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class CharSequenceToContainNotToContainExpectationsSpec : Spek({
fun2<CharSequence, Any, Array<out Any>>(Expect<CharSequence>::notToContain)
}

@Suppress("unused")
@Suppress("unused", "UNUSED_VALUE")
private fun ambiguityTest() {
val a1: Expect<String> = notImplemented()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ abstract class CharSequenceToContainSpecBase {
protected val values = CharSequenceContains.CheckerStep<CharSequence, NoOpSearchBehaviour>::values.name
protected val elementsOf = CharSequenceContains.EntryPointStep<String, IgnoringCaseSearchBehaviour>::elementsOf.name

@Suppress("unused")
@Suppress("unused", "UNUSED_VALUE")
private fun ambiguityTest() {
val a1: Expect<String> = notImplemented()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ object CollectionExpectationsSpec : ch.tutteli.atrium.specs.integration.Collecti
property<Collection<Int>, Int>(Expect<Collection<Int>>::size),
fun1<Collection<Int>, Expect<Int>.() -> Unit>(Expect<Collection<Int>>::size)
) {
@Suppress("unused")
@Suppress("unused", "UNUSED_VARIABLE", "UNUSED_VALUE")
private fun ambiguityTest() {
var a1: Expect<List<Int>> = notImplemented()
var a1b: Expect<Set<Int?>> = notImplemented()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class ExtractSubjectSpec : ch.tutteli.atrium.specs.integration.ExtractSubjectSpe
extractSubjectDefaultFailureDescription = "❗❗ subject extraction not possible, previous expectation failed, cannot show sub-expectations"
) {

@Suppress("unused")
@Suppress("unused", "UNUSED_VALUE")
private fun ambiguityTest() {
val int: Expect<Int> = notImplemented()
val nullableInt: Expect<Int?> = notImplemented()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ class FeatureExpectationsBoundedReferenceAlternativeSpec : ch.tutteli.atrium.spe
val f5EmptyAssertionCreator: F = { feature({ f5(it::return5, "a", 1, true, 1.2, 'b') }) {} }
}

@Suppress("unused")
@Suppress("unused", "UNUSED_VALUE")
private fun ambiguityTest() {
val a1: Expect<Collection<Int>> = notImplemented()
val a1b: Expect<Collection<Int?>> = notImplemented()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ class FeatureExpectationsBoundedReferenceSpec : ch.tutteli.atrium.specs.integrat
val f5EmptyAssertionCreator: F = { feature({ f(it::return5, "a", 1, true, 1.2, 'b') }) {} }
}

@Suppress("unused")
@Suppress("unused", "UNUSED_VALUE")
private fun ambiguityTest() {
val a1: Expect<Collection<Int>> = notImplemented()
val a1b: Expect<Collection<Int?>> = notImplemented()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ class FeatureExpectationsClassReferenceSpec : ch.tutteli.atrium.specs.integratio
val f5EmptyAssertionCreator: F = { feature(TestData::return5, "a", 1, true, 1.2, 'b') {} }
}

@Suppress("unused")
@Suppress("unused", "UNUSED_VALUE")
private fun ambiguityTest() {
val a1: Expect<Collection<Int>> = notImplemented()
val a1b: Expect<Collection<Int?>> = notImplemented()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class WorstCase {
fun propAndFun(): Int = 1

fun overloaded(): Int = 1
fun overloaded(b: Boolean): Int = 1
fun overloaded(@Suppress("unused", "UNUSED_PARAMETER") b: Boolean): Int = 1
}

// we don't run any tests in here but check that the compiler does not report any ambiguities
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ object IterableExpectationsSpec : ch.tutteli.atrium.specs.integration.IterableEx
fun1<Iterable<Int>, Expect<Int>.() -> Unit>(Expect<Iterable<Int>>::last),
) {

@Suppress("unused")
@Suppress("unused", "UNUSED_VALUE")
private fun ambiguityTest() {
var a1: Expect<List<Double>> = notImplemented()
var a1b: Expect<Set<Double?>> = notImplemented()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class IterableNotToContainEntriesExpectationsSpec :
else expect.notToContain.entries(a, *aX)
}

@Suppress("unused")
@Suppress("unused", "UNUSED_VALUE")
private fun ambiguityTest() {
var list: Expect<List<Number>> = notImplemented()
var nList: Expect<Set<Number?>> = notImplemented()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ object IterableNotToHaveElementsOrAllExpectationsSpec : ch.tutteli.atrium.specs.
fun1(Expect<Iterable<Double?>>::notToHaveElementsOrAll).withNullableSuffix()
) {

@Suppress("unused")
@Suppress("unused", "UNUSED_VALUE")
private fun ambiguityTest() {
var list: Expect<List<Number>> = notImplemented()
var nList: Expect<Set<Number?>> = notImplemented()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class IterableNotToHaveElementsOrAnyExpectationsSpec : ch.tutteli.atrium.specs.i
fun1(Expect<Iterable<Double?>>::notToHaveElementsOrAny).withNullableSuffix()
) {

@Suppress("unused")
@Suppress("unused", "UNUSED_VALUE")
private fun ambiguityTest() {
var list: Expect<List<Number>> = notImplemented()
var nList: Expect<Set<Number?>> = notImplemented()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class IterableNotToHaveElementsOrNoneExpectationsSpec : ch.tutteli.atrium.specs.
fun1(Expect<Iterable<Double?>>::notToHaveElementsOrNone).withNullableSuffix()
) {

@Suppress("unused")
@Suppress("unused", "UNUSED_VALUE")
private fun ambiguityTest() {
var list: Expect<List<Number>> = notImplemented()
var nList: Expect<Set<Number?>> = notImplemented()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class IterableToContainInAnyOrderAtLeast1ElementsOfExpectationsSpec : Spek({
): Expect<Iterable<Double?>> = expect.toContainElementsOf(sequenceOf(a, *aX).asIterable())
}

@Suppress("unused")
@Suppress("unused", "UNUSED_VALUE")
private fun ambiguityTest() {
var list: Expect<List<Number>> = notImplemented()
var nList: Expect<Set<Number?>> = notImplemented()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class IterableToContainInAnyOrderAtLeast1EntriesExpectationsSpec : Spek({
else expect.toContain.inAnyOrder.atLeast(1).entries(a, *aX)
}

@Suppress("unused")
@Suppress("unused", "UNUSED_VALUE")
private fun ambiguityTest() {
var list: Expect<List<Number>> = notImplemented()
var nList: Expect<Set<Number?>> = notImplemented()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class IterableToContainInAnyOrderAtLeast1ValuesExpectationsSpec : Spek({
else expect.toContain.inAnyOrder.atLeast(1).values(a, *aX)
}

@Suppress("unused")
@Suppress("unused", "UNUSED_VALUE")
private fun ambiguityTest() {
var list: Expect<List<Number>> = notImplemented()
var nList: Expect<Set<Number?>> = notImplemented()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class IterableToContainInAnyOrderAtMostValuesExpectationsSpec :
"use $exactly($times) instead of $atMost($times); $atMost($times) defines implicitly $atLeast($times) as well"
}

@Suppress("unused")
@Suppress("unused", "UNUSED_VALUE")
private fun ambiguityTest() {
var list: Expect<List<Number>> = notImplemented()
var nList: Expect<Set<Number?>> = notImplemented()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class IterableToContainInAnyOrderExactlyValuesExpectationsSpec :
private fun getErrorMsgNotToContain(times: Int) = "use $notToContain instead of $exactly($times)"
}

@Suppress("unused")
@Suppress("unused", "UNUSED_VALUE")
private fun ambiguityTest() {
var list: Expect<List<Number>> = notImplemented()
var nList: Expect<Set<Number?>> = notImplemented()
Expand Down
Loading

0 comments on commit 8f0901f

Please sign in to comment.