diff --git a/.github/workflows/quality-assurance.yml b/.github/workflows/quality-assurance.yml index 6f8eebbe8d..e26c86bd60 100644 --- a/.github/workflows/quality-assurance.yml +++ b/.github/workflows/quality-assurance.yml @@ -3,105 +3,124 @@ name: Quality Assurance on: [ push, pull_request ] jobs: - generate-matrix: - runs-on: ubuntu-latest - outputs: - matrix: ${{ steps.set-matrix.outputs.matrix }} + test: + runs-on: windows-latest steps: - name: Checkout uses: actions/checkout@v4 - with: - fetch-depth: 1 - - - name: Generate matrix - id: set-matrix - run: node .github/workflows/matrix.js - - build-and-test: - needs: generate-matrix - runs-on: ${{ matrix.os }} - strategy: - matrix: ${{ fromJson(needs.generate-matrix.outputs.matrix) }} - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Set up JDK ${{ matrix.java_version }} - uses: actions/setup-java@v4 - with: - distribution: ${{ matrix.java_distribution }} - java-version: ${{ matrix.java_version }} - - - name: Setup Gradle - uses: gradle/actions/setup-gradle@v4 - - - name: Build using JDK ${{ matrix.java_version }} - run: ./gradlew build - - name: Upload build code coverage - uses: codecov/codecov-action@v5.1.2 - if: ${{ github.event_name == 'pull_request' || (github.event_name == 'push' && github.ref == 'refs/heads/main') }} - with: - token: ${{ secrets.CODECOV_TOKEN }} - flags: ${{ matrix.os == 'windows-latest' && 'current_windows' || 'current' }} - env_vars: JAVA_VERSION - - - name: Composite build atrium-samples-test - run: ./gradlew build - working-directory: misc/tools/atrium-samples-test - - dexer: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - fetch-depth: 1 - - - name: Cache Android jar - id: android-cache - uses: actions/cache@v4 - with: - path: android-jar-cache - key: ${{ runner.os }}-android-version-26 - - - name: Download Android SDK's android.jar (or use cached file) - if: steps.android-cache.outputs.cache-hit != 'true' - run: | - mkdir android-jar-cache - cd android-jar-cache - curl -o android.jar -L "https://github.com/Sable/android-platforms/blob/master/android-26/android.jar?raw=true" - echo "cdc1846376a14b0370cc63454a129606b4a52cc50ada75ef0d4cf956b1ad2daa android.jar" > android.sha256 - if ! sha256sum -c android.sha256; then - echo >&2 "wrong sha256 for android.jar, expected:" - cat >&2 android.sha256 - echo >&2 "actual:" - sha256sum android.jar - exit 1; - fi - - - name: Check Atrium's -jvm.jar can be dexed - run: ATRIUM_ANDROID_JAR="$PWD/android-jar-cache/android.jar" ./gradlew checkDexer - - forwardCompatibility: - env: - JAVA_VERSION: 17 - KOTLIN_VERSION: ${{ matrix.kotlin_version }} - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - kotlin_version: [ '1.5', '1.6', '1.7', '1.8', '1.9', '2.0' ] - steps: - - uses: actions/checkout@v4 - - name: Set up JDK 17 + - name: Set up JDK uses: actions/setup-java@v4 with: - distribution: 'adopt' - java-version: 17 + distribution: sapmachine + java-version: 11 - name: Setup Gradle uses: gradle/actions/setup-gradle@v4 - - name: Build using Kotlin ${{ matrix.kotlin_version }} - run: ./gradlew build + - name: Build using JDK + run: ./gradlew :atrium-api-infix:jvmTest +# +# generate-matrix: +# runs-on: ubuntu-latest +# outputs: +# matrix: ${{ steps.set-matrix.outputs.matrix }} +# steps: +# - name: Checkout +# uses: actions/checkout@v4 +# with: +# fetch-depth: 1 +# +# - name: Generate matrix +# id: set-matrix +# run: node .github/workflows/matrix.js +# +# build-and-test: +# name: b&t ${{ matrix.name }} +# needs: generate-matrix +# runs-on: ${{ matrix.os }} +# strategy: +# matrix: ${{ fromJson(needs.generate-matrix.outputs.matrix) }} +# steps: +# - name: Checkout +# uses: actions/checkout@v4 +# +# - name: Set up JDK ${{ matrix.java_version }} +# uses: actions/setup-java@v4 +# with: +# distribution: ${{ matrix.java_distribution }} +# java-version: ${{ matrix.java_version }} +# +# - name: Setup Gradle +# uses: gradle/actions/setup-gradle@v4 +# +# - name: Build using JDK ${{ matrix.java_version }} +# run: ./gradlew build +# +# - name: Upload build code coverage +# uses: codecov/codecov-action@v5.1.2 +# if: ${{ github.event_name == 'pull_request' || (github.event_name == 'push' && github.ref == 'refs/heads/main') }} +# with: +# token: ${{ secrets.CODECOV_TOKEN }} +# flags: ${{ matrix.os == 'windows-latest' && 'current_windows' || 'current' }} +# env_vars: JAVA_VERSION +# +# - name: Composite build atrium-samples-test +# run: ./gradlew build +# working-directory: misc/tools/atrium-samples-test +# +# dexer: +# runs-on: ubuntu-latest +# steps: +# - name: Checkout +# uses: actions/checkout@v4 +# with: +# fetch-depth: 1 +# +# - name: Cache Android jar +# id: android-cache +# uses: actions/cache@v4 +# with: +# path: android-jar-cache +# key: ${{ runner.os }}-android-version-26 +# +# - name: Download Android SDK's android.jar (or use cached file) +# if: steps.android-cache.outputs.cache-hit != 'true' +# run: | +# mkdir android-jar-cache +# cd android-jar-cache +# curl -o android.jar -L "https://github.com/Sable/android-platforms/blob/master/android-26/android.jar?raw=true" +# echo "cdc1846376a14b0370cc63454a129606b4a52cc50ada75ef0d4cf956b1ad2daa android.jar" > android.sha256 +# if ! sha256sum -c android.sha256; then +# echo >&2 "wrong sha256 for android.jar, expected:" +# cat >&2 android.sha256 +# echo >&2 "actual:" +# sha256sum android.jar +# exit 1; +# fi +# +# - name: Check Atrium's -jvm.jar can be dexed +# run: ATRIUM_ANDROID_JAR="$PWD/android-jar-cache/android.jar" ./gradlew checkDexer +# +# forwardCompatibility: +# env: +# JAVA_VERSION: 17 +# KOTLIN_VERSION: ${{ matrix.kotlin_version }} +# runs-on: ubuntu-latest +# strategy: +# fail-fast: false +# matrix: +# kotlin_version: [ '1.5', '1.6', '1.7', '1.8', '1.9', '2.0' ] +# steps: +# - uses: actions/checkout@v4 +# - name: Set up JDK 17 +# uses: actions/setup-java@v4 +# with: +# distribution: 'adopt' +# java-version: 17 +# +# - name: Setup Gradle +# uses: gradle/actions/setup-gradle@v4 +# +# - name: Build using Kotlin ${{ matrix.kotlin_version }} +# run: ./gradlew build diff --git a/README.md b/README.md index 0fd376ab92..bb2f0b8e4d 100644 --- a/README.md +++ b/README.md @@ -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) ``` @@ -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) ``` @@ -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) ``` @@ -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) ``` @@ -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) ``` diff --git a/apis/fluent/atrium-api-fluent/src/commonMain/kotlin/ch/tutteli/atrium/api/fluent/en_GB/charSequenceToContainCreators.kt b/apis/fluent/atrium-api-fluent/src/commonMain/kotlin/ch/tutteli/atrium/api/fluent/en_GB/charSequenceToContainCreators.kt index 05e8f3c6b6..0ede494ec5 100644 --- a/apis/fluent/atrium-api-fluent/src/commonMain/kotlin/ch/tutteli/atrium/api/fluent/en_GB/charSequenceToContainCreators.kt +++ b/apis/fluent/atrium-api-fluent/src/commonMain/kotlin/ch/tutteli/atrium/api/fluent/en_GB/charSequenceToContainCreators.kt @@ -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. diff --git a/apis/fluent/atrium-api-fluent/src/commonMain/kotlin/ch/tutteli/atrium/api/fluent/en_GB/iterableLikeToContainInOrderOnlyGroupedCreators.kt b/apis/fluent/atrium-api-fluent/src/commonMain/kotlin/ch/tutteli/atrium/api/fluent/en_GB/iterableLikeToContainInOrderOnlyGroupedCreators.kt index 529052cdd0..54e5b4d15c 100644 --- a/apis/fluent/atrium-api-fluent/src/commonMain/kotlin/ch/tutteli/atrium/api/fluent/en_GB/iterableLikeToContainInOrderOnlyGroupedCreators.kt +++ b/apis/fluent/atrium-api-fluent/src/commonMain/kotlin/ch/tutteli/atrium/api/fluent/en_GB/iterableLikeToContainInOrderOnlyGroupedCreators.kt @@ -41,6 +41,8 @@ fun EntryPointStep, secondGroup: Group, vararg otherExpectedGroups: Group, + //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 = _logicAppend { diff --git a/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/AnyExpectationsSpec.kt b/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/AnyExpectationsSpec.kt index 4fdc565b5b..97aa10b47e 100644 --- a/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/AnyExpectationsSpec.kt +++ b/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/AnyExpectationsSpec.kt @@ -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 - @Suppress("unused") + @Suppress("unused", "UNUSED_VALUE") fun Expect>.firstIs(value: E) = get(0) { toEqual(value) } } diff --git a/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/ArrayAsListExpectationsSpec.kt b/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/ArrayAsListExpectationsSpec.kt index e13ee859b8..87ac57eebc 100644 --- a/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/ArrayAsListExpectationsSpec.kt +++ b/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/ArrayAsListExpectationsSpec.kt @@ -26,7 +26,7 @@ object ArrayAsListExpectationsSpec : ch.tutteli.atrium.specs.integration.ArrayAs Expect::asList ) { - @Suppress("unused") + @Suppress("unused", "UNUSED_VARIABLE", "UNUSED_VALUE") private fun ambiguityTest() { var a1: Expect> = notImplemented() var a2: Expect> = notImplemented() diff --git a/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/CharSequenceExpectationsSpec.kt b/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/CharSequenceExpectationsSpec.kt index cd54e3fd14..02ba4122ba 100644 --- a/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/CharSequenceExpectationsSpec.kt +++ b/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/CharSequenceExpectationsSpec.kt @@ -16,7 +16,7 @@ class CharSequenceExpectationsSpec : ch.tutteli.atrium.specs.integration.CharSeq fun1(Expect::toMatch), fun1(Expect::notToMatch) ) { - @Suppress("unused") + @Suppress("unused", "UNUSED_VALUE") private fun ambiguityTest() { val a1: Expect = notImplemented() diff --git a/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/CharSequenceToContainNotToContainExpectationsSpec.kt b/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/CharSequenceToContainNotToContainExpectationsSpec.kt index edd2bc589a..a57d899860 100644 --- a/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/CharSequenceToContainNotToContainExpectationsSpec.kt +++ b/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/CharSequenceToContainNotToContainExpectationsSpec.kt @@ -40,7 +40,7 @@ class CharSequenceToContainNotToContainExpectationsSpec : Spek({ fun2>(Expect::notToContain) } - @Suppress("unused") + @Suppress("unused", "UNUSED_VALUE") private fun ambiguityTest() { val a1: Expect = notImplemented() diff --git a/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/CharSequenceToContainSpecBase.kt b/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/CharSequenceToContainSpecBase.kt index a3a37b0401..2171c74263 100644 --- a/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/CharSequenceToContainSpecBase.kt +++ b/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/CharSequenceToContainSpecBase.kt @@ -34,7 +34,7 @@ abstract class CharSequenceToContainSpecBase { protected val values = CharSequenceContains.CheckerStep::values.name protected val elementsOf = CharSequenceContains.EntryPointStep::elementsOf.name - @Suppress("unused") + @Suppress("unused", "UNUSED_VALUE") private fun ambiguityTest() { val a1: Expect = notImplemented() diff --git a/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/CollectionExpectationsSpec.kt b/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/CollectionExpectationsSpec.kt index a91f566d57..32eafc6858 100644 --- a/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/CollectionExpectationsSpec.kt +++ b/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/CollectionExpectationsSpec.kt @@ -9,7 +9,7 @@ object CollectionExpectationsSpec : ch.tutteli.atrium.specs.integration.Collecti property, Int>(Expect>::size), fun1, Expect.() -> Unit>(Expect>::size) ) { - @Suppress("unused") + @Suppress("unused", "UNUSED_VARIABLE", "UNUSED_VALUE") private fun ambiguityTest() { var a1: Expect> = notImplemented() var a1b: Expect> = notImplemented() diff --git a/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/ExtractSubjectSpec.kt b/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/ExtractSubjectSpec.kt index e5ecc5f983..8282b40ffa 100644 --- a/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/ExtractSubjectSpec.kt +++ b/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/ExtractSubjectSpec.kt @@ -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 = notImplemented() val nullableInt: Expect = notImplemented() diff --git a/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/FeatureExpectationsBoundedReferenceAlternativeSpec.kt b/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/FeatureExpectationsBoundedReferenceAlternativeSpec.kt index fe89d58241..3e3eb2f3a2 100644 --- a/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/FeatureExpectationsBoundedReferenceAlternativeSpec.kt +++ b/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/FeatureExpectationsBoundedReferenceAlternativeSpec.kt @@ -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> = notImplemented() val a1b: Expect> = notImplemented() diff --git a/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/FeatureExpectationsBoundedReferenceSpec.kt b/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/FeatureExpectationsBoundedReferenceSpec.kt index 71a9ff82c6..4a21f5c07e 100644 --- a/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/FeatureExpectationsBoundedReferenceSpec.kt +++ b/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/FeatureExpectationsBoundedReferenceSpec.kt @@ -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> = notImplemented() val a1b: Expect> = notImplemented() diff --git a/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/FeatureExpectationsClassReferenceSpec.kt b/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/FeatureExpectationsClassReferenceSpec.kt index 8d8233d39d..330276fb2e 100644 --- a/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/FeatureExpectationsClassReferenceSpec.kt +++ b/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/FeatureExpectationsClassReferenceSpec.kt @@ -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> = notImplemented() val a1b: Expect> = notImplemented() diff --git a/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/FeatureWorstCaseTest.kt b/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/FeatureWorstCaseTest.kt index d9f17b86a9..784b41a9cd 100644 --- a/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/FeatureWorstCaseTest.kt +++ b/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/FeatureWorstCaseTest.kt @@ -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 diff --git a/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/IterableExpectationsSpec.kt b/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/IterableExpectationsSpec.kt index e8ffdbbd2d..14e4001970 100644 --- a/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/IterableExpectationsSpec.kt +++ b/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/IterableExpectationsSpec.kt @@ -15,7 +15,7 @@ object IterableExpectationsSpec : ch.tutteli.atrium.specs.integration.IterableEx fun1, Expect.() -> Unit>(Expect>::last), ) { - @Suppress("unused") + @Suppress("unused", "UNUSED_VALUE") private fun ambiguityTest() { var a1: Expect> = notImplemented() var a1b: Expect> = notImplemented() diff --git a/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/IterableNotToContainEntriesExpectationsSpec.kt b/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/IterableNotToContainEntriesExpectationsSpec.kt index fc15e34a52..767df9d240 100644 --- a/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/IterableNotToContainEntriesExpectationsSpec.kt +++ b/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/IterableNotToContainEntriesExpectationsSpec.kt @@ -31,7 +31,7 @@ class IterableNotToContainEntriesExpectationsSpec : else expect.notToContain.entries(a, *aX) } - @Suppress("unused") + @Suppress("unused", "UNUSED_VALUE") private fun ambiguityTest() { var list: Expect> = notImplemented() var nList: Expect> = notImplemented() diff --git a/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/IterableNotToHaveElementsOrAllExpectationsSpec.kt b/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/IterableNotToHaveElementsOrAllExpectationsSpec.kt index b91a948cc4..a86132f3aa 100644 --- a/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/IterableNotToHaveElementsOrAllExpectationsSpec.kt +++ b/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/IterableNotToHaveElementsOrAllExpectationsSpec.kt @@ -10,7 +10,7 @@ object IterableNotToHaveElementsOrAllExpectationsSpec : ch.tutteli.atrium.specs. fun1(Expect>::notToHaveElementsOrAll).withNullableSuffix() ) { - @Suppress("unused") + @Suppress("unused", "UNUSED_VALUE") private fun ambiguityTest() { var list: Expect> = notImplemented() var nList: Expect> = notImplemented() diff --git a/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/IterableNotToHaveElementsOrAnyExpectationsSpec.kt b/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/IterableNotToHaveElementsOrAnyExpectationsSpec.kt index 9fbe7801af..9d7a79b65c 100644 --- a/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/IterableNotToHaveElementsOrAnyExpectationsSpec.kt +++ b/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/IterableNotToHaveElementsOrAnyExpectationsSpec.kt @@ -10,7 +10,7 @@ class IterableNotToHaveElementsOrAnyExpectationsSpec : ch.tutteli.atrium.specs.i fun1(Expect>::notToHaveElementsOrAny).withNullableSuffix() ) { - @Suppress("unused") + @Suppress("unused", "UNUSED_VALUE") private fun ambiguityTest() { var list: Expect> = notImplemented() var nList: Expect> = notImplemented() diff --git a/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/IterableNotToHaveElementsOrNoneExpectationsSpec.kt b/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/IterableNotToHaveElementsOrNoneExpectationsSpec.kt index 99fef60f69..68f307a320 100644 --- a/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/IterableNotToHaveElementsOrNoneExpectationsSpec.kt +++ b/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/IterableNotToHaveElementsOrNoneExpectationsSpec.kt @@ -10,7 +10,7 @@ class IterableNotToHaveElementsOrNoneExpectationsSpec : ch.tutteli.atrium.specs. fun1(Expect>::notToHaveElementsOrNone).withNullableSuffix() ) { - @Suppress("unused") + @Suppress("unused", "UNUSED_VALUE") private fun ambiguityTest() { var list: Expect> = notImplemented() var nList: Expect> = notImplemented() diff --git a/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/IterableToContainInAnyOrderAtLeast1ElementsOfExpectationsSpec.kt b/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/IterableToContainInAnyOrderAtLeast1ElementsOfExpectationsSpec.kt index cdf09469fc..dd5bc37f8d 100644 --- a/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/IterableToContainInAnyOrderAtLeast1ElementsOfExpectationsSpec.kt +++ b/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/IterableToContainInAnyOrderAtLeast1ElementsOfExpectationsSpec.kt @@ -65,7 +65,7 @@ class IterableToContainInAnyOrderAtLeast1ElementsOfExpectationsSpec : Spek({ ): Expect> = expect.toContainElementsOf(sequenceOf(a, *aX).asIterable()) } - @Suppress("unused") + @Suppress("unused", "UNUSED_VALUE") private fun ambiguityTest() { var list: Expect> = notImplemented() var nList: Expect> = notImplemented() diff --git a/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/IterableToContainInAnyOrderAtLeast1EntriesExpectationsSpec.kt b/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/IterableToContainInAnyOrderAtLeast1EntriesExpectationsSpec.kt index 391fabd85d..8db1736beb 100644 --- a/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/IterableToContainInAnyOrderAtLeast1EntriesExpectationsSpec.kt +++ b/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/IterableToContainInAnyOrderAtLeast1EntriesExpectationsSpec.kt @@ -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> = notImplemented() var nList: Expect> = notImplemented() diff --git a/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/IterableToContainInAnyOrderAtLeast1ValuesExpectationsSpec.kt b/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/IterableToContainInAnyOrderAtLeast1ValuesExpectationsSpec.kt index 0431a4cd94..38eba44e3a 100644 --- a/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/IterableToContainInAnyOrderAtLeast1ValuesExpectationsSpec.kt +++ b/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/IterableToContainInAnyOrderAtLeast1ValuesExpectationsSpec.kt @@ -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> = notImplemented() var nList: Expect> = notImplemented() diff --git a/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/IterableToContainInAnyOrderAtMostValuesExpectationsSpec.kt b/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/IterableToContainInAnyOrderAtMostValuesExpectationsSpec.kt index eac1d84e70..d4da2a9502 100644 --- a/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/IterableToContainInAnyOrderAtMostValuesExpectationsSpec.kt +++ b/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/IterableToContainInAnyOrderAtMostValuesExpectationsSpec.kt @@ -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> = notImplemented() var nList: Expect> = notImplemented() diff --git a/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/IterableToContainInAnyOrderExactlyValuesExpectationsSpec.kt b/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/IterableToContainInAnyOrderExactlyValuesExpectationsSpec.kt index dc02e25ebe..7751aa5331 100644 --- a/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/IterableToContainInAnyOrderExactlyValuesExpectationsSpec.kt +++ b/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/IterableToContainInAnyOrderExactlyValuesExpectationsSpec.kt @@ -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> = notImplemented() var nList: Expect> = notImplemented() diff --git a/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/IterableToContainInAnyOrderNotOrAtMostValuesExpectationsSpec.kt b/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/IterableToContainInAnyOrderNotOrAtMostValuesExpectationsSpec.kt index dd3daa0eda..213307ac2d 100644 --- a/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/IterableToContainInAnyOrderNotOrAtMostValuesExpectationsSpec.kt +++ b/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/IterableToContainInAnyOrderNotOrAtMostValuesExpectationsSpec.kt @@ -27,7 +27,7 @@ class IterableToContainInAnyOrderNotOrAtMostValuesExpectationsSpec : private fun getErrorMsgNotToContain(times: Int) = "use $notToContain instead of $notOrAtMost($times)" } - @Suppress("unused") + @Suppress("unused", "UNUSED_VALUE") private fun ambiguityTest() { var list: Expect> = notImplemented() var nList: Expect> = notImplemented() diff --git a/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/IterableToContainInAnyOrderOnlyElementsOfExpectationsSpec.kt b/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/IterableToContainInAnyOrderOnlyElementsOfExpectationsSpec.kt index bef5b2e544..122402e9a2 100644 --- a/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/IterableToContainInAnyOrderOnlyElementsOfExpectationsSpec.kt +++ b/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/IterableToContainInAnyOrderOnlyElementsOfExpectationsSpec.kt @@ -48,7 +48,7 @@ class IterableToContainInAnyOrderOnlyElementsOfExpectationsSpec : Spek({ } else expect.toContain.inAnyOrder.only.elementsOf(listOf(a, *aX), report = report) } - @Suppress("unused") + @Suppress("unused", "UNUSED_VALUE") private fun ambiguityTest() { var list: Expect> = notImplemented() var nList: Expect> = notImplemented() diff --git a/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/IterableToContainInAnyOrderOnlyEntriesExpectationsSpec.kt b/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/IterableToContainInAnyOrderOnlyEntriesExpectationsSpec.kt index 3c519bbe4c..62e46d52e6 100644 --- a/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/IterableToContainInAnyOrderOnlyEntriesExpectationsSpec.kt +++ b/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/IterableToContainInAnyOrderOnlyEntriesExpectationsSpec.kt @@ -37,7 +37,7 @@ class IterableToContainInAnyOrderOnlyEntriesExpectationsSpec : } else expect.toContain.inAnyOrder.only.entries(a, *aX, report = report) } - @Suppress("unused") + @Suppress("unused", "UNUSED_VALUE") private fun ambiguityTest() { var list: Expect> = notImplemented() var nList: Expect> = notImplemented() diff --git a/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/IterableToContainInAnyOrderOnlyValuesExpectationsSpec.kt b/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/IterableToContainInAnyOrderOnlyValuesExpectationsSpec.kt index b29264b99f..326343cbff 100644 --- a/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/IterableToContainInAnyOrderOnlyValuesExpectationsSpec.kt +++ b/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/IterableToContainInAnyOrderOnlyValuesExpectationsSpec.kt @@ -36,7 +36,7 @@ class IterableToContainInAnyOrderOnlyValuesExpectationsSpec : } else expect.toContain.inAnyOrder.only.values(a, *aX, report = report) } - @Suppress("unused") + @Suppress("unused", "UNUSED_VALUE") private fun ambiguityTest() { var list: Expect> = notImplemented() var nList: Expect> = notImplemented() diff --git a/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/IterableToContainInOrderOnlyElementsOfExpectationsSpec.kt b/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/IterableToContainInOrderOnlyElementsOfExpectationsSpec.kt index df470fa332..c7473cb66b 100644 --- a/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/IterableToContainInOrderOnlyElementsOfExpectationsSpec.kt +++ b/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/IterableToContainInOrderOnlyElementsOfExpectationsSpec.kt @@ -77,7 +77,7 @@ class IterableToContainInOrderOnlyElementsOfExpectationsSpec : Spek({ ): Expect> = expect.toContainExactlyElementsOf(sequenceOf(a, *aX).asIterable(), report) } - @Suppress("unused") + @Suppress("unused", "UNUSED_VALUE") private fun ambiguityTest() { var list: Expect> = notImplemented() var nList: Expect> = notImplemented() diff --git a/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/IterableToContainInOrderOnlyEntriesExpectationsSpec.kt b/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/IterableToContainInOrderOnlyEntriesExpectationsSpec.kt index da3d4df3d9..a4585dd144 100644 --- a/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/IterableToContainInOrderOnlyEntriesExpectationsSpec.kt +++ b/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/IterableToContainInOrderOnlyEntriesExpectationsSpec.kt @@ -70,7 +70,7 @@ class IterableToContainInOrderOnlyEntriesExpectationsSpec : Spek({ ): Expect> = expect.toContainExactly(a, *aX, report = report) } - @Suppress("unused") + @Suppress("unused", "UNUSED_VALUE") private fun ambiguityTest() { var list: Expect> = notImplemented() var nList: Expect> = notImplemented() diff --git a/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/IterableToContainInOrderOnlyGroupedEntriesExpectationsSpec.kt b/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/IterableToContainInOrderOnlyGroupedEntriesExpectationsSpec.kt index b242cab6c8..783fb8feb4 100644 --- a/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/IterableToContainInOrderOnlyGroupedEntriesExpectationsSpec.kt +++ b/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/IterableToContainInOrderOnlyGroupedEntriesExpectationsSpec.kt @@ -51,7 +51,7 @@ class IterableToContainInOrderOnlyGroupedEntriesExpectationsSpec : } } - @Suppress("unused") + @Suppress("unused", "UNUSED_VALUE") private fun ambiguityTest() { var list: Expect> = notImplemented() var nList: Expect> = notImplemented() diff --git a/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/IterableToContainInOrderOnlyGroupedValuesExpectationsSpec.kt b/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/IterableToContainInOrderOnlyGroupedValuesExpectationsSpec.kt index 1c9fd5a3fe..9baa514524 100644 --- a/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/IterableToContainInOrderOnlyGroupedValuesExpectationsSpec.kt +++ b/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/IterableToContainInOrderOnlyGroupedValuesExpectationsSpec.kt @@ -86,7 +86,7 @@ class IterableToContainInOrderOnlyGroupedValuesExpectationsSpec : } } - @Suppress("unused") + @Suppress("unused", "UNUSED_VALUE") private fun ambiguityTest() { var list: Expect> = notImplemented() var nList: Expect> = notImplemented() diff --git a/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/IterableToContainInOrderOnlyValuesExpectationsSpec.kt b/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/IterableToContainInOrderOnlyValuesExpectationsSpec.kt index 683abae51d..f89a4ff737 100644 --- a/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/IterableToContainInOrderOnlyValuesExpectationsSpec.kt +++ b/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/IterableToContainInOrderOnlyValuesExpectationsSpec.kt @@ -12,10 +12,8 @@ import org.spekframework.spek2.Spek import ch.tutteli.atrium.api.fluent.en_GB.IterableToContainInOrderOnlyValuesExpectationsSpec.Companion as C class IterableToContainInOrderOnlyValuesExpectationsSpec : Spek({ - include(BuilderSpec) include(ShortcutSpec) - }) { object BuilderSpec : ch.tutteli.atrium.specs.integration.IterableToContainInOrderOnlyValuesExpectationsSpec( functionDescription to C::toContainInOrderOnlyValues, @@ -55,7 +53,7 @@ class IterableToContainInOrderOnlyValuesExpectationsSpec : Spek({ } else expect.toContain.inOrder.only.values(a, *aX, report = report) } - @Suppress("unused") + @Suppress("unused", "UNUSED_VALUE") private fun ambiguityTest() { var list: Expect> = notImplemented() var nList: Expect> = notImplemented() diff --git a/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/IterableToContainNotValuesExpectationsSpec.kt b/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/IterableToContainNotValuesExpectationsSpec.kt index deecd629d3..93ba0cb7b8 100644 --- a/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/IterableToContainNotValuesExpectationsSpec.kt +++ b/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/IterableToContainNotValuesExpectationsSpec.kt @@ -8,10 +8,8 @@ import org.spekframework.spek2.Spek import ch.tutteli.atrium.api.fluent.en_GB.IterableToContainNotValuesExpectationsSpec.Companion as C class IterableToContainNotValuesExpectationsSpec : Spek({ - include(BuilderSpec) include(ShortcutSpec) - }) { object BuilderSpec : ch.tutteli.atrium.specs.integration.IterableNotToContainValuesExpectationsSpec( @@ -49,7 +47,7 @@ class IterableToContainNotValuesExpectationsSpec : Spek({ } - @Suppress("unused") + @Suppress("unused", "UNUSED_VALUE") private fun ambiguityTest() { var list: Expect> = notImplemented() var nList: Expect> = notImplemented() diff --git a/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/IterableToHaveElementsAndAllExpectationsSpec.kt b/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/IterableToHaveElementsAndAllExpectationsSpec.kt index 9be40e5492..9c9ab6964c 100644 --- a/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/IterableToHaveElementsAndAllExpectationsSpec.kt +++ b/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/IterableToHaveElementsAndAllExpectationsSpec.kt @@ -10,7 +10,7 @@ object IterableToHaveElementsAndAllExpectationsSpec : ch.tutteli.atrium.specs.in fun1(Expect>::toHaveElementsAndAll).withNullableSuffix() ) { - @Suppress("unused") + @Suppress("unused", "UNUSED_VALUE") private fun ambiguityTest() { var list: Expect> = notImplemented() var nList: Expect> = notImplemented() diff --git a/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/IterableToHaveElementsAndAnyExpectationsSpec.kt b/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/IterableToHaveElementsAndAnyExpectationsSpec.kt index 71f6167f21..ee3c70f7fb 100644 --- a/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/IterableToHaveElementsAndAnyExpectationsSpec.kt +++ b/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/IterableToHaveElementsAndAnyExpectationsSpec.kt @@ -86,7 +86,7 @@ class IterableToHaveElementsAndAnyExpectationsSpec : Spek({ } - @Suppress("unused") + @Suppress("unused", "UNUSED_VALUE") private fun ambiguityTest() { var list: Expect> = notImplemented() var nList: Expect> = notImplemented() diff --git a/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/IterableToHaveElementsAndNoneExpectationsSpec.kt b/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/IterableToHaveElementsAndNoneExpectationsSpec.kt index fda0c489bd..410896d843 100644 --- a/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/IterableToHaveElementsAndNoneExpectationsSpec.kt +++ b/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/IterableToHaveElementsAndNoneExpectationsSpec.kt @@ -14,6 +14,7 @@ class IterableToHaveElementsAndNoneExpectationsSpec : Spek({ object PredicateSpec : ch.tutteli.atrium.specs.integration.IterableToHaveElementsAndNoneExpectationsSpec( fun1(Expect>::toHaveElementsAndNone), fun1(Expect>::toHaveElementsAndNone).withNullableSuffix(), + Expect>::notToHaveElementsOrNone.name, "[Atrium][Predicate] " ) @@ -22,6 +23,7 @@ class IterableToHaveElementsAndNoneExpectationsSpec : Spek({ object BuilderSpec : ch.tutteli.atrium.specs.integration.IterableToHaveElementsAndNoneExpectationsSpec( functionDescription to C::notToContainFun, (functionDescription to C::notToContainNullableFun).withNullableSuffix(), + Expect>::notToHaveElementsOrNone.name, "[Atrium][Builder] " ) @@ -35,7 +37,7 @@ class IterableToHaveElementsAndNoneExpectationsSpec : Spek({ expect.notToContain.entry(a) } - @Suppress("unused") + @Suppress("unused", "UNUSED_VALUE") private fun ambiguityTest() { var list: Expect> = notImplemented() var nList: Expect> = notImplemented() diff --git a/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/ListExpectationsSpec.kt b/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/ListExpectationsSpec.kt index ac87064d54..54ef879f9e 100644 --- a/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/ListExpectationsSpec.kt +++ b/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/ListExpectationsSpec.kt @@ -56,7 +56,7 @@ object ListExpectationsSpec : Spek({ } }) - @Suppress("unused") + @Suppress("unused", "UNUSED_VALUE") private fun ambiguityTest() { var a1: Expect> = notImplemented() var a1b: Expect> = notImplemented() diff --git a/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/MapAsEntriesExpectationsSpec.kt b/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/MapAsEntriesExpectationsSpec.kt index 258e250bac..f28e445766 100644 --- a/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/MapAsEntriesExpectationsSpec.kt +++ b/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/MapAsEntriesExpectationsSpec.kt @@ -10,7 +10,7 @@ object MapAsEntriesExpectationsSpec : ch.tutteli.atrium.specs.integration.MapAsE fun1, Expect>>.() -> Unit>(Expect>::asEntries) ) { - @Suppress("unused") + @Suppress("unused", "UNUSED_VALUE") private fun ambiguityTest() { var map: Expect> = notImplemented() var subMap: Expect> = notImplemented() diff --git a/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/MapEntryExpectationsSpec.kt b/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/MapEntryExpectationsSpec.kt index d53bd18ecf..6c76216b5f 100644 --- a/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/MapEntryExpectationsSpec.kt +++ b/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/MapEntryExpectationsSpec.kt @@ -15,7 +15,7 @@ object MapEntryExpectationsSpec : ch.tutteli.atrium.specs.integration.MapEntryEx property, Int?>(Expect>::value).withNullableSuffix(), fun1, Expect.() -> Unit>(Expect>::value).withNullableSuffix() ) { - @Suppress("unused") + @Suppress("unused", "UNUSED_VALUE") private fun ambiguityTest() { var a1: Expect> = notImplemented() var a2: Expect> = notImplemented() diff --git a/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/MapExpectationsSpec.kt b/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/MapExpectationsSpec.kt index 05dfcef351..70c2257c39 100644 --- a/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/MapExpectationsSpec.kt +++ b/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/MapExpectationsSpec.kt @@ -42,7 +42,7 @@ class MapExpectationsSpec : ch.tutteli.atrium.specs.integration.MapExpectationsS } - @Suppress("unused") + @Suppress("unused", "UNUSED_VALUE") private fun ambiguityTest() { var map: Expect> = notImplemented() var subMap: Expect> = notImplemented() diff --git a/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/MapToContainInAnyOrderEntriesOfExpectationsSpec.kt b/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/MapToContainInAnyOrderEntriesOfExpectationsSpec.kt index fcfde74b2c..ef68169652 100644 --- a/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/MapToContainInAnyOrderEntriesOfExpectationsSpec.kt +++ b/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/MapToContainInAnyOrderEntriesOfExpectationsSpec.kt @@ -82,7 +82,7 @@ class MapToContainInAnyOrderEntriesOfExpectationsSpec : Spek({ } - @Suppress("unused") + @Suppress("unused", "UNUSED_VALUE") private fun ambiguityTest() { var map: Expect> = notImplemented() var subMap: Expect> = notImplemented() diff --git a/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/MapToContainInAnyOrderKeyValueExpectationsSpec.kt b/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/MapToContainInAnyOrderKeyValueExpectationsSpec.kt index 8634ebb0f2..63b38c6940 100644 --- a/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/MapToContainInAnyOrderKeyValueExpectationsSpec.kt +++ b/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/MapToContainInAnyOrderKeyValueExpectationsSpec.kt @@ -66,7 +66,7 @@ class MapToContainInAnyOrderKeyValueExpectationsSpec : Spek({ } } - @Suppress("unused") + @Suppress("unused", "UNUSED_VALUE") private fun ambiguityTest() { var map: Expect> = notImplemented() var subMap: Expect> = notImplemented() diff --git a/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/MapToContainInAnyOrderKeyValuePairsExpectationsSpec.kt b/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/MapToContainInAnyOrderKeyValuePairsExpectationsSpec.kt index 6d36143471..6097e4d331 100644 --- a/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/MapToContainInAnyOrderKeyValuePairsExpectationsSpec.kt +++ b/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/MapToContainInAnyOrderKeyValuePairsExpectationsSpec.kt @@ -43,7 +43,7 @@ class MapToContainInAnyOrderKeyValuePairsExpectationsSpec : Spek({ else expect.toContain.inAnyOrder.entries(a, *aX) } - @Suppress("unused") + @Suppress("unused", "UNUSED_VALUE") private fun ambiguityTest() { var map: Expect> = notImplemented() var subMap: Expect> = notImplemented() diff --git a/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/MapToContainInAnyOrderOnlyEntriesOfExpectationsSpec.kt b/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/MapToContainInAnyOrderOnlyEntriesOfExpectationsSpec.kt index 58161858ac..9672cb74f9 100644 --- a/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/MapToContainInAnyOrderOnlyEntriesOfExpectationsSpec.kt +++ b/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/MapToContainInAnyOrderOnlyEntriesOfExpectationsSpec.kt @@ -84,7 +84,7 @@ class MapToContainInAnyOrderOnlyEntriesOfExpectationsSpec : Spek({ - @Suppress("unused") + @Suppress("unused", "UNUSED_VALUE") private fun ambiguityTest() { var map: Expect> = notImplemented() var subMap: Expect> = notImplemented() diff --git a/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/MapToContainInAnyOrderOnlyKeyValueExpectationsSpec.kt b/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/MapToContainInAnyOrderOnlyKeyValueExpectationsSpec.kt index a9e815a99c..e6eecde4c9 100644 --- a/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/MapToContainInAnyOrderOnlyKeyValueExpectationsSpec.kt +++ b/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/MapToContainInAnyOrderOnlyKeyValueExpectationsSpec.kt @@ -68,7 +68,7 @@ class MapToContainInAnyOrderOnlyKeyValueExpectationsSpec : Spek({ } - @Suppress("unused") + @Suppress("unused", "UNUSED_VALUE") private fun ambiguityTest() { var map: Expect> = notImplemented() var subMap: Expect> = notImplemented() diff --git a/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/MapToContainInAnyOrderOnlyKeyValuePairsExpectationsSpec.kt b/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/MapToContainInAnyOrderOnlyKeyValuePairsExpectationsSpec.kt index b9e2757470..725b60abf0 100644 --- a/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/MapToContainInAnyOrderOnlyKeyValuePairsExpectationsSpec.kt +++ b/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/MapToContainInAnyOrderOnlyKeyValuePairsExpectationsSpec.kt @@ -44,7 +44,7 @@ class MapToContainInAnyOrderOnlyKeyValuePairsExpectationsSpec : Spek({ } - @Suppress("unused") + @Suppress("unused", "UNUSED_VALUE") private fun ambiguityTest() { var map: Expect> = notImplemented() var subMap: Expect> = notImplemented() diff --git a/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/MapToContainInOrderOnlyEntriesOfExpectationsSpec.kt b/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/MapToContainInOrderOnlyEntriesOfExpectationsSpec.kt index 2fb2abf152..0d257bbcba 100644 --- a/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/MapToContainInOrderOnlyEntriesOfExpectationsSpec.kt +++ b/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/MapToContainInOrderOnlyEntriesOfExpectationsSpec.kt @@ -57,7 +57,7 @@ class MapToContainInOrderOnlyEntriesOfExpectationsSpec : Spek({ } - @Suppress("unused") + @Suppress("unused", "UNUSED_VALUE") private fun ambiguityTest() { var map: Expect> = notImplemented() var subMap: Expect> = notImplemented() diff --git a/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/MapToContainInOrderOnlyKeyValueExpectationsSpec.kt b/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/MapToContainInOrderOnlyKeyValueExpectationsSpec.kt index 8717d66004..329d5f5217 100644 --- a/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/MapToContainInOrderOnlyKeyValueExpectationsSpec.kt +++ b/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/MapToContainInOrderOnlyKeyValueExpectationsSpec.kt @@ -47,7 +47,7 @@ class MapToContainInOrderOnlyKeyValueExpectationsSpec : Spek({ } } - @Suppress("unused") + @Suppress("unused", "UNUSED_VALUE") private fun ambiguityTest() { var map: Expect> = notImplemented() var subMap: Expect> = notImplemented() diff --git a/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/MapToContainInOrderOnlyKeyValuePairsExpectationsSpec.kt b/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/MapToContainInOrderOnlyKeyValuePairsExpectationsSpec.kt index d9e4c4daf6..e2890f6fa3 100644 --- a/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/MapToContainInOrderOnlyKeyValuePairsExpectationsSpec.kt +++ b/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/MapToContainInOrderOnlyKeyValuePairsExpectationsSpec.kt @@ -46,7 +46,7 @@ class MapToContainInOrderOnlyKeyValuePairsExpectationsSpec : Spek({ } - @Suppress("unused") + @Suppress("unused", "UNUSED_VALUE") private fun ambiguityTest() { var map: Expect> = notImplemented() var subMap: Expect> = notImplemented() diff --git a/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/PairExpectationsSpec.kt b/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/PairExpectationsSpec.kt index 097aaae2ed..cb76c4567e 100644 --- a/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/PairExpectationsSpec.kt +++ b/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/PairExpectationsSpec.kt @@ -16,7 +16,7 @@ class PairExpectationsSpec : ch.tutteli.atrium.specs.integration.PairExpectation fun1, Expect.() -> Unit>(Expect>::second) ) { - @Suppress("unused") + @Suppress("unused", "UNUSED_VALUE") private fun ambiguityTest() { var a1: Expect> = notImplemented() var a2: Expect> = notImplemented() diff --git a/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/ResultExpectationsSpec.kt b/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/ResultExpectationsSpec.kt index 9e488efcf5..6afc443c33 100644 --- a/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/ResultExpectationsSpec.kt +++ b/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/ResultExpectationsSpec.kt @@ -8,8 +8,8 @@ class ResultExpectationsSpec : ch.tutteli.atrium.specs.integration.ResultExpecta fun1, Expect.() -> Unit>(Expect>::toBeASuccess), feature0, Int?>(Expect>::toBeASuccess).withNullableSuffix(), fun1, Expect.() -> Unit>(Expect>::toBeASuccess).withNullableSuffix(), - ("isFailure" to Companion::toBeAFailureFeature).withFeatureSuffix(), - "isFailure" to Companion::toBeAFailure + ("toBeAFailure" to Companion::toBeAFailureFeature).withFeatureSuffix(), + "toBeAFailure" to Companion::toBeAFailure ) { companion object { private fun toBeAFailureFeature(expect: Expect>) = expect.toBeAFailure() diff --git a/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/ThirdPartyExpectationsSpec.kt b/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/ThirdPartyExpectationsSpec.kt index 7f5a14e9fb..02bd973b41 100644 --- a/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/ThirdPartyExpectationsSpec.kt +++ b/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/ThirdPartyExpectationsSpec.kt @@ -10,7 +10,7 @@ class ThirdPartyExpectationsSpec : ch.tutteli.atrium.specs.integration.ThirdPart fun3(Expect::toHoldThirdPartyExpectation).withNullableSuffix(), ) { - @Suppress("unused") + @Suppress("unused", "UNUSED_VALUE") private fun ambiguityTest() { val int: Expect = notImplemented() val nullableInt: Expect = notImplemented() diff --git a/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/ThrowableExpectationsSpec.kt b/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/ThrowableExpectationsSpec.kt index 1bd2569fc7..e29765b318 100644 --- a/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/ThrowableExpectationsSpec.kt +++ b/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/ThrowableExpectationsSpec.kt @@ -25,7 +25,7 @@ class ThrowableExpectationsSpec : ch.tutteli.atrium.specs.integration.ThrowableE } - @Suppress("unused") + @Suppress("unused", "UNUSED_VALUE") private fun ambiguityTest() { var a1: Expect = notImplemented() diff --git a/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/samples/IterableLikeToContainCheckerSamples.kt b/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/samples/IterableLikeToContainCheckerSamples.kt index fe2840fe76..d0b61b9099 100644 --- a/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/samples/IterableLikeToContainCheckerSamples.kt +++ b/apis/fluent/atrium-api-fluent/src/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/samples/IterableLikeToContainCheckerSamples.kt @@ -10,7 +10,6 @@ class IterableLikeToContainCheckerSamples { @Test fun atLeast() { expect(listOf("A", "B", "C", "A", "B", "B")).toContain.inAnyOrder.atLeast(3).entry { - feature { f(String::plus, it, "1") }.toEqual("A1") toEqual("B") } diff --git a/apis/fluent/atrium-api-fluent/src/jvmTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/ChronoLocalDateExpectationsSpec.kt b/apis/fluent/atrium-api-fluent/src/jvmTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/ChronoLocalDateExpectationsSpec.kt index 0b109598c6..a1feed7cfe 100644 --- a/apis/fluent/atrium-api-fluent/src/jvmTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/ChronoLocalDateExpectationsSpec.kt +++ b/apis/fluent/atrium-api-fluent/src/jvmTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/ChronoLocalDateExpectationsSpec.kt @@ -28,7 +28,7 @@ class ChronoLocalDateExpectationsSpec : Spek({ fun1(Expect::toBeTheSamePointInTimeAs) ) - @Suppress("unused") + @Suppress("unused", "UNUSED_VALUE") private fun ambiguityTest() { val chronoLocalDate: ChronoLocalDate = notImplemented() var a1: Expect = notImplemented() diff --git a/apis/fluent/atrium-api-fluent/src/jvmTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/ChronoLocalDateTimeExpectationsSpec.kt b/apis/fluent/atrium-api-fluent/src/jvmTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/ChronoLocalDateTimeExpectationsSpec.kt index 21040af408..6e48f13f6c 100644 --- a/apis/fluent/atrium-api-fluent/src/jvmTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/ChronoLocalDateTimeExpectationsSpec.kt +++ b/apis/fluent/atrium-api-fluent/src/jvmTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/ChronoLocalDateTimeExpectationsSpec.kt @@ -30,7 +30,7 @@ class ChronoLocalDateTimeExpectationsSpec : Spek({ fun1, String>(Expect>::toBeTheSamePointInTimeAs) ) - @Suppress("unused") + @Suppress("unused", "UNUSED_VALUE") private fun ambiguityTest() { val chronoLocalDateTime: ChronoLocalDateTime<*> = notImplemented() var a1: Expect> = notImplemented() diff --git a/apis/fluent/atrium-api-fluent/src/jvmTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/ChronoZonedDateTimeExpectationsSpec.kt b/apis/fluent/atrium-api-fluent/src/jvmTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/ChronoZonedDateTimeExpectationsSpec.kt index 94914b8c24..1f2e088c23 100644 --- a/apis/fluent/atrium-api-fluent/src/jvmTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/ChronoZonedDateTimeExpectationsSpec.kt +++ b/apis/fluent/atrium-api-fluent/src/jvmTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/ChronoZonedDateTimeExpectationsSpec.kt @@ -30,7 +30,7 @@ class ChronoZonedDateTimeExpectationsSpec : Spek({ fun1, String>(Expect>::toBeTheSamePointInTimeAs) ) - @Suppress("unused") + @Suppress("unused", "UNUSED_VALUE") private fun ambiguityTest() { val chronoZonedDateTime: ChronoZonedDateTime<*> = notImplemented() var a1: Expect> = notImplemented() diff --git a/apis/fluent/atrium-api-fluent/src/jvmTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/DateAsLocalDateExpectationsSpec.kt b/apis/fluent/atrium-api-fluent/src/jvmTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/DateAsLocalDateExpectationsSpec.kt index 23b659fee2..4c99533875 100644 --- a/apis/fluent/atrium-api-fluent/src/jvmTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/DateAsLocalDateExpectationsSpec.kt +++ b/apis/fluent/atrium-api-fluent/src/jvmTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/DateAsLocalDateExpectationsSpec.kt @@ -8,7 +8,7 @@ import java.util.Date class DateAsLocalDateExpectationsSpec : DateAsLocalDateExpectationsSpec( Expect::asLocalDate ) { - @Suppress("unused") + @Suppress("unused", "UNUSED_VALUE") private fun ambiguityTest() { var date: Expect = notImplemented() diff --git a/apis/fluent/atrium-api-fluent/src/jvmTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/DateAsLocalDateTimeExpectationsSpec.kt b/apis/fluent/atrium-api-fluent/src/jvmTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/DateAsLocalDateTimeExpectationsSpec.kt index e5add71d7a..b21e192ca5 100644 --- a/apis/fluent/atrium-api-fluent/src/jvmTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/DateAsLocalDateTimeExpectationsSpec.kt +++ b/apis/fluent/atrium-api-fluent/src/jvmTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/DateAsLocalDateTimeExpectationsSpec.kt @@ -8,7 +8,7 @@ import java.util.Date class DateAsLocalDateTimeExpectationsSpec : DateAsLocalDateTimeExpectationsSpec( Expect::asLocalDateTime ) { - @Suppress("unused") + @Suppress("unused", "UNUSED_VALUE") private fun ambiguityTest() { var date: Expect = notImplemented() diff --git a/apis/fluent/atrium-api-fluent/src/jvmTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/FileAsPathExpectationsSpec.kt b/apis/fluent/atrium-api-fluent/src/jvmTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/FileAsPathExpectationsSpec.kt index 252ad2cdd0..71250c3171 100644 --- a/apis/fluent/atrium-api-fluent/src/jvmTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/FileAsPathExpectationsSpec.kt +++ b/apis/fluent/atrium-api-fluent/src/jvmTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/FileAsPathExpectationsSpec.kt @@ -7,7 +7,7 @@ import java.io.File class FileAsPathExpectationsSpec : ch.tutteli.atrium.specs.integration.FileAsPathExpectationsSpec( Expect::asPath ) { - @Suppress("unused") + @Suppress("unused", "UNUSED_VALUE") private fun ambiguityTest() { var a1: Expect = notImplemented() diff --git a/apis/fluent/atrium-api-fluent/src/jvmTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/LocalDateExpectationsSpec.kt b/apis/fluent/atrium-api-fluent/src/jvmTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/LocalDateExpectationsSpec.kt index d2c69162cc..36c7387804 100644 --- a/apis/fluent/atrium-api-fluent/src/jvmTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/LocalDateExpectationsSpec.kt +++ b/apis/fluent/atrium-api-fluent/src/jvmTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/LocalDateExpectationsSpec.kt @@ -17,7 +17,7 @@ class LocalDateExpectationsSpec : ch.tutteli.atrium.specs.integration.LocalDateE property(Expect::dayOfWeek), fun1.() -> Unit>(Expect::dayOfWeek) ) { - @Suppress("unused") + @Suppress("unused", "UNUSED_VALUE") private fun ambiguityTest() { var a1: Expect = notImplemented() diff --git a/apis/fluent/atrium-api-fluent/src/jvmTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/LocalDateTimeExpectationsSpec.kt b/apis/fluent/atrium-api-fluent/src/jvmTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/LocalDateTimeExpectationsSpec.kt index c0d3da8862..343515c2ba 100644 --- a/apis/fluent/atrium-api-fluent/src/jvmTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/LocalDateTimeExpectationsSpec.kt +++ b/apis/fluent/atrium-api-fluent/src/jvmTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/LocalDateTimeExpectationsSpec.kt @@ -17,7 +17,7 @@ class LocalDateTimeExpectationsSpec : ch.tutteli.atrium.specs.integration.LocalD property(Expect::dayOfWeek), fun1.() -> Unit>(Expect::dayOfWeek) ) { - @Suppress("unused") + @Suppress("unused", "UNUSED_VALUE") private fun ambiguityTest() { var a1: Expect = notImplemented() diff --git a/apis/fluent/atrium-api-fluent/src/jvmTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/OptionalExpectationsSpec.kt b/apis/fluent/atrium-api-fluent/src/jvmTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/OptionalExpectationsSpec.kt index 04897333cd..6c6ab454f6 100644 --- a/apis/fluent/atrium-api-fluent/src/jvmTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/OptionalExpectationsSpec.kt +++ b/apis/fluent/atrium-api-fluent/src/jvmTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/OptionalExpectationsSpec.kt @@ -10,7 +10,7 @@ class OptionalExpectationsSpec : OptionalExpectationsSpec( feature0, Int>(Expect>::toBePresent), fun1, Expect.() -> Unit>(Expect>::toBePresent) ) { - @Suppress("unused") + @Suppress("unused", "UNUSED_VALUE") private fun ambiguityTest() { var o1: Expect> = notImplemented() var o1b: Expect> = notImplemented() diff --git a/apis/fluent/atrium-api-fluent/src/jvmTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/PathExpectationsSpec.kt b/apis/fluent/atrium-api-fluent/src/jvmTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/PathExpectationsSpec.kt index 398e28fc4f..12d69cb8e1 100644 --- a/apis/fluent/atrium-api-fluent/src/jvmTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/PathExpectationsSpec.kt +++ b/apis/fluent/atrium-api-fluent/src/jvmTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/PathExpectationsSpec.kt @@ -49,7 +49,7 @@ class PathExpectationsSpec : ch.tutteli.atrium.specs.integration.PathExpectation expect.toHaveTheDirectoryEntries(entry) } - @Suppress("unused") + @Suppress("unused", "UNUSED_VALUE") private fun ambiguityTest() { var a1: Expect = notImplemented() diff --git a/apis/fluent/atrium-api-fluent/src/jvmTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/ZonedDateTimeExpectationsSpec.kt b/apis/fluent/atrium-api-fluent/src/jvmTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/ZonedDateTimeExpectationsSpec.kt index 54a12efc83..8644ead3d9 100644 --- a/apis/fluent/atrium-api-fluent/src/jvmTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/ZonedDateTimeExpectationsSpec.kt +++ b/apis/fluent/atrium-api-fluent/src/jvmTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/ZonedDateTimeExpectationsSpec.kt @@ -17,7 +17,7 @@ class ZonedDateTimeExpectationsSpec : ch.tutteli.atrium.specs.integration.ZonedD property(Expect::dayOfWeek), fun1.() -> Unit>(Expect::dayOfWeek) ) { - @Suppress("unused") + @Suppress("unused", "UNUSED_VALUE") private fun ambiguityTest() { var a1: Expect = notImplemented() diff --git a/apis/infix/atrium-api-infix/src/commonMain/kotlin/ch/tutteli/atrium/api/infix/en_GB/documentationUtils.kt b/apis/infix/atrium-api-infix/src/commonMain/kotlin/ch/tutteli/atrium/api/infix/en_GB/documentationUtils.kt index 80e538ebdb..fe7c80bfd0 100644 --- a/apis/infix/atrium-api-infix/src/commonMain/kotlin/ch/tutteli/atrium/api/infix/en_GB/documentationUtils.kt +++ b/apis/infix/atrium-api-infix/src/commonMain/kotlin/ch/tutteli/atrium/api/infix/en_GB/documentationUtils.kt @@ -1,12 +1,10 @@ -//TODO 1.3.0 remove again and switch to core -@file:Suppress("DEPRECATION") - package ch.tutteli.atrium.api.infix.en_GB +import ch.tutteli.atrium._coreAppend import ch.tutteli.atrium.api.infix.en_GB.creating.KeyWithCreator import ch.tutteli.atrium.creating.Expect -import ch.tutteli.atrium.logic._logicAppend -import ch.tutteli.atrium.logic.because +import ch.tutteli.atrium.creating.proofs.because +import ch.tutteli.atrium.reporting.Text /** * Allows to state a reason for one or multiple assertions for the current subject. @@ -23,7 +21,7 @@ import ch.tutteli.atrium.logic.because * @since 1.2.0 */ fun Expect.because(reason: String, assertionCreator: Expect.() -> Unit): Expect = - _logicAppend { because(reason, assertionCreator) } + _coreAppend { because(Text(reason), assertionCreator) } /** * Allows to state a reason for one or multiple assertions for the current subject. @@ -38,7 +36,7 @@ fun Expect.because(reason: String, assertionCreator: Expect.() -> Unit * @since 0.15.0 */ infix fun Expect.because(keyWithCreator: KeyWithCreator): Expect = - _logicAppend { because(keyWithCreator.key, keyWithCreator.assertionCreator) } + _coreAppend { because(Text(keyWithCreator.key), keyWithCreator.assertionCreator) } /** * Helper function to create a [KeyWithCreator] based on the given [reason] and [assertionCreator]. diff --git a/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/AnyExpectationsSpec.kt b/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/AnyExpectationsSpec.kt index f31a6aca48..9b33930225 100644 --- a/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/AnyExpectationsSpec.kt +++ b/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/AnyExpectationsSpec.kt @@ -143,7 +143,7 @@ class AnyExpectationsSpec : ch.tutteli.atrium.specs.integration.AnyExpectationsS expect because of(reason) { assertionCreator() } } - @Suppress("unused") + @Suppress("unused", "UNUSED_VALUE") fun ambiguityTest() { val a1: Expect = notImplemented() val a1b: Expect = notImplemented() @@ -190,6 +190,6 @@ class AnyExpectationsSpec : ch.tutteli.atrium.specs.integration.AnyExpectationsS } //regression for #298, should compile without the need for E : Any or List - @Suppress("unused") + @Suppress("unused", "UNUSED_VALUE") fun Expect>.firstIs(value: E) = it get index(0) { it toEqual value } } diff --git a/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/ArrayAsListExpectationsSpec.kt b/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/ArrayAsListExpectationsSpec.kt index e20f1abfe9..821dffc0fb 100644 --- a/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/ArrayAsListExpectationsSpec.kt +++ b/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/ArrayAsListExpectationsSpec.kt @@ -57,7 +57,7 @@ class ArrayAsListExpectationsSpec : ch.tutteli.atrium.specs.integration.ArrayAsL expect asList { assertionCreator() } } - @Suppress("unused") + @Suppress("unused", "UNUSED_VALUE") private fun ambiguityTest() { var a1: Expect> = notImplemented() var a2: Expect> = notImplemented() diff --git a/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/CharSequenceExpectationsSpec.kt b/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/CharSequenceExpectationsSpec.kt index a5b0d27372..a3ab283234 100644 --- a/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/CharSequenceExpectationsSpec.kt +++ b/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/CharSequenceExpectationsSpec.kt @@ -21,7 +21,7 @@ class CharSequenceExpectationsSpec : ch.tutteli.atrium.specs.integration.CharSeq private fun notToBeBlank(expect: Expect) = expect notToBe blank } - @Suppress("unused") + @Suppress("unused", "UNUSED_VALUE") private fun ambiguityTest() { val a1: Expect = notImplemented() diff --git a/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/CharSequenceToContainNotToContainExpectationsSpec.kt b/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/CharSequenceToContainNotToContainExpectationsSpec.kt index 841516f2bd..45d68494a6 100644 --- a/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/CharSequenceToContainNotToContainExpectationsSpec.kt +++ b/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/CharSequenceToContainNotToContainExpectationsSpec.kt @@ -44,7 +44,7 @@ class CharSequenceToContainNotToContainExpectationsSpec : Spek({ else expect notToContain values(a, *aX) } - @Suppress("unused") + @Suppress("unused", "UNUSED_VALUE") private fun ambiguityTest() { val a1: Expect = notImplemented() diff --git a/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/CharSequenceToContainRegexExpectationsSpec.kt b/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/CharSequenceToContainRegexExpectationsSpec.kt index 6c16d4e056..153cd954d0 100644 --- a/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/CharSequenceToContainRegexExpectationsSpec.kt +++ b/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/CharSequenceToContainRegexExpectationsSpec.kt @@ -2,6 +2,7 @@ package ch.tutteli.atrium.api.infix.en_GB import ch.tutteli.atrium.api.verbs.internal.expect import ch.tutteli.atrium.creating.Expect +import ch.tutteli.atrium.specs.g import org.spekframework.spek2.Spek import org.spekframework.spek2.style.specification.describe @@ -17,8 +18,7 @@ class CharSequenceToContainRegexExpectationsSpec : Spek({ expect("aaaa") toContain o exactly 4 regex "aa?" } } - describe("context ''") { - val g = "🚩\uFE0F" + describe("context ''"){ it("search for '$g$g' finds 3 hits since we want non-disjoint matches") { expect("$g$g$g$g") toContain o exactly 3 regex "$g$g" } diff --git a/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/CharSequenceToContainSpecBase.kt b/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/CharSequenceToContainSpecBase.kt index 205684b6b9..d907c8dfa1 100644 --- a/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/CharSequenceToContainSpecBase.kt +++ b/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/CharSequenceToContainSpecBase.kt @@ -40,7 +40,7 @@ abstract class CharSequenceToContainSpecBase { protected val values = "the values" protected val elementsOf = CharSequenceContains.EntryPointStep::elementsOf.name - @Suppress("unused") + @Suppress("unused", "UNUSED_VALUE") private fun ambiguityTest() { val a1: Expect = notImplemented() diff --git a/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/CollectionExpectationsSpec.kt b/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/CollectionExpectationsSpec.kt index 7f945f3878..fc335c1546 100644 --- a/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/CollectionExpectationsSpec.kt +++ b/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/CollectionExpectationsSpec.kt @@ -15,7 +15,7 @@ class CollectionExpectationsSpec : ch.tutteli.atrium.specs.integration.Collectio } - @Suppress("unused") + @Suppress("unused", "UNUSED_VALUE") private fun ambiguityTest() { var a1: Expect> = notImplemented() var a1b: Expect> = notImplemented() diff --git a/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/ComparableExpectationsSpec.kt b/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/ComparableExpectationsSpec.kt index eec5f2d947..34166c38c5 100644 --- a/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/ComparableExpectationsSpec.kt +++ b/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/ComparableExpectationsSpec.kt @@ -39,7 +39,7 @@ class ComparableExpectationsSpec: Spek({ ){}) }) { - @Suppress("unused") + @Suppress("unused", "UNUSED_VALUE") fun ambiguityTest() { val a1: Expect = notImplemented() a1 toBeLessThan 1 diff --git a/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/ExtractSubjectSpec.kt b/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/ExtractSubjectSpec.kt index 29ceb94b6b..d887ad7a7a 100644 --- a/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/ExtractSubjectSpec.kt +++ b/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/ExtractSubjectSpec.kt @@ -32,7 +32,7 @@ class ExtractSubjectSpec : ch.tutteli.atrium.specs.integration.ExtractSubjectSpe } } - @Suppress("unused") + @Suppress("unused", "UNUSED_VALUE") private fun ambiguityTest() { val int: Expect = notImplemented() val nullableInt: Expect = notImplemented() diff --git a/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/FeatureExpectationsBoundedReferenceAlternativeSpec.kt b/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/FeatureExpectationsBoundedReferenceAlternativeSpec.kt index 386875fa56..04cbd9700b 100644 --- a/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/FeatureExpectationsBoundedReferenceAlternativeSpec.kt +++ b/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/FeatureExpectationsBoundedReferenceAlternativeSpec.kt @@ -106,7 +106,7 @@ class FeatureExpectationsBoundedReferenceAlternativeSpec : ch.tutteli.atrium.spe { its feature (of({ f5(it::return5, "a", 1, true, 1.2, 'b') }) {}) } } - @Suppress("unused") + @Suppress("unused", "UNUSED_VALUE") private fun ambiguityTest() { val a1: Expect> = notImplemented() val a1b: Expect> = notImplemented() diff --git a/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/FeatureExpectationsBoundedReferenceSpec.kt b/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/FeatureExpectationsBoundedReferenceSpec.kt index 252b8b2a16..6e1aa360b0 100644 --- a/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/FeatureExpectationsBoundedReferenceSpec.kt +++ b/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/FeatureExpectationsBoundedReferenceSpec.kt @@ -108,7 +108,7 @@ class FeatureExpectationsBoundedReferenceSpec : ch.tutteli.atrium.specs.integrat { it feature of({ f(it::return5, "a", 1, true, 1.2, 'b') }) {} } } - @Suppress("unused") + @Suppress("unused", "UNUSED_VALUE") private fun ambiguityTest() { val a1: Expect> = notImplemented() val a1b: Expect> = notImplemented() diff --git a/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/FeatureExpectationsClassReferenceSpec.kt b/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/FeatureExpectationsClassReferenceSpec.kt index 74651240ea..b783fd4432 100644 --- a/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/FeatureExpectationsClassReferenceSpec.kt +++ b/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/FeatureExpectationsClassReferenceSpec.kt @@ -105,7 +105,7 @@ class FeatureExpectationsClassReferenceSpec : ch.tutteli.atrium.specs.integratio val f5EmptyAssertionCreator: F = { its feature of(TestData::return5, "a", 1, true, 1.2, 'b') {} } } - @Suppress("unused") + @Suppress("unused", "UNUSED_VALUE") private fun ambiguityTest() { val a1: Expect> = notImplemented() val a1b: Expect> = notImplemented() diff --git a/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/IterableExpectationsSpec.kt b/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/IterableExpectationsSpec.kt index ca8defaf05..95b0d6ca7d 100644 --- a/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/IterableExpectationsSpec.kt +++ b/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/IterableExpectationsSpec.kt @@ -44,7 +44,7 @@ class IterableExpectationsSpec : ch.tutteli.atrium.specs.integration.IterableExp private fun lastFeature(expect: Expect>) = expect last o } - @Suppress("unused") + @Suppress("unused", "UNUSED_VALUE") private fun ambiguityTest() { var a1: Expect> = notImplemented() var a1b: Expect> = notImplemented() diff --git a/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/IterableNotToHaveElementsOrAllExpectationsSpec.kt b/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/IterableNotToHaveElementsOrAllExpectationsSpec.kt index eccf206d3f..a14cdeaeca 100644 --- a/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/IterableNotToHaveElementsOrAllExpectationsSpec.kt +++ b/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/IterableNotToHaveElementsOrAllExpectationsSpec.kt @@ -10,7 +10,7 @@ class IterableNotToHaveElementsOrAllExpectationsSpec : ch.tutteli.atrium.specs.i fun1(Expect>::notToHaveElementsOrAll).withNullableSuffix() ) { - @Suppress("unused") + @Suppress("unused", "UNUSED_VALUE") private fun ambiguityTest() { var list: Expect> = notImplemented() var nList: Expect> = notImplemented() diff --git a/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/IterableNotToHaveElementsOrAnyExpectationsSpec.kt b/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/IterableNotToHaveElementsOrAnyExpectationsSpec.kt index 96c8d1c6e9..ae8fb3e961 100644 --- a/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/IterableNotToHaveElementsOrAnyExpectationsSpec.kt +++ b/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/IterableNotToHaveElementsOrAnyExpectationsSpec.kt @@ -10,7 +10,7 @@ class IterableNotToHaveElementsOrAnyExpectationsSpec : ch.tutteli.atrium.specs.i fun1(Expect>::notToHaveElementsOrAny).withNullableSuffix() ) { - @Suppress("unused") + @Suppress("unused", "UNUSED_VALUE") private fun ambiguityTest() { var list: Expect> = notImplemented() var nList: Expect> = notImplemented() diff --git a/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/IterableNotToHaveElementsOrNoneExpectationsSpec.kt b/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/IterableNotToHaveElementsOrNoneExpectationsSpec.kt index 22629671c7..669e6c3f75 100644 --- a/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/IterableNotToHaveElementsOrNoneExpectationsSpec.kt +++ b/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/IterableNotToHaveElementsOrNoneExpectationsSpec.kt @@ -11,7 +11,7 @@ class IterableNotToHaveElementsOrNoneExpectationsSpec : fun1(Expect>::notToHaveElementsOrNone).withNullableSuffix() ) { - @Suppress("unused") + @Suppress("unused", "UNUSED_VALUE") private fun ambiguityTest() { var list: Expect> = notImplemented() var nList: Expect> = notImplemented() diff --git a/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/IterableToContainInAnyOrderAtLeast1ElementsOfExpectationsSpec.kt b/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/IterableToContainInAnyOrderAtLeast1ElementsOfExpectationsSpec.kt index 6fe2c613a4..72f764e7d5 100644 --- a/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/IterableToContainInAnyOrderAtLeast1ElementsOfExpectationsSpec.kt +++ b/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/IterableToContainInAnyOrderAtLeast1ElementsOfExpectationsSpec.kt @@ -78,7 +78,7 @@ class IterableToContainInAnyOrderAtLeast1ElementsOfExpectationsSpec : Spek({ } - @Suppress("unused") + @Suppress("unused", "UNUSED_VALUE") private fun ambiguityTest() { var list: Expect> = notImplemented() var nList: Expect> = notImplemented() diff --git a/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/IterableToContainInAnyOrderAtLeast1EntriesExpectationsSpec.kt b/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/IterableToContainInAnyOrderAtLeast1EntriesExpectationsSpec.kt index 5df58323a8..76d79670fd 100644 --- a/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/IterableToContainInAnyOrderAtLeast1EntriesExpectationsSpec.kt +++ b/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/IterableToContainInAnyOrderAtLeast1EntriesExpectationsSpec.kt @@ -73,7 +73,7 @@ class IterableToContainInAnyOrderAtLeast1EntriesExpectationsSpec : Spek({ } - @Suppress("unused") + @Suppress("unused", "UNUSED_VALUE") private fun ambiguityTest() { var list: Expect> = notImplemented() var nList: Expect> = notImplemented() diff --git a/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/IterableToContainInAnyOrderAtLeast1ValuesExpectationsSpec.kt b/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/IterableToContainInAnyOrderAtLeast1ValuesExpectationsSpec.kt index 88abf18792..21e46931ee 100644 --- a/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/IterableToContainInAnyOrderAtLeast1ValuesExpectationsSpec.kt +++ b/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/IterableToContainInAnyOrderAtLeast1ValuesExpectationsSpec.kt @@ -73,7 +73,7 @@ class IterableToContainInAnyOrderAtLeast1ValuesExpectationsSpec : Spek({ else expect toContain values(a, *aX) } - @Suppress("unused") + @Suppress("unused", "UNUSED_VALUE") private fun ambiguityTest() { var list: Expect> = notImplemented() var nList: Expect> = notImplemented() diff --git a/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/IterableToContainInAnyOrderAtMostValuesExpectationsSpec.kt b/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/IterableToContainInAnyOrderAtMostValuesExpectationsSpec.kt index d09c5986d5..3b477ce7fb 100644 --- a/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/IterableToContainInAnyOrderAtMostValuesExpectationsSpec.kt +++ b/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/IterableToContainInAnyOrderAtMostValuesExpectationsSpec.kt @@ -31,7 +31,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> = notImplemented() var nList: Expect> = notImplemented() diff --git a/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/IterableToContainInAnyOrderExactlyValuesExpectationsSpec.kt b/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/IterableToContainInAnyOrderExactlyValuesExpectationsSpec.kt index 4264b21e13..688302a059 100644 --- a/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/IterableToContainInAnyOrderExactlyValuesExpectationsSpec.kt +++ b/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/IterableToContainInAnyOrderExactlyValuesExpectationsSpec.kt @@ -30,7 +30,7 @@ class IterableToContainInAnyOrderExactlyValuesExpectationsSpec : } - @Suppress("unused") + @Suppress("unused", "UNUSED_VALUE") private fun ambiguityTest() { var list: Expect> = notImplemented() var nList: Expect> = notImplemented() diff --git a/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/IterableToContainInAnyOrderNotOrAtMostValuesExpectationsSpec.kt b/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/IterableToContainInAnyOrderNotOrAtMostValuesExpectationsSpec.kt index 950ddf37af..0f8719e99a 100644 --- a/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/IterableToContainInAnyOrderNotOrAtMostValuesExpectationsSpec.kt +++ b/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/IterableToContainInAnyOrderNotOrAtMostValuesExpectationsSpec.kt @@ -29,7 +29,7 @@ class IterableToContainInAnyOrderNotOrAtMostValuesExpectationsSpec : private fun getErrorMsgNotToContain(times: Int) = "use `$notToContain` instead of `$notOrAtMost $times`" } - @Suppress("unused") + @Suppress("unused", "UNUSED_VALUE") private fun ambiguityTest() { var list: Expect> = notImplemented() var nList: Expect> = notImplemented() diff --git a/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/IterableToContainInAnyOrderOnlyElementsOfExpectationsSpec.kt b/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/IterableToContainInAnyOrderOnlyElementsOfExpectationsSpec.kt index 638adfc9ec..e2920ab9bd 100644 --- a/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/IterableToContainInAnyOrderOnlyElementsOfExpectationsSpec.kt +++ b/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/IterableToContainInAnyOrderOnlyElementsOfExpectationsSpec.kt @@ -61,7 +61,7 @@ class IterableToContainInAnyOrderOnlyElementsOfExpectationsSpec : Spek({ } - @Suppress("unused") + @Suppress("unused", "UNUSED_VALUE") private fun ambiguityTest() { var list: Expect> = notImplemented() var nList: Expect> = notImplemented() diff --git a/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/IterableToContainInAnyOrderOnlyEntriesExpectationsSpec.kt b/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/IterableToContainInAnyOrderOnlyEntriesExpectationsSpec.kt index 5d22f3500b..82b0d6a215 100644 --- a/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/IterableToContainInAnyOrderOnlyEntriesExpectationsSpec.kt +++ b/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/IterableToContainInAnyOrderOnlyEntriesExpectationsSpec.kt @@ -42,7 +42,7 @@ class IterableToContainInAnyOrderOnlyEntriesExpectationsSpec : } else expect toContain o inAny order but only the entries(a, *aX, reportOptionsInAnyOrderOnly = report) } - @Suppress("unused") + @Suppress("unused", "UNUSED_VALUE") private fun ambiguityTest() { var list: Expect> = notImplemented() var nList: Expect> = notImplemented() diff --git a/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/IterableToContainInAnyOrderOnlyValuesExpectationsSpec.kt b/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/IterableToContainInAnyOrderOnlyValuesExpectationsSpec.kt index 8f7f3c6e58..237d8b40ee 100644 --- a/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/IterableToContainInAnyOrderOnlyValuesExpectationsSpec.kt +++ b/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/IterableToContainInAnyOrderOnlyValuesExpectationsSpec.kt @@ -42,7 +42,7 @@ class IterableToContainInAnyOrderOnlyValuesExpectationsSpec : } - @Suppress("unused") + @Suppress("unused", "UNUSED_VALUE") private fun ambiguityTest() { var list: Expect> = notImplemented() var nList: Expect> = notImplemented() diff --git a/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/IterableToContainInOrderOnlyElementsOfExpectationsSpec.kt b/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/IterableToContainInOrderOnlyElementsOfExpectationsSpec.kt index 2c1b54faed..2fdd8ecfe4 100644 --- a/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/IterableToContainInOrderOnlyElementsOfExpectationsSpec.kt +++ b/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/IterableToContainInOrderOnlyElementsOfExpectationsSpec.kt @@ -97,7 +97,7 @@ class IterableToContainInOrderOnlyElementsOfExpectationsSpec : Spek({ } - @Suppress("unused") + @Suppress("unused", "UNUSED_VALUE") private fun ambiguityTest() { var list: Expect> = notImplemented() var nList: Expect> = notImplemented() diff --git a/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/IterableToContainInOrderOnlyEntriesExpectationsSpec.kt b/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/IterableToContainInOrderOnlyEntriesExpectationsSpec.kt index 29b3a8d19e..13281a4bab 100644 --- a/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/IterableToContainInOrderOnlyEntriesExpectationsSpec.kt +++ b/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/IterableToContainInOrderOnlyEntriesExpectationsSpec.kt @@ -91,7 +91,7 @@ class IterableToContainInOrderOnlyEntriesExpectationsSpec : Spek({ } else expect toContainExactly entries(a, *aX, reportOptionsInOrderOnly = report) } - @Suppress("unused") + @Suppress("unused", "UNUSED_VALUE") private fun ambiguityTest() { var list: Expect> = notImplemented() var nList: Expect> = notImplemented() diff --git a/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/IterableToContainInOrderOnlyGroupedEntriesExpectationsSpec.kt b/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/IterableToContainInOrderOnlyGroupedEntriesExpectationsSpec.kt index e2bb77e2e9..b2ffc8fc8a 100644 --- a/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/IterableToContainInOrderOnlyGroupedEntriesExpectationsSpec.kt +++ b/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/IterableToContainInOrderOnlyGroupedEntriesExpectationsSpec.kt @@ -55,7 +55,7 @@ class IterableToContainInOrderOnlyGroupedEntriesExpectationsSpec : } - @Suppress("unused") + @Suppress("unused", "UNUSED_VARIABLE", "UNUSED_VALUE") private fun ambiguityTest() { var list: Expect> = notImplemented() var nList: Expect> = notImplemented() diff --git a/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/IterableToContainInOrderOnlyGroupedValuesExpectationsSpec.kt b/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/IterableToContainInOrderOnlyGroupedValuesExpectationsSpec.kt index ab18b52c6c..6bbfd1a132 100644 --- a/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/IterableToContainInOrderOnlyGroupedValuesExpectationsSpec.kt +++ b/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/IterableToContainInOrderOnlyGroupedValuesExpectationsSpec.kt @@ -88,7 +88,7 @@ class IterableToContainInOrderOnlyGroupedValuesExpectationsSpec : } } - @Suppress("unused") + @Suppress("unused", "UNUSED_VALUE") private fun ambiguityTest() { var list: Expect> = notImplemented() var nList: Expect> = notImplemented() diff --git a/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/IterableToContainInOrderOnlyValuesExpectationsSpec.kt b/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/IterableToContainInOrderOnlyValuesExpectationsSpec.kt index 252da5b556..9b6b8ff3e1 100644 --- a/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/IterableToContainInOrderOnlyValuesExpectationsSpec.kt +++ b/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/IterableToContainInOrderOnlyValuesExpectationsSpec.kt @@ -88,7 +88,7 @@ class IterableToContainInOrderOnlyValuesExpectationsSpec : Spek({ } else expect toContainExactly values(a, *aX, reportOptionsInOrderOnly = report) } - @Suppress("unused") + @Suppress("unused", "UNUSED_VALUE") private fun ambiguityTest() { var list: Expect> = notImplemented() var nList: Expect> = notImplemented() diff --git a/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/IterableToContainSpecBase.kt b/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/IterableToContainSpecBase.kt index d96cead3dc..eec1ea9b95 100644 --- a/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/IterableToContainSpecBase.kt +++ b/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/IterableToContainSpecBase.kt @@ -70,7 +70,7 @@ abstract class IterableToContainSpecBase { protected val notToContain = "${notToContainProp.name} $Values" //TODO move to specific specs - @Suppress("unused") + @Suppress("unused", "UNUSED_VALUE") private fun ambiguityTest() { val list: Expect> = notImplemented() val nullableList: Expect> = notImplemented() diff --git a/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/IterableToHaveElementsAndAllExpectationsSpec.kt b/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/IterableToHaveElementsAndAllExpectationsSpec.kt index 77579a5b06..7be83ef9bb 100644 --- a/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/IterableToHaveElementsAndAllExpectationsSpec.kt +++ b/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/IterableToHaveElementsAndAllExpectationsSpec.kt @@ -10,7 +10,7 @@ class IterableToHaveElementsAndAllExpectationsSpec : ch.tutteli.atrium.specs.int fun1(Expect>::toHaveElementsAndAll).withNullableSuffix() ) { - @Suppress("unused") + @Suppress("unused", "UNUSED_VALUE") private fun ambiguityTest() { var list: Expect> = notImplemented() var nList: Expect> = notImplemented() diff --git a/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/IterableToHaveElementsAndAnyExpectationsSpec.kt b/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/IterableToHaveElementsAndAnyExpectationsSpec.kt index b92855ab7a..e6abda770d 100644 --- a/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/IterableToHaveElementsAndAnyExpectationsSpec.kt +++ b/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/IterableToHaveElementsAndAnyExpectationsSpec.kt @@ -1,5 +1,6 @@ package ch.tutteli.atrium.api.infix.en_GB +import ch.tutteli.atrium._core import ch.tutteli.atrium.creating.Expect import ch.tutteli.atrium.logic._logic import ch.tutteli.atrium.logic.changeSubject @@ -76,7 +77,7 @@ class IterableToHaveElementsAndAnyExpectationsSpec : Spek({ "asSequence().${Sequence<*>::asIterable.name}() ${toContainShortcutFun.name}" to Companion::toContainInAnyOrderEntrySequence private fun toContainInAnyOrderEntrySequence(expect: Expect>, a: Expect.() -> Unit) = - expect._logic.changeSubject.unreported { it.asSequence() } asIterable o toContain a + expect._core.changeSubject.unreported { it.asSequence() } asIterable o toContain a fun getToContainNullableSequencePair() = "asSequence().${Sequence<*>::asIterable.name}() ${toContainShortcutNullableFun.name}" to Companion::toContainNullableEntrySequence @@ -84,10 +85,10 @@ class IterableToHaveElementsAndAnyExpectationsSpec : Spek({ private fun toContainNullableEntrySequence( expect: Expect>, a: (Expect.() -> Unit)? - ) = expect._logic.changeSubject.unreported { it.asSequence() } asIterable { it toContain a } asIterable o + ) = expect._core.changeSubject.unreported { it.asSequence() } asIterable { it toContain a } asIterable o } - @Suppress("unused") + @Suppress("unused", "UNUSED_VALUE") private fun ambiguityTest() { var list: Expect> = notImplemented() var nList: Expect> = notImplemented() diff --git a/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/IterableToHaveElementsAndNoneExpectationsSpec.kt b/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/IterableToHaveElementsAndNoneExpectationsSpec.kt index 34a99adfaf..acba206bb1 100644 --- a/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/IterableToHaveElementsAndNoneExpectationsSpec.kt +++ b/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/IterableToHaveElementsAndNoneExpectationsSpec.kt @@ -13,12 +13,14 @@ class IterableToHaveElementsAndNoneExpectationsSpec : Spek({ object PredicateSpec : ch.tutteli.atrium.specs.integration.IterableToHaveElementsAndNoneExpectationsSpec( fun1(Expect>::toHaveElementsAndNone), fun1(Expect>::toHaveElementsAndNone).withNullableSuffix(), + Expect>::notToHaveElementsOrNone.name, "[Atrium][Predicate] " ) object BuilderSpec : ch.tutteli.atrium.specs.integration.IterableToHaveElementsAndNoneExpectationsSpec( getNotToContainPair(), getNotToContainNullablePair().withNullableSuffix(), + Expect>::notToHaveElementsOrNone.name, "[Atrium][Builder] " ) @@ -35,7 +37,7 @@ class IterableToHaveElementsAndNoneExpectationsSpec : Spek({ expect notToContain o entry a } - @Suppress("unused") + @Suppress("unused", "UNUSED_VALUE") private fun ambiguityTest() { var list: Expect> = notImplemented() var nList: Expect> = notImplemented() diff --git a/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/ListExpectationsSpec.kt b/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/ListExpectationsSpec.kt index 264c54a68f..b996a5e88c 100644 --- a/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/ListExpectationsSpec.kt +++ b/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/ListExpectationsSpec.kt @@ -73,7 +73,7 @@ class ListExpectationsSpec : Spek({ } - @Suppress("unused") + @Suppress("unused", "UNUSED_VALUE") private fun ambiguityTest() { var a1: Expect> = notImplemented() var a1b: Expect> = notImplemented() diff --git a/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/MapAsEntriesExpectationsSpec.kt b/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/MapAsEntriesExpectationsSpec.kt index 87a1ffc768..a7cd4284aa 100644 --- a/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/MapAsEntriesExpectationsSpec.kt +++ b/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/MapAsEntriesExpectationsSpec.kt @@ -18,7 +18,7 @@ class MapAsEntriesExpectationsSpec : ch.tutteli.atrium.specs.integration.MapAsEn fun asEntriesFeature(expect: Expect>) = expect asEntries o } - @Suppress("unused") + @Suppress("unused", "UNUSED_VALUE") private fun ambiguityTest() { var map: Expect> = notImplemented() var subMap: Expect> = notImplemented() diff --git a/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/MapEntryExpectationsSpec.kt b/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/MapEntryExpectationsSpec.kt index c9ed4eb0c3..ce66eb5d77 100644 --- a/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/MapEntryExpectationsSpec.kt +++ b/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/MapEntryExpectationsSpec.kt @@ -24,7 +24,7 @@ class MapEntryExpectationsSpec : ch.tutteli.atrium.specs.integration.MapEntryExp expect toEqualKeyValue (key to value) } - @Suppress("unused") + @Suppress("unused", "UNUSED_VALUE") private fun ambiguityTest() { var a1: Expect> = notImplemented() var a2: Expect> = notImplemented() diff --git a/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/MapExpectationsSpec.kt b/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/MapExpectationsSpec.kt index d82c7b3d58..829023c7db 100644 --- a/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/MapExpectationsSpec.kt +++ b/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/MapExpectationsSpec.kt @@ -54,7 +54,7 @@ class MapExpectationsSpec : ch.tutteli.atrium.specs.integration.MapExpectationsS } - @Suppress("unused") + @Suppress("unused", "UNUSED_VALUE") private fun ambiguityTest() { var map: Expect> = notImplemented() var subMap: Expect> = notImplemented() diff --git a/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/MapToContainInAnyOrderEntriesOfExpectationsSpec.kt b/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/MapToContainInAnyOrderEntriesOfExpectationsSpec.kt index b8b844768c..e7f527168f 100644 --- a/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/MapToContainInAnyOrderEntriesOfExpectationsSpec.kt +++ b/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/MapToContainInAnyOrderEntriesOfExpectationsSpec.kt @@ -79,7 +79,7 @@ class MapToContainInAnyOrderEntriesOfExpectationsSpec : Spek({ expect toContainEntriesOf arrayOf(a, *aX) } - @Suppress("unused") + @Suppress("unused", "UNUSED_VALUE") private fun ambiguityTest() { var map: Expect> = notImplemented() var subMap: Expect> = notImplemented() diff --git a/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/MapToContainInAnyOrderKeyValueExpectationsSpec.kt b/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/MapToContainInAnyOrderKeyValueExpectationsSpec.kt index b675b674e9..523e75683b 100644 --- a/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/MapToContainInAnyOrderKeyValueExpectationsSpec.kt +++ b/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/MapToContainInAnyOrderKeyValueExpectationsSpec.kt @@ -70,7 +70,7 @@ class MapToContainInAnyOrderKeyValueExpectationsSpec : Spek({ } - @Suppress("unused") + @Suppress("unused", "UNUSED_VALUE") private fun ambiguityTest() { var map: Expect> = notImplemented() var subMap: Expect> = notImplemented() diff --git a/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/MapToContainInAnyOrderKeyValuePairsExpectationsSpec.kt b/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/MapToContainInAnyOrderKeyValuePairsExpectationsSpec.kt index 52631ca563..6fa5cb27b6 100644 --- a/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/MapToContainInAnyOrderKeyValuePairsExpectationsSpec.kt +++ b/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/MapToContainInAnyOrderKeyValuePairsExpectationsSpec.kt @@ -60,7 +60,7 @@ class MapToContainInAnyOrderKeyValuePairsExpectationsSpec : Spek({ else expect toContain pairs(a, *aX) } - @Suppress("unused") + @Suppress("unused", "UNUSED_VALUE") private fun ambiguityTest() { var map: Expect> = notImplemented() var subMap: Expect> = notImplemented() diff --git a/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/MapToContainInAnyOrderOnlyEntriesOfExpectationsSpec.kt b/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/MapToContainInAnyOrderOnlyEntriesOfExpectationsSpec.kt index 0f6c0ed919..0ece5e63fc 100644 --- a/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/MapToContainInAnyOrderOnlyEntriesOfExpectationsSpec.kt +++ b/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/MapToContainInAnyOrderOnlyEntriesOfExpectationsSpec.kt @@ -80,7 +80,7 @@ class MapToContainInAnyOrderOnlyEntriesOfExpectationsSpec : Spek({ expect toContainOnlyEntriesOf arrayOf(a, *aX) } - @Suppress("unused") + @Suppress("unused", "UNUSED_VALUE") private fun ambiguityTest() { var map: Expect> = notImplemented() var subMap: Expect> = notImplemented() diff --git a/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/MapToContainInAnyOrderOnlyKeyValueExpectationsSpec.kt b/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/MapToContainInAnyOrderOnlyKeyValueExpectationsSpec.kt index eea731432c..bf5c6d2270 100644 --- a/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/MapToContainInAnyOrderOnlyKeyValueExpectationsSpec.kt +++ b/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/MapToContainInAnyOrderOnlyKeyValueExpectationsSpec.kt @@ -66,7 +66,7 @@ class MapToContainInAnyOrderOnlyKeyValueExpectationsSpec : Spek({ } } - @Suppress("unused") + @Suppress("unused", "UNUSED_VALUE") private fun ambiguityTest() { var map: Expect> = notImplemented() var subMap: Expect> = notImplemented() diff --git a/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/MapToContainInAnyOrderOnlyKeyValuePairsExpectationsSpec.kt b/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/MapToContainInAnyOrderOnlyKeyValuePairsExpectationsSpec.kt index ec6526ba7a..9c11665b73 100644 --- a/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/MapToContainInAnyOrderOnlyKeyValuePairsExpectationsSpec.kt +++ b/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/MapToContainInAnyOrderOnlyKeyValuePairsExpectationsSpec.kt @@ -61,7 +61,7 @@ class MapToContainInAnyOrderOnlyKeyValuePairsExpectationsSpec : Spek({ else expect toContainOnly pairs(a, *aX) } - @Suppress("unused") + @Suppress("unused", "UNUSED_VALUE") private fun ambiguityTest() { var map: Expect> = notImplemented() var subMap: Expect> = notImplemented() diff --git a/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/MapToContainInOrderOnlyEntriesOfExpectationsSpec.kt b/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/MapToContainInOrderOnlyEntriesOfExpectationsSpec.kt index 109b0c024f..9427a00c63 100644 --- a/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/MapToContainInOrderOnlyEntriesOfExpectationsSpec.kt +++ b/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/MapToContainInOrderOnlyEntriesOfExpectationsSpec.kt @@ -60,7 +60,7 @@ class MapToContainInOrderOnlyEntriesOfExpectationsSpec : Spek({ ) } - @Suppress("unused") + @Suppress("unused", "UNUSED_VALUE") private fun ambiguityTest() { var map: Expect> = notImplemented() var subMap: Expect> = notImplemented() diff --git a/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/MapToContainInOrderOnlyKeyValueExpectationsSpec.kt b/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/MapToContainInOrderOnlyKeyValueExpectationsSpec.kt index d1560c3d2b..7fad08f89c 100644 --- a/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/MapToContainInOrderOnlyKeyValueExpectationsSpec.kt +++ b/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/MapToContainInOrderOnlyKeyValueExpectationsSpec.kt @@ -54,7 +54,7 @@ class MapToContainInOrderOnlyKeyValueExpectationsSpec : Spek({ } } - @Suppress("unused") + @Suppress("unused", "UNUSED_VALUE") private fun ambiguityTest() { var map: Expect> = notImplemented() var subMap: Expect> = notImplemented() diff --git a/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/MapToContainInOrderOnlyKeyValuePairsExpectationsSpec.kt b/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/MapToContainInOrderOnlyKeyValuePairsExpectationsSpec.kt index fd571e4b44..4f4024f0a8 100644 --- a/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/MapToContainInOrderOnlyKeyValuePairsExpectationsSpec.kt +++ b/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/MapToContainInOrderOnlyKeyValuePairsExpectationsSpec.kt @@ -45,7 +45,7 @@ class MapToContainInOrderOnlyKeyValuePairsExpectationsSpec : Spek({ } - @Suppress("unused") + @Suppress("unused", "UNUSED_VALUE") private fun ambiguityTest() { var map: Expect> = notImplemented() var subMap: Expect> = notImplemented() diff --git a/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/PairExpectationsSpec.kt b/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/PairExpectationsSpec.kt index 7ff759b132..a5c6fd062d 100644 --- a/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/PairExpectationsSpec.kt +++ b/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/PairExpectationsSpec.kt @@ -16,7 +16,7 @@ class PairExpectationsSpec : ch.tutteli.atrium.specs.integration.PairExpectation fun1, Expect.() -> Unit>(Expect>::second) ) { - @Suppress("unused") + @Suppress("unused", "UNUSED_VALUE") private fun ambiguityTest() { var a1: Expect> = notImplemented() var a2: Expect> = notImplemented() diff --git a/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/ThirdPartyExpectationsSpec.kt b/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/ThirdPartyExpectationsSpec.kt index 2672ff099a..5df1a86541 100644 --- a/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/ThirdPartyExpectationsSpec.kt +++ b/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/ThirdPartyExpectationsSpec.kt @@ -18,7 +18,7 @@ class ThirdPartyExpectationsSpec : ch.tutteli.atrium.specs.integration.ThirdPart ): Expect = expect toHold thirdPartyExpectation(description, representation, expectationExecutor) } - @Suppress("unused") + @Suppress("unused", "UNUSED_VALUE") private fun ambiguityTest() { val int: Expect = notImplemented() val nullableInt: Expect = notImplemented() diff --git a/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/ThrowableExpectationsSpec.kt b/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/ThrowableExpectationsSpec.kt index 4ac025fa26..5a346fd2b3 100644 --- a/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/ThrowableExpectationsSpec.kt +++ b/apis/infix/atrium-api-infix/src/commonTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/ThrowableExpectationsSpec.kt @@ -35,7 +35,7 @@ class ThrowableExpectationsSpec : ch.tutteli.atrium.specs.integration.ThrowableE ) = expect.cause(assertionCreator) } - @Suppress("unused") + @Suppress("unused", "UNUSED_VALUE") private fun ambiguityTest() { var a1: Expect = notImplemented() diff --git a/apis/infix/atrium-api-infix/src/jvmTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/ChronoLocalDateExpectationsSpec.kt b/apis/infix/atrium-api-infix/src/jvmTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/ChronoLocalDateExpectationsSpec.kt index 4b7fc09c91..c2ad0a6f28 100644 --- a/apis/infix/atrium-api-infix/src/jvmTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/ChronoLocalDateExpectationsSpec.kt +++ b/apis/infix/atrium-api-infix/src/jvmTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/ChronoLocalDateExpectationsSpec.kt @@ -28,7 +28,7 @@ class ChronoLocalDateExpectationsSpec : Spek({ fun1(Expect::toBeTheSamePointInTimeAs) ) - @Suppress("unused") + @Suppress("unused", "UNUSED_VALUE") private fun ambiguityTest() { val chronoLocalDate: ChronoLocalDate = notImplemented() var a1: Expect = notImplemented() diff --git a/apis/infix/atrium-api-infix/src/jvmTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/ChronoLocalDateTimeExpectationsSpec.kt b/apis/infix/atrium-api-infix/src/jvmTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/ChronoLocalDateTimeExpectationsSpec.kt index 4ef9e6f813..45fd1f7532 100644 --- a/apis/infix/atrium-api-infix/src/jvmTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/ChronoLocalDateTimeExpectationsSpec.kt +++ b/apis/infix/atrium-api-infix/src/jvmTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/ChronoLocalDateTimeExpectationsSpec.kt @@ -30,7 +30,7 @@ class ChronoLocalDateTimeExpectationsSpec : Spek({ fun1, String>(Expect>::toBeTheSamePointInTimeAs) ) - @Suppress("unused") + @Suppress("unused", "UNUSED_VALUE") private fun ambiguityTest() { val chronoLocalDateTime: ChronoLocalDateTime<*> = notImplemented() var a1: Expect> = notImplemented() diff --git a/apis/infix/atrium-api-infix/src/jvmTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/ChronoZonedDateTimeExpectationsSpec.kt b/apis/infix/atrium-api-infix/src/jvmTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/ChronoZonedDateTimeExpectationsSpec.kt index 41e47431ea..fffee23ccb 100644 --- a/apis/infix/atrium-api-infix/src/jvmTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/ChronoZonedDateTimeExpectationsSpec.kt +++ b/apis/infix/atrium-api-infix/src/jvmTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/ChronoZonedDateTimeExpectationsSpec.kt @@ -31,7 +31,7 @@ class ChronoZonedDateTimeExpectationsSpec : Spek({ fun1, String>(Expect>::toBeTheSamePointInTimeAs) ) - @Suppress("unused") + @Suppress("unused", "UNUSED_VALUE") private fun ambiguityTest() { val chronoZonedDateTime: ChronoZonedDateTime<*> = notImplemented() var a1: Expect> = notImplemented() diff --git a/apis/infix/atrium-api-infix/src/jvmTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/DateAsLocalDateExpectionsSpec.kt b/apis/infix/atrium-api-infix/src/jvmTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/DateAsLocalDateExpectionsSpec.kt index 8f9ef82e9b..f87ed9376b 100644 --- a/apis/infix/atrium-api-infix/src/jvmTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/DateAsLocalDateExpectionsSpec.kt +++ b/apis/infix/atrium-api-infix/src/jvmTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/DateAsLocalDateExpectionsSpec.kt @@ -8,7 +8,7 @@ import java.util.Date class DateAsLocalDateExpectionsSpec : DateAsLocalDateExpectationsSpec( Expect::asLocalDate ) { - @Suppress("unused") + @Suppress("unused", "UNUSED_VALUE") private fun ambiguityTest() { var date: Expect = notImplemented() diff --git a/apis/infix/atrium-api-infix/src/jvmTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/DateAsLocalDateTimeExpectionsSpec.kt b/apis/infix/atrium-api-infix/src/jvmTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/DateAsLocalDateTimeExpectionsSpec.kt index 37ca765bf3..6a15e3b543 100644 --- a/apis/infix/atrium-api-infix/src/jvmTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/DateAsLocalDateTimeExpectionsSpec.kt +++ b/apis/infix/atrium-api-infix/src/jvmTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/DateAsLocalDateTimeExpectionsSpec.kt @@ -8,7 +8,7 @@ import java.util.Date class DateAsLocalDateTimeExpectationsSpec : DateAsLocalDateTimeExpectationsSpec( Expect::asLocalDateTime ){ - @Suppress("unused") + @Suppress("unused", "UNUSED_VALUE") private fun ambiguityTest() { var date: Expect = notImplemented() diff --git a/apis/infix/atrium-api-infix/src/jvmTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/FileAsPathExpectationsSpec.kt b/apis/infix/atrium-api-infix/src/jvmTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/FileAsPathExpectationsSpec.kt index 4c0612040f..ff7fc30124 100644 --- a/apis/infix/atrium-api-infix/src/jvmTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/FileAsPathExpectationsSpec.kt +++ b/apis/infix/atrium-api-infix/src/jvmTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/FileAsPathExpectationsSpec.kt @@ -8,7 +8,7 @@ class FileAsPathExpectationsSpec : ch.tutteli.atrium.specs.integration.FileAsPat Expect::asPath ) { - @Suppress("unused") + @Suppress("unused", "UNUSED_VALUE") private fun ambiguityTest() { var a1: Expect = notImplemented() diff --git a/apis/infix/atrium-api-infix/src/jvmTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/LocalDateExpectationsSpec.kt b/apis/infix/atrium-api-infix/src/jvmTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/LocalDateExpectationsSpec.kt index 1b0d85e9ff..f0bd8c966d 100644 --- a/apis/infix/atrium-api-infix/src/jvmTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/LocalDateExpectationsSpec.kt +++ b/apis/infix/atrium-api-infix/src/jvmTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/LocalDateExpectationsSpec.kt @@ -18,7 +18,7 @@ class LocalDateExpectationsSpec : ch.tutteli.atrium.specs.integration.LocalDateE fun1.() -> Unit>(Expect::dayOfWeek) ) { - @Suppress("unused") + @Suppress("unused", "UNUSED_VALUE") private fun ambiguityTest() { var a1: Expect = notImplemented() diff --git a/apis/infix/atrium-api-infix/src/jvmTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/LocalDateTimeExpectationsSpec.kt b/apis/infix/atrium-api-infix/src/jvmTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/LocalDateTimeExpectationsSpec.kt index a34f730db1..e4fe17ff68 100644 --- a/apis/infix/atrium-api-infix/src/jvmTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/LocalDateTimeExpectationsSpec.kt +++ b/apis/infix/atrium-api-infix/src/jvmTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/LocalDateTimeExpectationsSpec.kt @@ -18,7 +18,7 @@ class LocalDateTimeExpectationsSpec : ch.tutteli.atrium.specs.integration.LocalD fun1.() -> Unit>(Expect::dayOfWeek) ) { - @Suppress("unused") + @Suppress("unused", "UNUSED_VALUE") private fun ambiguityTest() { var a1: Expect = notImplemented() diff --git a/apis/infix/atrium-api-infix/src/jvmTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/OptionalExpectationsSpec.kt b/apis/infix/atrium-api-infix/src/jvmTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/OptionalExpectationsSpec.kt index 874a653e8c..c720632f4b 100644 --- a/apis/infix/atrium-api-infix/src/jvmTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/OptionalExpectationsSpec.kt +++ b/apis/infix/atrium-api-infix/src/jvmTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/OptionalExpectationsSpec.kt @@ -22,7 +22,7 @@ class OptionalExpectationsSpec : OptionalExpectationsSpec( private fun toBePresentFeature(expect: Expect>) = expect toBe present } - @Suppress("unused") + @Suppress("unused", "UNUSED_VALUE") private fun ambiguityTest() { var o1: Expect> = notImplemented() var o1b: Expect> = notImplemented() diff --git a/apis/infix/atrium-api-infix/src/jvmTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/PathExpectationsSpec.kt b/apis/infix/atrium-api-infix/src/jvmTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/PathExpectationsSpec.kt index d06b6388f1..15265d6fc9 100644 --- a/apis/infix/atrium-api-infix/src/jvmTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/PathExpectationsSpec.kt +++ b/apis/infix/atrium-api-infix/src/jvmTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/PathExpectationsSpec.kt @@ -84,7 +84,7 @@ class PathExpectationsSpec : ch.tutteli.atrium.specs.integration.PathExpectation ): Expect = expect resolve path(other) { assertionCreator() } } - @Suppress("unused") + @Suppress("unused", "UNUSED_VALUE") private fun ambiguityTest() { val a1: Expect = notImplemented() diff --git a/apis/infix/atrium-api-infix/src/jvmTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/ZonedDateTimeExpectationsSpec.kt b/apis/infix/atrium-api-infix/src/jvmTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/ZonedDateTimeExpectationsSpec.kt index 7b5115f77b..bdfc2d0554 100644 --- a/apis/infix/atrium-api-infix/src/jvmTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/ZonedDateTimeExpectationsSpec.kt +++ b/apis/infix/atrium-api-infix/src/jvmTest/kotlin/ch/tutteli/atrium/api/infix/en_GB/ZonedDateTimeExpectationsSpec.kt @@ -18,7 +18,7 @@ class ZonedDateTimeExpectationsSpec : ch.tutteli.atrium.specs.integration.ZonedD fun1.() -> Unit>(Expect::dayOfWeek) ) { - @Suppress("unused") + @Suppress("unused", "UNUSED_VALUE") private fun ambiguityTest() { var a1: Expect = notImplemented() diff --git a/atrium-core/api/main/atrium-core.api b/atrium-core/api/main/atrium-core.api index 326b5c8cbf..26845e839d 100644 --- a/atrium-core/api/main/atrium-core.api +++ b/atrium-core/api/main/atrium-core.api @@ -1559,11 +1559,6 @@ public abstract interface class ch/tutteli/atrium/reporting/AtriumErrorAdjusterC public abstract fun adjustOtherThanStacks (Ljava/lang/Throwable;)V } -public final class ch/tutteli/atrium/reporting/AtriumErrorJvmKt { - public static final fun extractActual (Lch/tutteli/atrium/creating/proofs/Proof;)Ljava/lang/Object; - public static final fun extractExpected (Lch/tutteli/atrium/creating/proofs/Proof;)Ljava/lang/Object; -} - public final class ch/tutteli/atrium/reporting/ConstantsKt { public static final field BUG_REPORT_URL Ljava/lang/String; public static final field SHOULD_NOT_BE_SHOWN_TO_THE_USER_BUG Ljava/lang/String; @@ -1852,6 +1847,17 @@ public final class ch/tutteli/atrium/reporting/reportables/Description$DefaultIm public static fun getDefault (Lch/tutteli/atrium/reporting/reportables/Description;)Ljava/lang/String; } +public final class ch/tutteli/atrium/reporting/reportables/ErrorMessages : java/lang/Enum, ch/tutteli/atrium/reporting/reportables/TextElement { + public static final field AT_LEAST_ONE_EXPECTATION_DEFINED Lch/tutteli/atrium/reporting/reportables/ErrorMessages; + public static final field DEFAULT_HINT_AT_LEAST_ONE_EXPECTATION_DEFINED Lch/tutteli/atrium/reporting/reportables/ErrorMessages; + public static final field DESCRIPTION_BASED_ON_SUBJECT Lch/tutteli/atrium/reporting/reportables/ErrorMessages; + public static final field FORGOT_DO_DEFINE_EXPECTATION Lch/tutteli/atrium/reporting/reportables/ErrorMessages; + public static final field REPRESENTATION_BASED_ON_SUBJECT_NOT_DEFINED Lch/tutteli/atrium/reporting/reportables/ErrorMessages; + public fun getString ()Ljava/lang/String; + public static fun valueOf (Ljava/lang/String;)Lch/tutteli/atrium/reporting/reportables/ErrorMessages; + public static fun values ()[Lch/tutteli/atrium/reporting/reportables/ErrorMessages; +} + public abstract interface class ch/tutteli/atrium/reporting/reportables/FailureExplanationGroup : ch/tutteli/atrium/reporting/reportables/ReportableGroupWithDescription { } @@ -1966,10 +1972,13 @@ public final class ch/tutteli/atrium/reporting/reportables/descriptions/Descript } public final class ch/tutteli/atrium/reporting/reportables/descriptions/DescriptionBasic : java/lang/Enum, ch/tutteli/atrium/reporting/reportables/Description { + public static final field NOT_TO Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionBasic; public static final field NOT_TO_BE Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionBasic; public static final field NOT_TO_HAVE Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionBasic; + public static final field TO Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionBasic; public static final field TO_BE Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionBasic; public static final field TO_HAVE Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionBasic; + public static final field WAS Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionBasic; public fun getDefault ()Ljava/lang/String; public fun getString ()Ljava/lang/String; public static fun valueOf (Ljava/lang/String;)Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionBasic; @@ -2065,6 +2074,16 @@ public final class ch/tutteli/atrium/reporting/reportables/descriptions/Descript public static fun values ()[Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionDocumentationUtil; } +public final class ch/tutteli/atrium/reporting/reportables/descriptions/DescriptionFloatingPointProof : java/lang/Enum, ch/tutteli/atrium/reporting/reportables/Description { + public static final field FAILURE_DUE_TO_FLOATING_POINT_NUMBER Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionFloatingPointProof; + public static final field TO_EQUAL_WITH_ERROR_TOLERANCE Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionFloatingPointProof; + public static final field TO_EQUAL_WITH_ERROR_TOLERANCE_EXPLAINED Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionFloatingPointProof; + public fun getDefault ()Ljava/lang/String; + public fun getString ()Ljava/lang/String; + public static fun valueOf (Ljava/lang/String;)Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionFloatingPointProof; + public static fun values ()[Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionFloatingPointProof; +} + public final class ch/tutteli/atrium/reporting/reportables/descriptions/DescriptionFunLikeProof : java/lang/Enum, ch/tutteli/atrium/reporting/reportables/Description { public static final field NO_EXCEPTION_OCCURRED Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionFunLikeProof; public static final field THREW Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionFunLikeProof; @@ -2075,6 +2094,136 @@ public final class ch/tutteli/atrium/reporting/reportables/descriptions/Descript public static fun values ()[Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionFunLikeProof; } +public final class ch/tutteli/atrium/reporting/reportables/descriptions/DescriptionIterableLikeProof : java/lang/Enum, ch/tutteli/atrium/reporting/reportables/Description { + public static final field ALL_ELEMENTS Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionIterableLikeProof; + public static final field AN_ELEMENT_WHICH_EQUALS Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionIterableLikeProof; + public static final field AN_ELEMENT_WHICH_NEEDS Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionIterableLikeProof; + public static final field AT_LEAST Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionIterableLikeProof; + public static final field AT_MOST Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionIterableLikeProof; + public static final field A_NEXT_ELEMENT Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionIterableLikeProof; + public static final field DUPLICATED_BY Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionIterableLikeProof; + public static final field DUPLICATE_ELEMENTS Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionIterableLikeProof; + public static final field ELEMENT_NOT_FOUND Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionIterableLikeProof; + public static final field ELEMENT_WITH_INDEX Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionIterableLikeProof; + public static final field EXACTLY Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionIterableLikeProof; + public static final field INDEX Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionIterableLikeProof; + public static final field INDEX_FROM_TO Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionIterableLikeProof; + public static final field IN_ANY_ORDER Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionIterableLikeProof; + public static final field IN_ANY_ORDER_ONLY Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionIterableLikeProof; + public static final field IN_ORDER Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionIterableLikeProof; + public static final field IN_ORDER_ONLY Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionIterableLikeProof; + public static final field IN_ORDER_ONLY_GROUPED Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionIterableLikeProof; + public static final field NEITHER_EMPTY_NOR_ELEMENT_FOUND Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionIterableLikeProof; + public static final field NOT_TO_CONTAIN Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionIterableLikeProof; + public static final field NOT_TO_HAVE_ELEMENTS_OR_ALL Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionIterableLikeProof; + public static final field NOT_TO_HAVE_ELEMENTS_OR_ANY Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionIterableLikeProof; + public static final field NOT_TO_HAVE_ELEMENTS_OR_NONE Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionIterableLikeProof; + public static final field NO_ELEMENTS Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionIterableLikeProof; + public static final field NUMBER_OF_ELEMENTS_FOUND Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionIterableLikeProof; + public static final field NUMBER_OF_SUCH_ELEMENTS Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionIterableLikeProof; + public static final field SIZE_EXCEEDED Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionIterableLikeProof; + public static final field TO_CONTAIN Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionIterableLikeProof; + public static final field USE_NOT_TO_HAVE_ELEMENTS_OR_NONE Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionIterableLikeProof; + public static final field WARNING_ADDITIONAL_ELEMENTS Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionIterableLikeProof; + public static final field WARNING_MISMATCHES Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionIterableLikeProof; + public static final field WARNING_MISMATCHES_ADDITIONAL_ELEMENTS Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionIterableLikeProof; + public fun getDefault ()Ljava/lang/String; + public fun getString ()Ljava/lang/String; + public static fun valueOf (Ljava/lang/String;)Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionIterableLikeProof; + public static fun values ()[Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionIterableLikeProof; +} + +public final class ch/tutteli/atrium/reporting/reportables/descriptions/DescriptionListLikeProof : java/lang/Enum, ch/tutteli/atrium/reporting/reportables/Description { + public static final field INDEX_OUT_OF_BOUNDS Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionListLikeProof; + public fun getDefault ()Ljava/lang/String; + public fun getString ()Ljava/lang/String; + public static fun valueOf (Ljava/lang/String;)Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionListLikeProof; + public static fun values ()[Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionListLikeProof; +} + +public final class ch/tutteli/atrium/reporting/reportables/descriptions/DescriptionMapLikeProof : java/lang/Enum, ch/tutteli/atrium/reporting/translating/StringBasedTranslatable { + public static final field ENTRY_WITH_KEY Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionMapLikeProof; + public static final field IN_ANY_ORDER Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionMapLikeProof; + public static final field IN_ANY_ORDER_ONLY Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionMapLikeProof; + public static final field IN_ORDER Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionMapLikeProof; + public static final field IN_ORDER_ONLY Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionMapLikeProof; + public static final field KEY_DOES_NOT_EXIST Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionMapLikeProof; + public static final field NOT_TO_CONTAIN_KEY Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionMapLikeProof; + public static final field TO_CONTAIN Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionMapLikeProof; + public static final field TO_CONTAIN_KEY Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionMapLikeProof; + public static final field WARNING_ADDITIONAL_ENTRIES Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionMapLikeProof; + public fun getDefault ()Ljava/lang/String; + public fun getId ()Ljava/lang/String; + public synthetic fun getName ()Ljava/lang/String; + public fun getString ()Ljava/lang/String; + public fun getValue ()Ljava/lang/String; + public static fun valueOf (Ljava/lang/String;)Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionMapLikeProof; + public static fun values ()[Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionMapLikeProof; +} + +public final class ch/tutteli/atrium/reporting/reportables/descriptions/DescriptionOptionalProof : java/lang/Enum, ch/tutteli/atrium/reporting/reportables/Description { + public static final field EMPTY Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionOptionalProof; + public static final field IS_NOT_PRESENT Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionOptionalProof; + public fun getDefault ()Ljava/lang/String; + public fun getString ()Ljava/lang/String; + public static fun valueOf (Ljava/lang/String;)Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionOptionalProof; + public static fun values ()[Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionOptionalProof; +} + +public final class ch/tutteli/atrium/reporting/reportables/descriptions/DescriptionPathProof : java/lang/Enum, ch/tutteli/atrium/reporting/reportables/Description { + public static final field ABSOLUTE_PATH Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionPathProof; + public static final field AN_EMPTY_DIRECTORY Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionPathProof; + public static final field A_DIRECTORY Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionPathProof; + public static final field A_FILE Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionPathProof; + public static final field A_SYMBOLIC_LINK Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionPathProof; + public static final field A_UNKNOWN_FILE_TYPE Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionPathProof; + public static final field DIRECTORY_CONTAINS Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionPathProof; + public static final field DOES_NOT_HAVE_PARENT Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionPathProof; + public static final field ENDS_NOT_WITH Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionPathProof; + public static final field ENDS_WITH Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionPathProof; + public static final field EXECUTABLE Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionPathProof; + public static final field EXIST Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionPathProof; + public static final field EXTENSION Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionPathProof; + public static final field FAILURE_DUE_TO_ACCESS_DENIED Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionPathProof; + public static final field FAILURE_DUE_TO_ACCESS_EXCEPTION Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionPathProof; + public static final field FAILURE_DUE_TO_LINK_LOOP Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionPathProof; + public static final field FAILURE_DUE_TO_NO_SUCH_FILE Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionPathProof; + public static final field FAILURE_DUE_TO_PARENT Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionPathProof; + public static final field FAILURE_DUE_TO_PERMISSION_FILE_TYPE_HINT Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionPathProof; + public static final field FAILURE_DUE_TO_WRONG_FILE_TYPE Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionPathProof; + public static final field FILE_NAME Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionPathProof; + public static final field FILE_NAME_WITHOUT_EXTENSION Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionPathProof; + public static final field HAS_SAME_BINARY_CONTENT Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionPathProof; + public static final field HAS_SAME_TEXTUAL_CONTENT Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionPathProof; + public static final field HINT_ACTUAL_ACL_PERMISSIONS Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionPathProof; + public static final field HINT_ACTUAL_POSIX_PERMISSIONS Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionPathProof; + public static final field HINT_CLOSEST_EXISTING_PARENT_DIRECTORY Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionPathProof; + public static final field HINT_FOLLOWED_SYMBOLIC_LINK Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionPathProof; + public static final field HINT_OWNER Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionPathProof; + public static final field HINT_OWNER_AND_GROUP Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionPathProof; + public static final field PARENT Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionPathProof; + public static final field READABLE Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionPathProof; + public static final field RELATIVE_PATH Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionPathProof; + public static final field STARTS_NOT_WITH Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionPathProof; + public static final field STARTS_WITH Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionPathProof; + public static final field WRITABLE Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionPathProof; + public fun getDefault ()Ljava/lang/String; + public fun getString ()Ljava/lang/String; + public static fun valueOf (Ljava/lang/String;)Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionPathProof; + public static fun values ()[Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionPathProof; +} + +public final class ch/tutteli/atrium/reporting/reportables/descriptions/DescriptionResultProof : java/lang/Enum, ch/tutteli/atrium/reporting/reportables/Description { + public static final field EXCEPTION Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionResultProof; + public static final field IS_NOT_FAILURE Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionResultProof; + public static final field IS_NOT_SUCCESS Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionResultProof; + public static final field VALUE Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionResultProof; + public fun getDefault ()Ljava/lang/String; + public fun getString ()Ljava/lang/String; + public static fun valueOf (Ljava/lang/String;)Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionResultProof; + public static fun values ()[Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionResultProof; +} + public final class ch/tutteli/atrium/reporting/reportables/descriptions/DescriptionThrowableProof : java/lang/Enum, ch/tutteli/atrium/reporting/reportables/Description { public static final field CAUSE Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionThrowableProof; public static final field HAS_NO_CAUSE Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionThrowableProof; @@ -2089,16 +2238,6 @@ public final class ch/tutteli/atrium/reporting/reportables/descriptions/Descript public static fun values ()[Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionThrowableProof; } -public final class ch/tutteli/atrium/reporting/reportables/descriptions/ErrorMessages : java/lang/Enum, ch/tutteli/atrium/reporting/reportables/TextElement { - public static final field AT_LEAST_ONE_EXPECTATION_DEFINED Lch/tutteli/atrium/reporting/reportables/descriptions/ErrorMessages; - public static final field DEFAULT_HINT_AT_LEAST_ONE_EXPECTATION_DEFINED Lch/tutteli/atrium/reporting/reportables/descriptions/ErrorMessages; - public static final field FORGOT_DO_DEFINE_EXPECTATION Lch/tutteli/atrium/reporting/reportables/descriptions/ErrorMessages; - public static final field NO_PROF_ADDED_IN_PROOF_GROUP Lch/tutteli/atrium/reporting/reportables/descriptions/ErrorMessages; - public fun getString ()Ljava/lang/String; - public static fun valueOf (Ljava/lang/String;)Lch/tutteli/atrium/reporting/reportables/descriptions/ErrorMessages; - public static fun values ()[Lch/tutteli/atrium/reporting/reportables/descriptions/ErrorMessages; -} - public final class ch/tutteli/atrium/reporting/reportables/impl/DefaultRepresentation : ch/tutteli/atrium/reporting/reportables/Representation { public fun (Ljava/lang/Object;)V public fun getRepresentation ()Ljava/lang/Object; diff --git a/atrium-core/api/using-kotlin-1.9-or-newer/atrium-core.api b/atrium-core/api/using-kotlin-1.9-or-newer/atrium-core.api index f9c917591e..69c2c4692e 100644 --- a/atrium-core/api/using-kotlin-1.9-or-newer/atrium-core.api +++ b/atrium-core/api/using-kotlin-1.9-or-newer/atrium-core.api @@ -1560,11 +1560,6 @@ public abstract interface class ch/tutteli/atrium/reporting/AtriumErrorAdjusterC public abstract fun adjustOtherThanStacks (Ljava/lang/Throwable;)V } -public final class ch/tutteli/atrium/reporting/AtriumErrorJvmKt { - public static final fun extractActual (Lch/tutteli/atrium/creating/proofs/Proof;)Ljava/lang/Object; - public static final fun extractExpected (Lch/tutteli/atrium/creating/proofs/Proof;)Ljava/lang/Object; -} - public final class ch/tutteli/atrium/reporting/ConstantsKt { public static final field BUG_REPORT_URL Ljava/lang/String; public static final field SHOULD_NOT_BE_SHOWN_TO_THE_USER_BUG Ljava/lang/String; @@ -1854,6 +1849,18 @@ public final class ch/tutteli/atrium/reporting/reportables/Description$DefaultIm public static fun getDefault (Lch/tutteli/atrium/reporting/reportables/Description;)Ljava/lang/String; } +public final class ch/tutteli/atrium/reporting/reportables/ErrorMessages : java/lang/Enum, ch/tutteli/atrium/reporting/reportables/TextElement { + public static final field AT_LEAST_ONE_EXPECTATION_DEFINED Lch/tutteli/atrium/reporting/reportables/ErrorMessages; + public static final field DEFAULT_HINT_AT_LEAST_ONE_EXPECTATION_DEFINED Lch/tutteli/atrium/reporting/reportables/ErrorMessages; + public static final field DESCRIPTION_BASED_ON_SUBJECT Lch/tutteli/atrium/reporting/reportables/ErrorMessages; + public static final field FORGOT_DO_DEFINE_EXPECTATION Lch/tutteli/atrium/reporting/reportables/ErrorMessages; + public static final field REPRESENTATION_BASED_ON_SUBJECT_NOT_DEFINED Lch/tutteli/atrium/reporting/reportables/ErrorMessages; + public static fun getEntries ()Lkotlin/enums/EnumEntries; + public fun getString ()Ljava/lang/String; + public static fun valueOf (Ljava/lang/String;)Lch/tutteli/atrium/reporting/reportables/ErrorMessages; + public static fun values ()[Lch/tutteli/atrium/reporting/reportables/ErrorMessages; +} + public abstract interface class ch/tutteli/atrium/reporting/reportables/FailureExplanationGroup : ch/tutteli/atrium/reporting/reportables/ReportableGroupWithDescription { } @@ -1970,10 +1977,13 @@ public final class ch/tutteli/atrium/reporting/reportables/descriptions/Descript } public final class ch/tutteli/atrium/reporting/reportables/descriptions/DescriptionBasic : java/lang/Enum, ch/tutteli/atrium/reporting/reportables/Description { + public static final field NOT_TO Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionBasic; public static final field NOT_TO_BE Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionBasic; public static final field NOT_TO_HAVE Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionBasic; + public static final field TO Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionBasic; public static final field TO_BE Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionBasic; public static final field TO_HAVE Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionBasic; + public static final field WAS Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionBasic; public fun getDefault ()Ljava/lang/String; public static fun getEntries ()Lkotlin/enums/EnumEntries; public fun getString ()Ljava/lang/String; @@ -2076,6 +2086,17 @@ public final class ch/tutteli/atrium/reporting/reportables/descriptions/Descript public static fun values ()[Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionDocumentationUtil; } +public final class ch/tutteli/atrium/reporting/reportables/descriptions/DescriptionFloatingPointProof : java/lang/Enum, ch/tutteli/atrium/reporting/reportables/Description { + public static final field FAILURE_DUE_TO_FLOATING_POINT_NUMBER Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionFloatingPointProof; + public static final field TO_EQUAL_WITH_ERROR_TOLERANCE Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionFloatingPointProof; + public static final field TO_EQUAL_WITH_ERROR_TOLERANCE_EXPLAINED Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionFloatingPointProof; + public fun getDefault ()Ljava/lang/String; + public static fun getEntries ()Lkotlin/enums/EnumEntries; + public fun getString ()Ljava/lang/String; + public static fun valueOf (Ljava/lang/String;)Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionFloatingPointProof; + public static fun values ()[Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionFloatingPointProof; +} + public final class ch/tutteli/atrium/reporting/reportables/descriptions/DescriptionFunLikeProof : java/lang/Enum, ch/tutteli/atrium/reporting/reportables/Description { public static final field NO_EXCEPTION_OCCURRED Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionFunLikeProof; public static final field THREW Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionFunLikeProof; @@ -2087,6 +2108,142 @@ public final class ch/tutteli/atrium/reporting/reportables/descriptions/Descript public static fun values ()[Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionFunLikeProof; } +public final class ch/tutteli/atrium/reporting/reportables/descriptions/DescriptionIterableLikeProof : java/lang/Enum, ch/tutteli/atrium/reporting/reportables/Description { + public static final field ALL_ELEMENTS Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionIterableLikeProof; + public static final field AN_ELEMENT_WHICH_EQUALS Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionIterableLikeProof; + public static final field AN_ELEMENT_WHICH_NEEDS Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionIterableLikeProof; + public static final field AT_LEAST Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionIterableLikeProof; + public static final field AT_MOST Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionIterableLikeProof; + public static final field A_NEXT_ELEMENT Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionIterableLikeProof; + public static final field DUPLICATED_BY Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionIterableLikeProof; + public static final field DUPLICATE_ELEMENTS Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionIterableLikeProof; + public static final field ELEMENT_NOT_FOUND Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionIterableLikeProof; + public static final field ELEMENT_WITH_INDEX Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionIterableLikeProof; + public static final field EXACTLY Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionIterableLikeProof; + public static final field INDEX Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionIterableLikeProof; + public static final field INDEX_FROM_TO Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionIterableLikeProof; + public static final field IN_ANY_ORDER Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionIterableLikeProof; + public static final field IN_ANY_ORDER_ONLY Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionIterableLikeProof; + public static final field IN_ORDER Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionIterableLikeProof; + public static final field IN_ORDER_ONLY Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionIterableLikeProof; + public static final field IN_ORDER_ONLY_GROUPED Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionIterableLikeProof; + public static final field NEITHER_EMPTY_NOR_ELEMENT_FOUND Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionIterableLikeProof; + public static final field NOT_TO_CONTAIN Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionIterableLikeProof; + public static final field NOT_TO_HAVE_ELEMENTS_OR_ALL Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionIterableLikeProof; + public static final field NOT_TO_HAVE_ELEMENTS_OR_ANY Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionIterableLikeProof; + public static final field NOT_TO_HAVE_ELEMENTS_OR_NONE Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionIterableLikeProof; + public static final field NO_ELEMENTS Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionIterableLikeProof; + public static final field NUMBER_OF_ELEMENTS_FOUND Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionIterableLikeProof; + public static final field NUMBER_OF_SUCH_ELEMENTS Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionIterableLikeProof; + public static final field SIZE_EXCEEDED Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionIterableLikeProof; + public static final field TO_CONTAIN Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionIterableLikeProof; + public static final field USE_NOT_TO_HAVE_ELEMENTS_OR_NONE Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionIterableLikeProof; + public static final field WARNING_ADDITIONAL_ELEMENTS Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionIterableLikeProof; + public static final field WARNING_MISMATCHES Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionIterableLikeProof; + public static final field WARNING_MISMATCHES_ADDITIONAL_ELEMENTS Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionIterableLikeProof; + public fun getDefault ()Ljava/lang/String; + public static fun getEntries ()Lkotlin/enums/EnumEntries; + public fun getString ()Ljava/lang/String; + public static fun valueOf (Ljava/lang/String;)Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionIterableLikeProof; + public static fun values ()[Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionIterableLikeProof; +} + +public final class ch/tutteli/atrium/reporting/reportables/descriptions/DescriptionListLikeProof : java/lang/Enum, ch/tutteli/atrium/reporting/reportables/Description { + public static final field INDEX_OUT_OF_BOUNDS Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionListLikeProof; + public fun getDefault ()Ljava/lang/String; + public static fun getEntries ()Lkotlin/enums/EnumEntries; + public fun getString ()Ljava/lang/String; + public static fun valueOf (Ljava/lang/String;)Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionListLikeProof; + public static fun values ()[Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionListLikeProof; +} + +public final class ch/tutteli/atrium/reporting/reportables/descriptions/DescriptionMapLikeProof : java/lang/Enum, ch/tutteli/atrium/reporting/translating/StringBasedTranslatable { + public static final field ENTRY_WITH_KEY Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionMapLikeProof; + public static final field IN_ANY_ORDER Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionMapLikeProof; + public static final field IN_ANY_ORDER_ONLY Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionMapLikeProof; + public static final field IN_ORDER Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionMapLikeProof; + public static final field IN_ORDER_ONLY Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionMapLikeProof; + public static final field KEY_DOES_NOT_EXIST Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionMapLikeProof; + public static final field NOT_TO_CONTAIN_KEY Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionMapLikeProof; + public static final field TO_CONTAIN Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionMapLikeProof; + public static final field TO_CONTAIN_KEY Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionMapLikeProof; + public static final field WARNING_ADDITIONAL_ENTRIES Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionMapLikeProof; + public fun getDefault ()Ljava/lang/String; + public static fun getEntries ()Lkotlin/enums/EnumEntries; + public fun getId ()Ljava/lang/String; + public synthetic fun getName ()Ljava/lang/String; + public fun getString ()Ljava/lang/String; + public fun getValue ()Ljava/lang/String; + public static fun valueOf (Ljava/lang/String;)Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionMapLikeProof; + public static fun values ()[Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionMapLikeProof; +} + +public final class ch/tutteli/atrium/reporting/reportables/descriptions/DescriptionOptionalProof : java/lang/Enum, ch/tutteli/atrium/reporting/reportables/Description { + public static final field EMPTY Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionOptionalProof; + public static final field IS_NOT_PRESENT Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionOptionalProof; + public fun getDefault ()Ljava/lang/String; + public static fun getEntries ()Lkotlin/enums/EnumEntries; + public fun getString ()Ljava/lang/String; + public static fun valueOf (Ljava/lang/String;)Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionOptionalProof; + public static fun values ()[Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionOptionalProof; +} + +public final class ch/tutteli/atrium/reporting/reportables/descriptions/DescriptionPathProof : java/lang/Enum, ch/tutteli/atrium/reporting/reportables/Description { + public static final field ABSOLUTE_PATH Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionPathProof; + public static final field AN_EMPTY_DIRECTORY Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionPathProof; + public static final field A_DIRECTORY Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionPathProof; + public static final field A_FILE Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionPathProof; + public static final field A_SYMBOLIC_LINK Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionPathProof; + public static final field A_UNKNOWN_FILE_TYPE Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionPathProof; + public static final field DIRECTORY_CONTAINS Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionPathProof; + public static final field DOES_NOT_HAVE_PARENT Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionPathProof; + public static final field ENDS_NOT_WITH Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionPathProof; + public static final field ENDS_WITH Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionPathProof; + public static final field EXECUTABLE Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionPathProof; + public static final field EXIST Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionPathProof; + public static final field EXTENSION Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionPathProof; + public static final field FAILURE_DUE_TO_ACCESS_DENIED Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionPathProof; + public static final field FAILURE_DUE_TO_ACCESS_EXCEPTION Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionPathProof; + public static final field FAILURE_DUE_TO_LINK_LOOP Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionPathProof; + public static final field FAILURE_DUE_TO_NO_SUCH_FILE Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionPathProof; + public static final field FAILURE_DUE_TO_PARENT Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionPathProof; + public static final field FAILURE_DUE_TO_PERMISSION_FILE_TYPE_HINT Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionPathProof; + public static final field FAILURE_DUE_TO_WRONG_FILE_TYPE Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionPathProof; + public static final field FILE_NAME Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionPathProof; + public static final field FILE_NAME_WITHOUT_EXTENSION Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionPathProof; + public static final field HAS_SAME_BINARY_CONTENT Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionPathProof; + public static final field HAS_SAME_TEXTUAL_CONTENT Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionPathProof; + public static final field HINT_ACTUAL_ACL_PERMISSIONS Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionPathProof; + public static final field HINT_ACTUAL_POSIX_PERMISSIONS Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionPathProof; + public static final field HINT_CLOSEST_EXISTING_PARENT_DIRECTORY Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionPathProof; + public static final field HINT_FOLLOWED_SYMBOLIC_LINK Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionPathProof; + public static final field HINT_OWNER Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionPathProof; + public static final field HINT_OWNER_AND_GROUP Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionPathProof; + public static final field PARENT Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionPathProof; + public static final field READABLE Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionPathProof; + public static final field RELATIVE_PATH Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionPathProof; + public static final field STARTS_NOT_WITH Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionPathProof; + public static final field STARTS_WITH Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionPathProof; + public static final field WRITABLE Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionPathProof; + public fun getDefault ()Ljava/lang/String; + public static fun getEntries ()Lkotlin/enums/EnumEntries; + public fun getString ()Ljava/lang/String; + public static fun valueOf (Ljava/lang/String;)Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionPathProof; + public static fun values ()[Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionPathProof; +} + +public final class ch/tutteli/atrium/reporting/reportables/descriptions/DescriptionResultProof : java/lang/Enum, ch/tutteli/atrium/reporting/reportables/Description { + public static final field EXCEPTION Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionResultProof; + public static final field IS_NOT_FAILURE Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionResultProof; + public static final field IS_NOT_SUCCESS Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionResultProof; + public static final field VALUE Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionResultProof; + public fun getDefault ()Ljava/lang/String; + public static fun getEntries ()Lkotlin/enums/EnumEntries; + public fun getString ()Ljava/lang/String; + public static fun valueOf (Ljava/lang/String;)Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionResultProof; + public static fun values ()[Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionResultProof; +} + public final class ch/tutteli/atrium/reporting/reportables/descriptions/DescriptionThrowableProof : java/lang/Enum, ch/tutteli/atrium/reporting/reportables/Description { public static final field CAUSE Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionThrowableProof; public static final field HAS_NO_CAUSE Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionThrowableProof; @@ -2102,17 +2259,6 @@ public final class ch/tutteli/atrium/reporting/reportables/descriptions/Descript public static fun values ()[Lch/tutteli/atrium/reporting/reportables/descriptions/DescriptionThrowableProof; } -public final class ch/tutteli/atrium/reporting/reportables/descriptions/ErrorMessages : java/lang/Enum, ch/tutteli/atrium/reporting/reportables/TextElement { - public static final field AT_LEAST_ONE_EXPECTATION_DEFINED Lch/tutteli/atrium/reporting/reportables/descriptions/ErrorMessages; - public static final field DEFAULT_HINT_AT_LEAST_ONE_EXPECTATION_DEFINED Lch/tutteli/atrium/reporting/reportables/descriptions/ErrorMessages; - public static final field FORGOT_DO_DEFINE_EXPECTATION Lch/tutteli/atrium/reporting/reportables/descriptions/ErrorMessages; - public static final field NO_PROF_ADDED_IN_PROOF_GROUP Lch/tutteli/atrium/reporting/reportables/descriptions/ErrorMessages; - public static fun getEntries ()Lkotlin/enums/EnumEntries; - public fun getString ()Ljava/lang/String; - public static fun valueOf (Ljava/lang/String;)Lch/tutteli/atrium/reporting/reportables/descriptions/ErrorMessages; - public static fun values ()[Lch/tutteli/atrium/reporting/reportables/descriptions/ErrorMessages; -} - public final class ch/tutteli/atrium/reporting/reportables/impl/DefaultRepresentation : ch/tutteli/atrium/reporting/reportables/Representation { public fun (Ljava/lang/Object;)V public fun getRepresentation ()Ljava/lang/Object; diff --git a/atrium-core/src/commonMain/kotlin/ch/tutteli/atrium/assertions/builders/fixedClaimGroup.kt b/atrium-core/src/commonMain/kotlin/ch/tutteli/atrium/assertions/builders/fixedClaimGroup.kt index b4b3085285..76634c00ad 100644 --- a/atrium-core/src/commonMain/kotlin/ch/tutteli/atrium/assertions/builders/fixedClaimGroup.kt +++ b/atrium-core/src/commonMain/kotlin/ch/tutteli/atrium/assertions/builders/fixedClaimGroup.kt @@ -20,7 +20,7 @@ import ch.tutteli.atrium.reporting.translating.Translatable * [ExplanatoryAssertionGroupType]. Such groups always return `true` for [AssertionGroup.holds] but you might want to * explain a complex failing assertion with those groups. In such a use case this builder is your choice. */ -@Suppress("unused") +@Suppress("unused", "UNUSED_VALUE") val AssertionBuilder.fixedClaimGroup: FixedClaimGroup.GroupTypeOption get() = FixedClaimGroup.GroupTypeOption.create() diff --git a/atrium-core/src/commonMain/kotlin/ch/tutteli/atrium/assertions/builders/partiallyFixedClaimGroup.kt b/atrium-core/src/commonMain/kotlin/ch/tutteli/atrium/assertions/builders/partiallyFixedClaimGroup.kt index 7a6ae5f73e..e06ba4b47d 100644 --- a/atrium-core/src/commonMain/kotlin/ch/tutteli/atrium/assertions/builders/partiallyFixedClaimGroup.kt +++ b/atrium-core/src/commonMain/kotlin/ch/tutteli/atrium/assertions/builders/partiallyFixedClaimGroup.kt @@ -20,7 +20,7 @@ import ch.tutteli.atrium.reporting.translating.Translatable * If it fails, then the assertions cannot be carried out (only be used for explanation) and in such a case * [AssertionGroup.holds] has to be false. Otherwise [AssertionGroup.holds] depend on [AssertionGroup.assertions]. */ -@Suppress("unused") +@Suppress("unused", "UNUSED_VALUE") val AssertionBuilder.partiallyFixedClaimGroup: PartiallyFixedClaimGroup.GroupTypeOption get() = PartiallyFixedClaimGroup.GroupTypeOption.create() diff --git a/atrium-core/src/commonMain/kotlin/ch/tutteli/atrium/core.kt b/atrium-core/src/commonMain/kotlin/ch/tutteli/atrium/core.kt index 9601e8f5b4..7cca22554a 100644 --- a/atrium-core/src/commonMain/kotlin/ch/tutteli/atrium/core.kt +++ b/atrium-core/src/commonMain/kotlin/ch/tutteli/atrium/core.kt @@ -39,9 +39,7 @@ inline fun ExpectGrouping._coreAppend(crossinline proofCreator: ProofContainer<* // inside we use proofCreator which is still based on ProofContainer<*> so we are still type safe @Suppress("UNCHECKED_CAST") return (_core as ProofContainer).appendAsGroupIndicateIfOneCollected(ExpectationCreatorWithUsageHints( - listOf( - Text("bug detected, looks like we forgot to append a proof, please open a bug at $BUG_REPORT_URL") - ) + forgotToAppendProofPseudoUsageHint ) { _core.run, Unit> { append(proofCreator()) } }).first.toExpectGrouping() diff --git a/atrium-core/src/commonMain/kotlin/ch/tutteli/atrium/creating/AssertionContainer.kt b/atrium-core/src/commonMain/kotlin/ch/tutteli/atrium/creating/AssertionContainer.kt index c11bb9d301..a4309a7527 100644 --- a/atrium-core/src/commonMain/kotlin/ch/tutteli/atrium/creating/AssertionContainer.kt +++ b/atrium-core/src/commonMain/kotlin/ch/tutteli/atrium/creating/AssertionContainer.kt @@ -81,7 +81,7 @@ interface AssertionContainer { "Use appendAsGroupIndicateIfOneCollected and define the alternative or pass an empty list if you don't have any", ReplaceWith( "this.appendAsGroupIndicateIfOneCollected(ExpectationCreatorWithUsageHints(usageHintsOverloadWithoutExpectationCreator = listOf(/* ... add a usage hint in case you have an overload which does not expect an expectationCreator */), expectationCreator = assertionCreator)).first", - "ch.tutteli.atrium.creating.ExpectationCreatorWithUsageHints" + "ch.tutteli.atrium.creating.ExpectationCreatorWithUsageHints", ) ) fun appendAsGroup(assertionCreator: Expect.() -> Unit): Expect diff --git a/atrium-core/src/commonMain/kotlin/ch/tutteli/atrium/creating/impl/CollectingExpectImpl.kt b/atrium-core/src/commonMain/kotlin/ch/tutteli/atrium/creating/impl/CollectingExpectImpl.kt index a15ddbe508..ab647c46bd 100644 --- a/atrium-core/src/commonMain/kotlin/ch/tutteli/atrium/creating/impl/CollectingExpectImpl.kt +++ b/atrium-core/src/commonMain/kotlin/ch/tutteli/atrium/creating/impl/CollectingExpectImpl.kt @@ -90,12 +90,12 @@ internal class CollectingExpectImpl( is ReportableWithDesignation -> BasicDescriptiveAssertion( descriptionToUntranslatable(reportable.description), reportable.representation - ) { false } + ) { true } else -> BasicDescriptiveAssertion( ch.tutteli.atrium.reporting.translating.Untranslatable("❗❗ Assertion is deprecated, move to Proof, cannot show description"), reportable - ) { false } + ) { true } } } @@ -179,13 +179,10 @@ internal class CollectingExpectImpl( ) { simpleProof(DescriptionAnyProof.TO_EQUAL, true) { false } - addAll( - expectationCreatorWithUsageHints.usageHintsOverloadWithoutExpectationCreator.ifNotEmpty { hints -> - listOf( - Reportable.usageHintGroup(listOf(ErrorMessages.FORGOT_DO_DEFINE_EXPECTATION) + hints) - ) - } - ) + usageHintGroup { + add(ErrorMessages.FORGOT_DO_DEFINE_EXPECTATION) + addAll(expectationCreatorWithUsageHints.usageHintsOverloadWithoutExpectationCreator) + } } } ) diff --git a/atrium-core/src/commonMain/kotlin/ch/tutteli/atrium/creating/proofs/impl/DefaultDocumentationUtils.kt b/atrium-core/src/commonMain/kotlin/ch/tutteli/atrium/creating/proofs/impl/DefaultDocumentationUtils.kt index 4e00d8f8ec..062c606a14 100644 --- a/atrium-core/src/commonMain/kotlin/ch/tutteli/atrium/creating/proofs/impl/DefaultDocumentationUtils.kt +++ b/atrium-core/src/commonMain/kotlin/ch/tutteli/atrium/creating/proofs/impl/DefaultDocumentationUtils.kt @@ -19,6 +19,7 @@ class DefaultDocumentationUtils : DocumentationUtils { ): Proof = container.buildProof { collect( ExpectationCreatorWithUsageHints( + // there is no alternative for `because` which does not take an expectationCreator usageHintsOverloadWithoutExpectationCreator = emptyList(), expectationCreator ) diff --git a/atrium-core/src/commonMain/kotlin/ch/tutteli/atrium/reporting/reportables/descriptions/DescriptionMapLikeProof.kt b/atrium-core/src/commonMain/kotlin/ch/tutteli/atrium/reporting/reportables/descriptions/DescriptionMapLikeProof.kt new file mode 100644 index 0000000000..6c45b9b46c --- /dev/null +++ b/atrium-core/src/commonMain/kotlin/ch/tutteli/atrium/reporting/reportables/descriptions/DescriptionMapLikeProof.kt @@ -0,0 +1,42 @@ +// TODO remove with 2.0.0 at the latest +@file:Suppress("DEPRECATION") + +package ch.tutteli.atrium.reporting.reportables.descriptions + +import ch.tutteli.atrium.reporting.reportables.Description +import ch.tutteli.atrium.reporting.translating.StringBasedTranslatable + +/** + * Contains [Description]s that are related to expectation functions which are applicable to [Map] like subjects. + */ +enum class DescriptionMapLikeProof(override val value: String) : StringBasedTranslatable { + /** @since 1.3.0 (was in DescriptionMapLikeExpectation since 0.18.0) */ + TO_CONTAIN("to contain"), + + /** @since 1.3.0 (was in DescriptionMapLikeExpectation since 0.18.0) */ + TO_CONTAIN_KEY("to contain key"), + + /** @since 1.3.0 (was in DescriptionMapLikeExpectation since 0.18.0) */ + NOT_TO_CONTAIN_KEY("not to contain key"), + + /** @since 1.3.0 (was in DescriptionMapLikeExpectation since 0.18.0) */ + ENTRY_WITH_KEY("entry %s"), + + /** @since 1.3.0 (was in DescriptionMapLikeExpectation since 0.18.0) */ + IN_ANY_ORDER("%s, in any order"), + + /** @since 1.3.0 (was in DescriptionMapLikeExpectation since 0.18.0) */ + IN_ANY_ORDER_ONLY("%s only, in any order"), + + /** @since 1.3.0 (was in DescriptionMapLikeExpectation since 0.18.0) */ + IN_ORDER("%, in order"), + + /** @since 1.3.0 (was in DescriptionMapLikeExpectation since 0.18.0) */ + IN_ORDER_ONLY("%s only, in order"), + + /** @since 1.3.0 (was in DescriptionMapLikeExpectation since 0.18.0) */ + KEY_DOES_NOT_EXIST("❗❗ key does not exist"), + + /** @since 1.3.0 (was in DescriptionMapLikeExpectation since 0.18.0) */ + WARNING_ADDITIONAL_ENTRIES("additional entries detected"), +} diff --git a/atrium-core/src/commonMain/kotlin/ch/tutteli/atrium/reporting/text/impl/DefaultTextReporter.kt b/atrium-core/src/commonMain/kotlin/ch/tutteli/atrium/reporting/text/impl/DefaultTextReporter.kt index 8129c7b0e3..29d0d76e16 100644 --- a/atrium-core/src/commonMain/kotlin/ch/tutteli/atrium/reporting/text/impl/DefaultTextReporter.kt +++ b/atrium-core/src/commonMain/kotlin/ch/tutteli/atrium/reporting/text/impl/DefaultTextReporter.kt @@ -69,7 +69,7 @@ class DefaultTextReporter( (0 until indentLevel).forEach { i -> val styledString = columns[i] //TODO 1.3.0 what about wrapping throw an error as well? - val indent = indentLevels[i] + val indent = indentLevels.ifWithinBound(i, { indentLevels[i] }, elseBlock = { throw IndexOutOfBoundsException("there is no identLevel $i (there are levels 0 to ${indentLevels.size-1}) to ident node:\n$node\nwhile formatting\n$outputNode\nThe reporter constructed the following output so far\n$sb")}) sb.append(styledString.padString(if (indent > 0) indent else 0)) } diff --git a/atrium-core/src/commonMain/kotlin/ch/tutteli/atrium/reporting/theming/text/impl/DefaultTextIconStyler.kt b/atrium-core/src/commonMain/kotlin/ch/tutteli/atrium/reporting/theming/text/impl/DefaultTextIconStyler.kt index a0c4e168de..036f627b95 100644 --- a/atrium-core/src/commonMain/kotlin/ch/tutteli/atrium/reporting/theming/text/impl/DefaultTextIconStyler.kt +++ b/atrium-core/src/commonMain/kotlin/ch/tutteli/atrium/reporting/theming/text/impl/DefaultTextIconStyler.kt @@ -48,7 +48,7 @@ internal class DefaultTextIconStyler( Icon.FAILING_GROUP to styleIcon("🚩\uFE0F",utf8Space = " ", uft8MonospaceLength = 3, "(f)", Style.FAILURE), Icon.FAILURE to styleIcon("🚫\uFE0F", utf8Space = " ", uft8MonospaceLength = 3, "(f)", Style.FAILURE), Icon.FEATURE to styleIcon("▶", utf8Space = " ", uft8MonospaceLength = 2, ">", Style.FEATURE), - Icon.INFORMATION_SOURCE to styleIcon("i", utf8Space = " ", uft8MonospaceLength = 2, "(i)", Style.INFORMATION_SOURCE), + Icon.INFORMATION_SOURCE to styleIcon("ℹ\uFE0F", utf8Space = " ", uft8MonospaceLength = 3, "(i)", Style.INFORMATION_SOURCE), Icon.SUCCESS to styleIcon("✔", utf8Space = " ", uft8MonospaceLength = 2, "(s)", Style.SUCCESS), // bullet points diff --git a/atrium-core/src/commonMain/kotlin/ch/tutteli/atrium/reporting/theming/text/impl/MarkdownTextIconStyler.kt b/atrium-core/src/commonMain/kotlin/ch/tutteli/atrium/reporting/theming/text/impl/MarkdownTextIconStyler.kt index 087ea475f2..7a70fbe976 100644 --- a/atrium-core/src/commonMain/kotlin/ch/tutteli/atrium/reporting/theming/text/impl/MarkdownTextIconStyler.kt +++ b/atrium-core/src/commonMain/kotlin/ch/tutteli/atrium/reporting/theming/text/impl/MarkdownTextIconStyler.kt @@ -22,7 +22,7 @@ class MarkdownTextIconStyler : TextIconStyler { Icon.FAILING_GROUP to styleIcon("🚩\uFE0F", 2), Icon.FAILURE to styleIcon("🚫\uFE0F", 2), Icon.FEATURE to styleIcon("▶", 1), - Icon.INFORMATION_SOURCE to styleIcon("ℹ\uFE0F", 1), + Icon.INFORMATION_SOURCE to styleIcon("ℹ\uFE0F", 2), Icon.SUCCESS to styleIcon("✔", 1), // bullet points diff --git a/atrium-core/src/commonTest/kotlin/ch/tutteli/atrium/reporting/CreateReportTest.kt b/atrium-core/src/commonTest/kotlin/ch/tutteli/atrium/reporting/CreateReportTest.kt index ee69888b99..33724522b6 100644 --- a/atrium-core/src/commonTest/kotlin/ch/tutteli/atrium/reporting/CreateReportTest.kt +++ b/atrium-core/src/commonTest/kotlin/ch/tutteli/atrium/reporting/CreateReportTest.kt @@ -4,6 +4,8 @@ import ch.tutteli.atrium._core import ch.tutteli.atrium.api.infix.en_GB.toEqual import ch.tutteli.atrium.api.verbs.internal.expect import ch.tutteli.atrium.assertions.* +import ch.tutteli.atrium.assertions.builders.impl.fixedClaimGroup.FixedClaimAssertionGroup +import ch.tutteli.atrium.core.polyfills.fullName import ch.tutteli.atrium.creating.ComponentFactory import ch.tutteli.atrium.creating.Expect import ch.tutteli.atrium.creating.ExperimentalComponentFactoryContainer @@ -13,7 +15,6 @@ import ch.tutteli.atrium.creating.impl.DefaultComponentFactoryContainer import ch.tutteli.atrium.creating.proofs.Proof import ch.tutteli.atrium.creating.proofs.builders.EntryPointProofBuilder import ch.tutteli.atrium.creating.proofs.builders.buildProof -import ch.tutteli.atrium.logic.assertions.impl.LazyThreadUnsafeAssertionGroup import ch.tutteli.atrium.reporting.prerendering.text.OutputNode import ch.tutteli.atrium.reporting.prerendering.text.TextPreRenderControlObject import ch.tutteli.atrium.reporting.prerendering.text.TextPreRenderer @@ -22,15 +23,20 @@ import ch.tutteli.atrium.reporting.reportables.ErrorMessages import ch.tutteli.atrium.reporting.reportables.Icon import ch.tutteli.atrium.reporting.reportables.InlineElement import ch.tutteli.atrium.reporting.reportables.Reportable -import ch.tutteli.atrium.reporting.reportables.descriptions.* +import ch.tutteli.atrium.reporting.reportables.descriptions.DescriptionAnyProof +import ch.tutteli.atrium.reporting.reportables.descriptions.DescriptionCharSequenceProof +import ch.tutteli.atrium.reporting.reportables.descriptions.DescriptionDocumentationUtil +import ch.tutteli.atrium.reporting.reportables.descriptions.DescriptionThrowableProof import ch.tutteli.atrium.reporting.reportables.descriptions.DescriptionThrowableProof.OCCURRED_EXCEPTION_STACKTRACE import ch.tutteli.atrium.reporting.text.TextReporter import ch.tutteli.atrium.reporting.theming.text.StyledString import ch.tutteli.atrium.reporting.theming.text.impl.StringLengthMonospaceLengthCalculator import ch.tutteli.atrium.reporting.theming.text.noStyle -import ch.tutteli.atrium.translations.DescriptionAnyExpectation -import ch.tutteli.atrium.translations.DescriptionCharSequenceExpectation -import ch.tutteli.atrium.translations.DescriptionThrowableExpectation +import ch.tutteli.atrium.reporting.translating.StringBasedTranslatable +import ch.tutteli.atrium.reporting.translating.TranslatableWithArgs +import ch.tutteli.atrium.reporting.translating.Untranslatable +import ch.tutteli.atrium.specs.lineSeparator +import ch.tutteli.atrium.translations.DescriptionBasic import com.github.ajalt.mordant.rendering.AnsiLevel import com.github.ajalt.mordant.rendering.TextColors import com.github.ajalt.mordant.rendering.TextStyle @@ -42,8 +48,8 @@ class CreateReportTest { private val g = TextColors.red("🚩\uFE0F") private val x = TextColors.red("🚫\uFE0F") private val f = TextColors.cyan("▶") - private val i = TextStyle(TextColors.brightBlue, bold = true).invoke("i") - private val d = TextColors.blue("🔎") + private val i = TextStyle(TextColors.brightBlue, bold = true).invoke("ℹ\uFE0F") + private val d = TextColors.blue("🔎\uFE0F") private val u = TextStyle(TextColors.yellow, bold = true).invoke("💡\uFE0F") private val bb = TextColors.red("❗❗") @@ -324,9 +330,9 @@ class CreateReportTest { builder, """ |a verb : 9 - |$i following elements were found :${" "} - | • bla : 1 - | $x bli : 2 + |$i following elements were found :${" "} + | • bla : 1 + | $x bli : 2 |$x to be greater than : 10 """.trimMargin() ) @@ -424,7 +430,7 @@ class CreateReportTest { |(d) properties of unexpected exception :${" "} | • stacktrace :${" "} | • com.example.MyClass:32:8 - | • cause : java.lang.IllegalStateException + | • cause : ${IllegalStateException::class.fullName} | • message : "oho..." """.trimMargin() ) @@ -436,7 +442,7 @@ class CreateReportTest { |$d properties of unexpected exception :${" "} | • stacktrace :${" "} | • com.example.MyClass:32:8 - | • cause : java.lang.IllegalStateException + | • cause : ${IllegalStateException::class.fullName} | • message : "oho..." """.trimMargin() ) @@ -500,7 +506,6 @@ class CreateReportTest { ) } - @Test fun proofExplanation_feature_doesNotShowRepresentation() { val builder = buildRootGroup { @@ -985,7 +990,7 @@ class CreateReportTest { @Test fun mergingColumnsWithAlignment() { - val reportable = Reportable.group( + Reportable.group( Text("description always\n without line break"), "a string with new line\nas representation is broken\nmaxLength calculated correctly", listOf( @@ -1021,12 +1026,12 @@ class CreateReportTest { ExplanatoryAssertionGroup( DefaultExplanatoryAssertionGroupType, listOf( BasicDescriptiveAssertion( - DescriptionThrowableExpectation.OCCURRED_EXCEPTION_MESSAGE, + ch.tutteli.atrium.translations.DescriptionThrowableExpectation.OCCURRED_EXCEPTION_MESSAGE, "bla" ) { true }, BasicAssertionGroup( DefaultListAssertionGroupType, - DescriptionThrowableExpectation.OCCURRED_EXCEPTION_STACKTRACE, + ch.tutteli.atrium.translations.DescriptionThrowableExpectation.OCCURRED_EXCEPTION_STACKTRACE, Text.EMPTY, listOf( BasicExplanatoryAssertion(Text("test")), @@ -1035,18 +1040,18 @@ class CreateReportTest { ), BasicAssertionGroup( DefaultListAssertionGroupType, - DescriptionThrowableExpectation.OCCURRED_EXCEPTION_CAUSE, + ch.tutteli.atrium.translations.DescriptionThrowableExpectation.OCCURRED_EXCEPTION_CAUSE, IllegalStateException("oho.. error occurred"), listOf( ExplanatoryAssertionGroup( DefaultExplanatoryAssertionGroupType, listOf( BasicDescriptiveAssertion( - DescriptionThrowableExpectation.OCCURRED_EXCEPTION_MESSAGE, + ch.tutteli.atrium.translations.DescriptionThrowableExpectation.OCCURRED_EXCEPTION_MESSAGE, "oho.. error occurred" ) { true }, BasicAssertionGroup( DefaultListAssertionGroupType, - DescriptionThrowableExpectation.OCCURRED_EXCEPTION_STACKTRACE, + ch.tutteli.atrium.translations.DescriptionThrowableExpectation.OCCURRED_EXCEPTION_STACKTRACE, Text.EMPTY, listOf( BasicExplanatoryAssertion(Text("some other line")) @@ -1071,7 +1076,7 @@ class CreateReportTest { | » stacktrace :${" "} | • test | • lines - | » cause : java.lang.IllegalStateException + | » cause : ${IllegalStateException::class.fullName} | » message : "oho.. error occurred" | » stacktrace :${" "} | • some other line @@ -1081,15 +1086,15 @@ class CreateReportTest { reportable, """ |verb : 1 - |$i properties of the unknown Exception - | » message : "bla" - | » stacktrace :${" "} - | • test - | • lines - | » cause : java.lang.IllegalStateException - | » message : "oho.. error occurred" - | » stacktrace :${" "} - | • some other line + |$i properties of the unknown Exception + | » message : "bla" + | » stacktrace :${" "} + | • test + | • lines + | » cause : ${IllegalStateException::class.fullName} + | » message : "oho.. error occurred" + | » stacktrace :${" "} + | • some other line """.trimMargin() ) } @@ -1138,10 +1143,13 @@ class CreateReportTest { add( BasicAssertionGroup( DefaultFeatureAssertionGroupType, - DescriptionCharSequenceExpectation.NUMBER_OF_MATCHES, + ch.tutteli.atrium.translations.DescriptionCharSequenceExpectation.NUMBER_OF_MATCHES, Text("3"), listOf( - BasicDescriptiveAssertion(DescriptionAnyExpectation.TO_EQUAL, 0) { false } + BasicDescriptiveAssertion( + ch.tutteli.atrium.translations.DescriptionAnyExpectation.TO_EQUAL, + 0 + ) { false } )) ) } @@ -1164,6 +1172,68 @@ class CreateReportTest { """.trimMargin() ) } +// +// @Suppress("DEPRECATION") +// @Test +// fun fixedClaimAssertion() { +// 0.DefaultRootGroup children: +// 1.FixedClaimAssertionGroup type=ch.tutteli.atrium.assertions.DefaultListAssertionGroupType@f7c700f, description=TO, representation=EXIST, holds=false children: +// 2.ExplanatoryAssertionGroup type=ch.tutteli.atrium.assertions.DefaultExplanatoryAssertionGroupType@62b10d61, description= (Untranslatable), representation=Text(), holds=true children: +// TranslatableWithArgs(translatable=HINT_FOLLOWED_SYMBOLIC_LINK, arguments=[C:\Users\runneradmin\AppData\Local\Temp\spek5297204625390679776\__linkTo_exist, C:\Users\RUNNER~1\AppData\Local\Temp\spek5297204625390679776\startFile\i\dont\exist]) +// 3.ExplanatoryAssertionGroup type=ch.tutteli.atrium.assertions.DefaultExplanatoryAssertionGroupType@62b10d61, description= (Untranslatable), representation=Text(), holds=true children: +// FAILURE_DUE_TO_PARENT: C:\Users\RUNNER~1\AppData\Local\Temp\spek5297204625390679776\startFile (holds=false) +// 4.ExplanatoryAssertionGroup type=ch.tutteli.atrium.assertions.DefaultExplanatoryAssertionGroupType@62b10d61, description= (Untranslatable), representation=Text(), holds=true children: +// TranslatableWithArgs(translatable=FAILURE_DUE_TO_WRONG_FILE_TYPE, arguments=[A_FILE, A_DIRECTORY]) +// +// val builder = buildRootGroup { +// add( +// FixedClaimAssertionGroup( +// DefaultListAssertionGroupType, +// DescriptionBasic.TO, +// object : StringBasedTranslatable { +// override val value: String = "exist" +// override val name: String = "EXIST" +// }, +// listOf( +// ExplanatoryAssertionGroup( +// DefaultExplanatoryAssertionGroupType, +// listOf( +// TranslatableWithArgs( +// Untranslatable("failure at parent path"), +// "C:\\Users\\runneradmin\\AppData\\Local\\Temp\\spek5297204625390679776\\__linkTo_exist", +// "C:\\Users\\RUNNER~1\\AppData\\Local\\Temp\\spek5297204625390679776\\startFile\\i\\dont\\exist" +// ) { +// false +// }, +// ExplanatoryAssertionGroup( +// DefaultExplanatoryAssertionGroupType, +// listOf( +// BasicExplanatoryAssertion( +// TranslatableWithArgs( +// Untranslatable("was %s instead of %s"), Untranslatable("a file"), +// Untranslatable("a directory") +// ) +// ) +// ), +// true +// ) +// ), +// true +// ) +// ), +// false +// ) +// ) +// } +// expectForReporterWithoutAnsi( +// builder, +// """ +// |a verb : "representation" +// |(f) > number of matches : 3 +// | (f) to equal : 0 +// """.trimMargin() +// ) +// } private fun buildRootGroup( verb: InlineElement = Text("a verb"), @@ -1178,7 +1248,7 @@ class CreateReportTest { private fun expectForReporterWithoutAnsi(reportable: Reportable, expectedResult: String) { val reporter = reporterWithoutAnsi() - expect(reporter.createReport(reportable).toString()).toEqual(expectedResult) + expect(reporter.createReport(reportable).toString()).toEqual(modifyLineEnding(expectedResult)) } private fun reporterWithoutAnsi(): TextReporter { @@ -1201,9 +1271,12 @@ class CreateReportTest { private fun expectForReporterWithAnsi(reportable: Reportable, expectedResult: String) { val reporter = componentFactoryContainer().build() val subject = reporter.createReport(reportable).toString() - expect(subject).toEqual(expectedResult) + expect(subject).toEqual(modifyLineEnding(expectedResult)) } + private fun modifyLineEnding(expectedResult: String) = + if (lineSeparator == "\n") expectedResult else Regex("\n").replace(expectedResult, lineSeparator) + private fun componentFactoryContainer() = DefaultComponentFactoryContainer.merge( ComponentFactoryContainerImpl( mapOf( diff --git a/atrium-core/src/commonTest/kotlin/ch/tutteli/atrium/reporting/DefaultInlineDesignatorPreRendererTest.kt b/atrium-core/src/commonTest/kotlin/ch/tutteli/atrium/reporting/DefaultInlineDesignatorPreRendererTest.kt index d9b54da37b..90bd50038a 100644 --- a/atrium-core/src/commonTest/kotlin/ch/tutteli/atrium/reporting/DefaultInlineDesignatorPreRendererTest.kt +++ b/atrium-core/src/commonTest/kotlin/ch/tutteli/atrium/reporting/DefaultInlineDesignatorPreRendererTest.kt @@ -46,12 +46,12 @@ class DefaultInlineDesignatorPreRendererTest { val nonInlineElements = listOf( simpleProof, Proof.group(Text("bla"), "rep", children = listOf(simpleProof)), - Reportable.debugGroup(Text("bla"), emptyList()), - Reportable.failureExplanationGroup(Text("bli"), emptyList()), - Reportable.group(Text("bla"), "rep", children = emptyList()), - Reportable.informationGroup(Text("info"), emptyList()), + Reportable.debugGroup(Text("bla"), listOf(simpleProof)), + Reportable.failureExplanationGroup(Text("bli"), listOf(simpleProof)), + Reportable.group(Text("bla"), "rep", children = listOf(simpleProof)), + Reportable.informationGroup(Text("info"), listOf(simpleProof)), Reportable.proofExplanation(simpleProof), - Reportable.usageHintGroup(emptyList()), + Reportable.usageHintGroup(listOf(simpleProof)), ) //TODO 1.3.0 switch to testFactory expectGrouped { diff --git a/atrium-core/src/commonTest/kotlin/ch/tutteli/atrium/reporting/TextExplanatoryAssertionGroupFormatterSpec.kt b/atrium-core/src/commonTest/kotlin/ch/tutteli/atrium/reporting/TextExplanatoryAssertionGroupFormatterSpec.kt index 766bea71ef..94708e3b20 100644 --- a/atrium-core/src/commonTest/kotlin/ch/tutteli/atrium/reporting/TextExplanatoryAssertionGroupFormatterSpec.kt +++ b/atrium-core/src/commonTest/kotlin/ch/tutteli/atrium/reporting/TextExplanatoryAssertionGroupFormatterSpec.kt @@ -1,3 +1,6 @@ +//TODO 2.0.0 remove +@file:Suppress("DEPRECATION") + package ch.tutteli.atrium.reporting import ch.tutteli.atrium.assertions.BulletPointIdentifier diff --git a/atrium-core/src/commonTest/kotlin/ch/tutteli/atrium/reporting/TextSpec.kt b/atrium-core/src/commonTest/kotlin/ch/tutteli/atrium/reporting/TextSpec.kt index 7d2fcae2b3..65895d3718 100644 --- a/atrium-core/src/commonTest/kotlin/ch/tutteli/atrium/reporting/TextSpec.kt +++ b/atrium-core/src/commonTest/kotlin/ch/tutteli/atrium/reporting/TextSpec.kt @@ -12,7 +12,7 @@ class TextSpec : Spek({ expect{ Text("") }.toThrow { - messageToContain("use Text.Empty instead") + messageToContain("use Text.EMPTY instead") } } diff --git a/atrium-core/src/commonTest/kotlin/ch/tutteli/atrium/reporting/text/BulletPointProviderSpec.kt b/atrium-core/src/commonTest/kotlin/ch/tutteli/atrium/reporting/text/BulletPointProviderSpec.kt deleted file mode 100644 index 20c1b0f4d1..0000000000 --- a/atrium-core/src/commonTest/kotlin/ch/tutteli/atrium/reporting/text/BulletPointProviderSpec.kt +++ /dev/null @@ -1,126 +0,0 @@ -//TODO 2.0.0 remove file -@file:Suppress("DEPRECATION") - -package ch.tutteli.atrium.reporting.text - -import ch.tutteli.atrium.api.infix.en_GB.* -import ch.tutteli.atrium.api.verbs.internal.expect -import ch.tutteli.atrium.assertions.* -import ch.tutteli.atrium.assertions.builders.assertionBuilder -import ch.tutteli.atrium.creating.Expect -import ch.tutteli.atrium.creating.ExperimentalComponentFactoryContainer -import ch.tutteli.atrium.logic.* -import ch.tutteli.atrium.specs.defaultBulletPoints -import org.spekframework.spek2.Spek -import org.spekframework.spek2.style.specification.describe -import kotlin.reflect.KClass - -@OptIn(ExperimentalWithOptions::class) -@ExperimentalComponentFactoryContainer -class BulletPointProviderSpec : Spek({ - - fun expectWitNewBulletPoint(newBulletPoint: Pair, String>, t: T) = - expect(t).withOptions { - withComponent(BulletPointProvider::class) { _ -> - object : BulletPointProvider { - override fun getBulletPoints(): Map, String> = - mapOf(newBulletPoint) - } - } - } - - describe("specifying a provider allows to override bullet points") { - val redefinedBulletPoints = - mapOf, Pair, String>) -> Expect<*>>>( - RootAssertionGroupType::class to ("* " to { p -> - expectWitNewBulletPoint(p, "a") toEqual "b" - }), - ListAssertionGroupType::class to ("- " to { p -> - expectWitNewBulletPoint(p, "a")._logic.appendAsGroup { - _logic.append( - assertionBuilder.list - .withDescriptionAndEmptyRepresentation("hello") - .withAssertion(_logic.toBe("b")).build() - ) - } - }), - FeatureAssertionGroupType::class to (">> " to { p -> - expectWitNewBulletPoint(p, "a") feature { f("m", it.length) } toEqual 2 - }), - PrefixFeatureAssertionGroupHeader::class to ("=> " to { p -> - expectWitNewBulletPoint(p, "a") feature { f("m", it.length) } toEqual 2 - }), - PrefixSuccessfulSummaryAssertion::class to ("(/) " to { p -> - expectWitNewBulletPoint(p, listOf(1)) toContainExactly values(1, 2) - }), - PrefixFailingSummaryAssertion::class to ("(x) " to { p -> - expectWitNewBulletPoint(p, listOf(1)) toContainExactly 2 - }), - ExplanatoryAssertionGroupType::class to (">> " to { p -> - expectWitNewBulletPoint(p, "a")._logic.appendAsGroup { - _logic.append( - assertionBuilder.explanatoryGroup - .withDefaultType - .withAssertion(_logic.toBe("b")) - .failing - .build() - ) - } - }), - WarningAssertionGroupType::class to ("(!) " to { p -> - expectWitNewBulletPoint(p, "a")._logic.appendAsGroup { - _logic.append( - assertionBuilder.explanatoryGroup - .withWarningType - .withAssertion(_logic.toBe("b")) - .failing - .build() - ) - } - }), - InformationAssertionGroupType::class to ("(i) " to { p -> - expectWitNewBulletPoint(p, "a")._logic.appendAsGroup { - _logic.append( - assertionBuilder.explanatoryGroup - .withInformationType(withIndent = false) - .withAssertion(_logic.toBe("b")) - .failing - .build() - ) - } - }), - HintAssertionGroupType::class to ("(h) " to { p -> - expectWitNewBulletPoint(p, "a")._logic.appendAsGroup { - _logic.append( - assertionBuilder.explanatoryGroup - .withHintType - .withAssertion(_logic.toBe("b")) - .failing - .build() - ) - } - }), - GroupingAssertionGroupType::class to ("== " to { p -> - expectWitNewBulletPoint(p, listOf(1)).group("a group") { - toContain(2) - } - }), - ) - - defaultBulletPoints.map { (kClass, defaultBulletPoint) -> - it("redefining ${kClass.simpleName}") { - val (newBulletPoint, expectBuilder) = redefinedBulletPoints.getOrElse(kClass) { - throw AssertionError("case not covered") - } - expect { - expectBuilder(kClass to newBulletPoint) - }.toThrow { - message { - toContain(newBulletPoint) - notToContain(defaultBulletPoint) - } - } - } - } - } -}) diff --git a/atrium-core/src/jsTest/kotlin/ch/tutteli/atrium/reporting/erroradjusters/AdjustStackTest.kt b/atrium-core/src/jsTest/kotlin/ch/tutteli/atrium/reporting/erroradjusters/AdjustStackTest.kt index 4de267512f..3fbcaf1ce6 100644 --- a/atrium-core/src/jsTest/kotlin/ch/tutteli/atrium/reporting/erroradjusters/AdjustStackTest.kt +++ b/atrium-core/src/jsTest/kotlin/ch/tutteli/atrium/reporting/erroradjusters/AdjustStackTest.kt @@ -97,7 +97,7 @@ class AdjustStackTest { @ExperimentalComponentFactoryContainer @Test fun removeAtrium_containsMochaButNotAtriumInCause() { - val adjuster = assertRemoveAtrium(1)._logic.components.build() + val adjuster = assertRemoveAtrium(1)._core.components.build() expectWithNoOpErrorAdjuster(adjuster).toBeAnInstanceOf() val throwable = IllegalArgumentException("hello", UnsupportedOperationException("world")) adjuster.adjust(throwable) diff --git a/atrium-core/src/jvmMain/kotlin/ch/tutteli/atrium/reporting/AtriumErrorJvm.kt b/atrium-core/src/jvmMain/kotlin/ch/tutteli/atrium/reporting/AtriumErrorJvm.kt index 58b214b795..c1a6c9b2b1 100644 --- a/atrium-core/src/jvmMain/kotlin/ch/tutteli/atrium/reporting/AtriumErrorJvm.kt +++ b/atrium-core/src/jvmMain/kotlin/ch/tutteli/atrium/reporting/AtriumErrorJvm.kt @@ -1,68 +1,60 @@ package ch.tutteli.atrium.reporting import ch.tutteli.atrium.core.polyfills.fullName +import ch.tutteli.atrium.creating.proofs.FeatureProofGroup import ch.tutteli.atrium.creating.proofs.Proof +import ch.tutteli.atrium.creating.proofs.ProofGroup +import ch.tutteli.atrium.creating.proofs.ProofGroupWithDesignation import ch.tutteli.atrium.creating.proofs.RootProofGroup import ch.tutteli.atrium.creating.proofs.SimpleProof +import ch.tutteli.atrium.reporting.reportables.ReportableWithDesignation import ch.tutteli.atrium.reporting.reportables.descriptions.DescriptionAnyProof import ch.tutteli.kbox.takeIf import org.opentest4j.AssertionFailedError private const val poweredByAtrium = "\n\n===================== powered by Atrium" -fun extractExpected(causingProof: Proof): Any? = +private fun extractExpected(causingProof: Proof): Any? = when (causingProof) { - is RootProofGroup -> takeIf(causingProof.proofs.size == 1) { - @Suppress("DEPRECATION") - when (val first = causingProof.proofs.first()) { - is SimpleProof -> - takeIf(first.description == DescriptionAnyProof.TO_EQUAL) { - first.representation.toString() - } - - is ch.tutteli.atrium.assertions.BasicDescriptiveAssertion -> - takeIf(first.description.getDefault() == "to equal") { - first.representation.toString() - } - - else -> null - }?.let { - if (it.contains("\n").not()) { - it + poweredByAtrium - } else it - } - } - + is RootProofGroup -> isSingleToEqualExpectation(causingProof) { _, proof -> proof.representation.toString() } else -> null } -fun extractActual(causingProof: Proof): Any? = +private fun extractActual(causingProof: Proof): Any? = when (causingProof) { - is RootProofGroup -> takeIf(causingProof.proofs.size == 1) { - @Suppress("DEPRECATION") - when (val first = causingProof.proofs.first()) { - is SimpleProof -> - takeIf(first.description == DescriptionAnyProof.TO_EQUAL) { - causingProof.representation.toString() - } - - is ch.tutteli.atrium.assertions.BasicDescriptiveAssertion -> - takeIf(first.description.getDefault() == "to equal") { - causingProof.representation.toString() - } - - else -> null - }?.let { - if (it.contains("\n").not()) { - it + poweredByAtrium - } else it - } - } - + is RootProofGroup -> isSingleToEqualExpectation(causingProof) { group, _ -> group.representation.toString() } else -> null } + +@Suppress("DEPRECATION") +private fun isSingleToEqualExpectation( + causingProof: ProofGroupWithDesignation, + extractor: (causingProof: ProofGroupWithDesignation, proof: ReportableWithDesignation) -> String +): String? = + causingProof.proofs.singleOrNull { it.holds().not() }?.let { first -> + when (first) { + is SimpleProof -> + takeIf(first.description == DescriptionAnyProof.TO_EQUAL) { + extractor(causingProof, first) + } + + is ch.tutteli.atrium.assertions.BasicDescriptiveAssertion -> + takeIf(first.description.getDefault() == "to equal") { + extractor(causingProof, first) + } + + is FeatureProofGroup -> isSingleToEqualExpectation(first, extractor) + else -> null + }?.let { + if (it.contains("\n").not()) { + it + poweredByAtrium + } else it + } + } + + actual typealias AssertionErrorLikeIntermediate = java.lang.AssertionError actual typealias AssertionErrorLike = AssertionFailedError diff --git a/atrium-core/src/jvmTest/kotlin/ch/tutteli/atrium/reporting/erroradjusters/AdjustStackSpec.kt b/atrium-core/src/jvmTest/kotlin/ch/tutteli/atrium/reporting/erroradjusters/AdjustStackSpec.kt index 66bd8104a1..5b2925c969 100644 --- a/atrium-core/src/jvmTest/kotlin/ch/tutteli/atrium/reporting/erroradjusters/AdjustStackSpec.kt +++ b/atrium-core/src/jvmTest/kotlin/ch/tutteli/atrium/reporting/erroradjusters/AdjustStackSpec.kt @@ -1,17 +1,15 @@ package ch.tutteli.atrium.reporting.erroradjusters +import ch.tutteli.atrium._core import ch.tutteli.atrium.api.infix.en_GB.* import ch.tutteli.atrium.api.verbs.internal.expect import ch.tutteli.atrium.core.ExperimentalNewExpectTypes import ch.tutteli.atrium.core.polyfills.stackBacktrace -import ch.tutteli.atrium.creating.ComponentFactoryContainer -import ch.tutteli.atrium.creating.Expect -import ch.tutteli.atrium.creating.ExperimentalComponentFactoryContainer -import ch.tutteli.atrium.creating.build -import ch.tutteli.atrium.logic._logic +import ch.tutteli.atrium.creating.* import ch.tutteli.atrium.logic.creating.RootExpectBuilder import ch.tutteli.atrium.logic.utils.expectLambda import ch.tutteli.atrium.reporting.AtriumErrorAdjuster +import ch.tutteli.atrium.reporting.reportables.Reportable import org.spekframework.spek2.Spek import org.spekframework.spek2.style.specification.describe @@ -26,7 +24,7 @@ class AdjustStackSpec : Spek({ } fun expectWithNoOpErrorAdjuster(subject: T, assertionCreator: Expect.() -> Unit): Expect = - expectWithNoOpErrorAdjuster(subject)._logic.appendAsGroup(assertionCreator) + expectWithNoOpErrorAdjuster(subject)._core.appendAsGroupIndicateIfOneCollected(ExpectationCreatorWithUsageHints(usageHintsOverloadWithoutExpectationCreator = listOf(/* ... add a usage hint in case you have an overload which does not expect an expectationCreator */), expectationCreator = assertionCreator)).first describe("no-op adjuster") { fun assertNoOp(subject: T) = @@ -80,7 +78,7 @@ class AdjustStackSpec : Spek({ it("does not contain $containsNot in stackBacktrace of cause, but $contains") { val throwable = IllegalArgumentException("hello", UnsupportedOperationException("world")) - val adjuster = createExpect(1, factory)._logic.components.build() + val adjuster = createExpect(1, factory)._core.components.build() adjuster.adjust(throwable) expectWithNoOpErrorAdjuster(throwable.cause!!.stackBacktrace) { it notToContain o the entries(containsNotFirst, *containsNotRest) @@ -93,7 +91,7 @@ class AdjustStackSpec : Spek({ "hello", UnsupportedOperationException("world", IllegalStateException("and good night")) ) - val adjuster = createExpect(1, factory)._logic.components.build() + val adjuster = createExpect(1, factory)._core.components.build() adjuster.adjust(throwable) expectWithNoOpErrorAdjuster(throwable.cause!!.cause!!.stackBacktrace) { it notToContain o the entries(containsNotFirst, *containsNotRest) @@ -107,7 +105,7 @@ class AdjustStackSpec : Spek({ val throwable = IllegalStateException("with suppressed") throwable.addSuppressed(throwable1) throwable.addSuppressed(throwable2) - val adjuster = createExpect(1, factory)._logic.components.build() + val adjuster = createExpect(1, factory)._core.components.build() adjuster.adjust(throwable) (expectWithNoOpErrorAdjuster(throwable.suppressed) asList o).toHaveElementsAndAll(fun Expect.() { feature { f(it::stackBacktrace) } and { @@ -123,7 +121,7 @@ class AdjustStackSpec : Spek({ val throwable = IllegalStateException("with suppressed") throwable.addSuppressed(throwable1) throwable.addSuppressed(throwable2) - val adjuster = createExpect(1, factory)._logic.components.build() + val adjuster = createExpect(1, factory)._core.components.build() adjuster.adjust(throwable) (expectWithNoOpErrorAdjuster(throwable.suppressed) asList o).toHaveElementsAndAll(fun Expect.() { cause { @@ -186,7 +184,7 @@ class AdjustStackSpec : Spek({ it("stackBacktrace of cause is empty as we filter out everything") { val throwable = IllegalArgumentException("hello", UnsupportedOperationException("world")) - val adjuster = createExpect(1, factory)._logic.components.build() + val adjuster = createExpect(1, factory)._core.components.build() adjuster.adjust(throwable) expectWithNoOpErrorAdjuster(throwable.cause!!.stackBacktrace) toBe empty } @@ -197,7 +195,7 @@ class AdjustStackSpec : Spek({ val throwable = IllegalStateException("with suppressed") throwable.addSuppressed(throwable1) throwable.addSuppressed(throwable2) - val adjuster = createExpect(1, factory)._logic.components.build() + val adjuster = createExpect(1, factory)._core.components.build() adjuster.adjust(throwable) (expectWithNoOpErrorAdjuster(throwable.suppressed) asList o).toHaveElementsAndAll(fun Expect.() { it feature { f(it::stackBacktrace) } toBe empty diff --git a/atrium-core/src/jvmTest/kotlin/ch/tutteli/atrium/reporting/erroradjusters/TestDiff.kt b/atrium-core/src/jvmTest/kotlin/ch/tutteli/atrium/reporting/erroradjusters/TestDiff.kt deleted file mode 100644 index 66454fe465..0000000000 --- a/atrium-core/src/jvmTest/kotlin/ch/tutteli/atrium/reporting/erroradjusters/TestDiff.kt +++ /dev/null @@ -1,27 +0,0 @@ -package ch.tutteli.atrium.reporting.erroradjusters - -import ch.tutteli.atrium.api.infix.en_GB.toEqual -import ch.tutteli.atrium.api.verbs.internal.expect -import org.junit.jupiter.api.Test -import kotlin.test.assertEquals - -class TestDiff { - - @Test - fun foo(){ - expect(1).toEqual(2) - } - - @Test - fun bar(){ - assertEquals(""" - hello - - ====== diff powered by Atrium - """.trimIndent(), """ - world - - ====== diff powered by Atrium - """.trimIndent()) - } -} diff --git a/atrium-core/src/jvmTest/kotlin/ch/tutteli/atrium/reporting/text/TextFeatureAssertionGroupFormatterSpec.kt b/atrium-core/src/jvmTest/kotlin/ch/tutteli/atrium/reporting/text/TextFeatureAssertionGroupFormatterSpec.kt index f20a5457e7..d142da79d7 100644 --- a/atrium-core/src/jvmTest/kotlin/ch/tutteli/atrium/reporting/text/TextFeatureAssertionGroupFormatterSpec.kt +++ b/atrium-core/src/jvmTest/kotlin/ch/tutteli/atrium/reporting/text/TextFeatureAssertionGroupFormatterSpec.kt @@ -1,3 +1,6 @@ +//TODO 2.0.0 remove +@file:Suppress("DEPRECATION") + package ch.tutteli.atrium.reporting.text import ch.tutteli.atrium.assertions.BulletPointIdentifier diff --git a/atrium-core/src/jvmTest/kotlin/ch/tutteli/atrium/reporting/text/TextListAssertionGroupFormatterSpec.kt b/atrium-core/src/jvmTest/kotlin/ch/tutteli/atrium/reporting/text/TextListAssertionGroupFormatterSpec.kt index 993d0a4185..f1367904f6 100644 --- a/atrium-core/src/jvmTest/kotlin/ch/tutteli/atrium/reporting/text/TextListAssertionGroupFormatterSpec.kt +++ b/atrium-core/src/jvmTest/kotlin/ch/tutteli/atrium/reporting/text/TextListAssertionGroupFormatterSpec.kt @@ -1,3 +1,6 @@ +//TODO 2.0.0 remove +@file:Suppress("DEPRECATION") + package ch.tutteli.atrium.reporting.text import ch.tutteli.atrium.assertions.BulletPointIdentifier diff --git a/bundles/fluent/atrium-fluent/src/jvmTest/kotlin/custom/SmokeSpec.kt b/bundles/fluent/atrium-fluent/src/jvmTest/kotlin/custom/SmokeSpec.kt index 51ebaedc5a..80978a6d65 100644 --- a/bundles/fluent/atrium-fluent/src/jvmTest/kotlin/custom/SmokeSpec.kt +++ b/bundles/fluent/atrium-fluent/src/jvmTest/kotlin/custom/SmokeSpec.kt @@ -11,7 +11,7 @@ import ch.tutteli.atrium.creating.proofs.Proof import ch.tutteli.atrium.creating.proofs.builders.buildSimpleProof import ch.tutteli.atrium.reporting.Text import ch.tutteli.atrium.reporting.reportables.Description -import ch.tutteli.atrium.translations.DescriptionBasic.TO_BE +import ch.tutteli.atrium.reporting.reportables.descriptions.DescriptionBasic import org.spekframework.spek2.Spek import java.nio.file.Paths @@ -38,7 +38,7 @@ fun Expect.toBeEven() = _core.createAndAppend("is", Text("an even number")) { it % 2 == 0 } fun Expect.toBeOdd() = - _coreAppend { buildSimpleProof(TO_BE, Text("an odd number")) { it % 2 == 1 } } + _coreAppend { buildSimpleProof(DescriptionBasic.TO_BE, Text("an odd number")) { it % 2 == 1 } } fun Expect.toBeAMultipleOf(base: Int): Expect = _coreAppend { toBeAMultipleOf(base) } diff --git a/bundles/fluent/smoke-tests/atrium-fluent-smoke-test/src/test/kotlin/custom/AssertionSmokeSpec.kt b/bundles/fluent/smoke-tests/atrium-fluent-smoke-test/src/test/kotlin/assertion/AssertionSmokeSpec.kt similarity index 96% rename from bundles/fluent/smoke-tests/atrium-fluent-smoke-test/src/test/kotlin/custom/AssertionSmokeSpec.kt rename to bundles/fluent/smoke-tests/atrium-fluent-smoke-test/src/test/kotlin/assertion/AssertionSmokeSpec.kt index 783e8acb37..1ab63f54dd 100644 --- a/bundles/fluent/smoke-tests/atrium-fluent-smoke-test/src/test/kotlin/custom/AssertionSmokeSpec.kt +++ b/bundles/fluent/smoke-tests/atrium-fluent-smoke-test/src/test/kotlin/assertion/AssertionSmokeSpec.kt @@ -1,7 +1,7 @@ //TODO remove with 2.0.0 @file:Suppress("DEPRECATION") -package custom +package assertion import ch.tutteli.atrium.api.fluent.en_GB.notToExist import ch.tutteli.atrium.api.fluent.en_GB.toEqual @@ -17,7 +17,7 @@ import ch.tutteli.atrium.reporting.translating.StringBasedTranslatable import ch.tutteli.atrium.translations.DescriptionBasic.TO_BE import org.spekframework.spek2.Spek import java.nio.file.Paths -//TODO 1.3.0 SmokeTest with Proof +//TODO 1.3.0 also add SmokeTest with Proof object AssertionSmokeSpec : Spek({ test("see if `toEqual` can be used") { expect(1).toEqual(1) diff --git a/bundles/fluent/smoke-tests/atrium-fluent-smoke-test/src/test/kotlin/proof/ProofSmokeSpec.kt b/bundles/fluent/smoke-tests/atrium-fluent-smoke-test/src/test/kotlin/proof/ProofSmokeSpec.kt new file mode 100644 index 0000000000..188e24eea8 --- /dev/null +++ b/bundles/fluent/smoke-tests/atrium-fluent-smoke-test/src/test/kotlin/proof/ProofSmokeSpec.kt @@ -0,0 +1,14 @@ +package proof + +import ch.tutteli.atrium.api.fluent.en_GB.notToExist +import ch.tutteli.atrium.api.verbs.expect +import org.spekframework.spek2.Spek +import java.nio.file.Paths + +//TODO 1.4.0 switch to kotlin_test note that we need to activate junit for this project otherwise it is not executed +// make it fail and check it is executed as expected. +object ProofSmokeSpec : Spek({ + test("see if `Path.existsNot` can be used") { + expect(Paths.get("nonExisting")).notToExist() + } +}) diff --git a/bundles/infix/atrium-infix/src/commonTest/kotlin/SmokeTest.kt b/bundles/infix/atrium-infix/src/commonTest/kotlin/SmokeTest.kt index 09850be1e7..3ed4dda746 100644 --- a/bundles/infix/atrium-infix/src/commonTest/kotlin/SmokeTest.kt +++ b/bundles/infix/atrium-infix/src/commonTest/kotlin/SmokeTest.kt @@ -21,6 +21,7 @@ class SmokeTest { expect(1) toEqual 1 } + //TODO 1.3.0 naming (also in other SmokeTetss) @Test fun expectationFunctionWithoutI18nCanBeUsed() { expect(2) toBe even @@ -78,7 +79,7 @@ object even object odd infix fun Expect.toBe(@Suppress("UNUSED_PARAMETER") even: even) = - _core.createAndAppend("is", Text("an even number")) { it % 2 == 0 } + _core.createAndAppend("to be", Text("an even number")) { it % 2 == 0 } infix fun Expect.toBe(@Suppress("UNUSED_PARAMETER") odd: odd) = _coreAppend { buildSimpleProof(DescriptionBasic.TO_BE, Text("an odd number")) { it % 2 == 1 } } diff --git a/bundles/infix/atrium-infix/src/jvmTest/kotlin/custom/SmokeSpec.kt b/bundles/infix/atrium-infix/src/jvmTest/kotlin/custom/SmokeSpec.kt deleted file mode 100644 index 96c3974005..0000000000 --- a/bundles/infix/atrium-infix/src/jvmTest/kotlin/custom/SmokeSpec.kt +++ /dev/null @@ -1,50 +0,0 @@ -package custom - -import ch.tutteli.atrium.api.infix.en_GB.toEqual -import ch.tutteli.atrium.api.verbs.expect -import ch.tutteli.atrium.assertions.Assertion -import ch.tutteli.atrium.creating.AssertionContainer -import ch.tutteli.atrium.creating.Expect -import ch.tutteli.atrium.logic._logic -import ch.tutteli.atrium.logic._logicAppend -import ch.tutteli.atrium.logic.createDescriptiveAssertion -import ch.tutteli.atrium.reporting.Text -import ch.tutteli.atrium.reporting.translating.StringBasedTranslatable -import ch.tutteli.atrium.translations.DescriptionBasic.TO_BE -import org.spekframework.spek2.Spek - -object SmokeSpec : Spek({ - test("see if `toEqual` can be used") { - expect(1) toEqual 1 - } - - test("see if own expectation function without i18n can be used") { - expect(2) toBe even - expect(1) toBe odd - } - - test("see if own expectation function with i18n can be used") { - expect(4) toBeMultipleOf 2 - } -}) - -@Suppress("ClassName") -object even -@Suppress("ClassName") -object odd - -infix fun Expect.toBe(@Suppress("UNUSED_PARAMETER") even: even) = - _logic.append(_logic.createDescriptiveAssertion(TO_BE, Text("an even number")) { it % 2 == 0 }) - -infix fun Expect.toBe(@Suppress("UNUSED_PARAMETER") odd: odd) = - _logic.append(_logic.createDescriptiveAssertion(TO_BE, Text("an odd number")) { it % 2 == 1 }) - -infix fun Expect.toBeMultipleOf(base: Int): Expect = _logicAppend { toBeMultipleOf(base) } - -private fun AssertionContainer.toBeMultipleOf(base: Int): Assertion = - createDescriptiveAssertion(DescriptionIntAssertions.TO_BE_MULTIPLE_OF, base) { it % base == 0 } - -enum class DescriptionIntAssertions(override val value: String) : StringBasedTranslatable { - TO_BE_MULTIPLE_OF("to be multiple of") -} - diff --git a/bundles/infix/atrium-infix/src/jvmTest/kotlin/custom/SmokeTest.kt b/bundles/infix/atrium-infix/src/jvmTest/kotlin/custom/SmokeTest.kt new file mode 100644 index 0000000000..820c609b17 --- /dev/null +++ b/bundles/infix/atrium-infix/src/jvmTest/kotlin/custom/SmokeTest.kt @@ -0,0 +1,55 @@ +package custom + +import ch.tutteli.atrium._core +import ch.tutteli.atrium._coreAppend +import ch.tutteli.atrium.api.infix.en_GB.toEqual +import ch.tutteli.atrium.api.verbs.expect +import ch.tutteli.atrium.creating.Expect +import ch.tutteli.atrium.creating.ProofContainer +import ch.tutteli.atrium.creating.proofs.Proof +import ch.tutteli.atrium.creating.proofs.builders.buildSimpleProof +import ch.tutteli.atrium.reporting.Text +import ch.tutteli.atrium.reporting.reportables.Description +import ch.tutteli.atrium.reporting.reportables.descriptions.DescriptionBasic +import kotlin.test.Test + +class SmokeTest { + @Test + fun toEqual_canBeUsed() { + expect(1) toEqual 1 + } + + @Test + fun expectationFunctionWithoutI18nCanBeUsed() { + expect(2) toBe even + expect(1) toBe odd + } + + @Test + fun expectationFunctionWithI18nCanBeUsed() { + expect(4) toBeAMultipleOf 2 + } +} + + + +@Suppress("ClassName") +object even +@Suppress("ClassName") +object odd + +infix fun Expect.toBe(@Suppress("UNUSED_PARAMETER") even: even) = + _core.createAndAppend("to be", Text("an even number")) { it % 2 == 0 } + +infix fun Expect.toBe(@Suppress("UNUSED_PARAMETER") odd: odd) = + _coreAppend { buildSimpleProof(DescriptionBasic.TO_BE, Text("an odd number")) { it % 2 == 1 } } + +infix fun Expect.toBeAMultipleOf(base: Int): Expect = _coreAppend { toBeAMultipleOf(base) } + +private fun ProofContainer.toBeAMultipleOf(base: Int): Proof = + buildSimpleProof(DescriptionIntProofs.TO_BE_MULTIPLE_OF, base) { it % base == 0 } + +enum class DescriptionIntProofs(override val string: String) : Description { + TO_BE_MULTIPLE_OF("to be multiple of") +} + diff --git a/bundles/infix/smoke-tests/atrium-infix-smoke-test/src/test/kotlin/assertion/AssertionSmokeSpec.kt b/bundles/infix/smoke-tests/atrium-infix-smoke-test/src/test/kotlin/assertion/AssertionSmokeSpec.kt new file mode 100644 index 0000000000..69945682b8 --- /dev/null +++ b/bundles/infix/smoke-tests/atrium-infix-smoke-test/src/test/kotlin/assertion/AssertionSmokeSpec.kt @@ -0,0 +1,63 @@ +//TODO remove with 2.0.0 +@file:Suppress("DEPRECATION") + +package assertion + +import ch.tutteli.atrium.api.infix.en_GB.existing +import ch.tutteli.atrium.api.infix.en_GB.notToBe +import ch.tutteli.atrium.api.infix.en_GB.toEqual +import ch.tutteli.atrium.api.verbs.expect +import ch.tutteli.atrium.assertions.Assertion +import ch.tutteli.atrium.creating.AssertionContainer +import ch.tutteli.atrium.creating.Expect +import ch.tutteli.atrium.logic._logic +import ch.tutteli.atrium.logic._logicAppend +import ch.tutteli.atrium.logic.createDescriptiveAssertion +import ch.tutteli.atrium.reporting.Text +import ch.tutteli.atrium.reporting.translating.StringBasedTranslatable +import ch.tutteli.atrium.translations.DescriptionBasic +import org.spekframework.spek2.Spek +import java.nio.file.Paths + +//TODO 1.3.0 also add SmokeTest with Proof +object AssertionSmokeSpec : Spek({ + test("see if `toEqual` can be used") { + expect(1) toEqual 1 + } + + test("see if `Path.existsNot` can be used") { + expect(Paths.get("nonExisting")) notToBe existing + } + + test("see if own expectation function without i18n can be used") { + expect(2) toBe even + expect(1) toBe odd + } + + test("see if own expectation function with i18n can be used") { + expect(4) toBeAMultipleOf 2 + } +}) + + +@Suppress("ClassName") +object even + +@Suppress("ClassName") +object odd + +infix fun Expect.toBe(@Suppress("UNUSED_PARAMETER", "unused") even: even) = + _logic.createAndAppend("to be", Text("an even number")) { it % 2 == 0 } + +infix fun Expect.toBe(@Suppress("UNUSED_PARAMETER", "unused") odd: odd) = + _logic.createAndAppend(DescriptionBasic.TO_BE, Text("an odd number")) { it % 2 == 1 } + +infix fun Expect.toBeAMultipleOf(base: Int): Expect = _logicAppend { toBeAMultipleOf(base) } + +private fun AssertionContainer.toBeAMultipleOf(base: Int): Assertion = + createDescriptiveAssertion(DescriptionIntProofs.TO_BE_MULTIPLE_OF, base) { it % base == 0 } + +enum class DescriptionIntProofs(override val value: String) : StringBasedTranslatable { + TO_BE_MULTIPLE_OF("to be multiple of") +} + diff --git a/bundles/infix/smoke-tests/atrium-infix-smoke-test/src/test/kotlin/custom/SmokeSpec.kt b/bundles/infix/smoke-tests/atrium-infix-smoke-test/src/test/kotlin/custom/SmokeSpec.kt deleted file mode 100644 index 96c3974005..0000000000 --- a/bundles/infix/smoke-tests/atrium-infix-smoke-test/src/test/kotlin/custom/SmokeSpec.kt +++ /dev/null @@ -1,50 +0,0 @@ -package custom - -import ch.tutteli.atrium.api.infix.en_GB.toEqual -import ch.tutteli.atrium.api.verbs.expect -import ch.tutteli.atrium.assertions.Assertion -import ch.tutteli.atrium.creating.AssertionContainer -import ch.tutteli.atrium.creating.Expect -import ch.tutteli.atrium.logic._logic -import ch.tutteli.atrium.logic._logicAppend -import ch.tutteli.atrium.logic.createDescriptiveAssertion -import ch.tutteli.atrium.reporting.Text -import ch.tutteli.atrium.reporting.translating.StringBasedTranslatable -import ch.tutteli.atrium.translations.DescriptionBasic.TO_BE -import org.spekframework.spek2.Spek - -object SmokeSpec : Spek({ - test("see if `toEqual` can be used") { - expect(1) toEqual 1 - } - - test("see if own expectation function without i18n can be used") { - expect(2) toBe even - expect(1) toBe odd - } - - test("see if own expectation function with i18n can be used") { - expect(4) toBeMultipleOf 2 - } -}) - -@Suppress("ClassName") -object even -@Suppress("ClassName") -object odd - -infix fun Expect.toBe(@Suppress("UNUSED_PARAMETER") even: even) = - _logic.append(_logic.createDescriptiveAssertion(TO_BE, Text("an even number")) { it % 2 == 0 }) - -infix fun Expect.toBe(@Suppress("UNUSED_PARAMETER") odd: odd) = - _logic.append(_logic.createDescriptiveAssertion(TO_BE, Text("an odd number")) { it % 2 == 1 }) - -infix fun Expect.toBeMultipleOf(base: Int): Expect = _logicAppend { toBeMultipleOf(base) } - -private fun AssertionContainer.toBeMultipleOf(base: Int): Assertion = - createDescriptiveAssertion(DescriptionIntAssertions.TO_BE_MULTIPLE_OF, base) { it % base == 0 } - -enum class DescriptionIntAssertions(override val value: String) : StringBasedTranslatable { - TO_BE_MULTIPLE_OF("to be multiple of") -} - diff --git a/bundles/infix/smoke-tests/atrium-infix-smoke-test/src/test/kotlin/proof/ProofSmokeSpec.kt b/bundles/infix/smoke-tests/atrium-infix-smoke-test/src/test/kotlin/proof/ProofSmokeSpec.kt new file mode 100644 index 0000000000..82495af109 --- /dev/null +++ b/bundles/infix/smoke-tests/atrium-infix-smoke-test/src/test/kotlin/proof/ProofSmokeSpec.kt @@ -0,0 +1,13 @@ +package proof + +import ch.tutteli.atrium.api.infix.en_GB.existing +import ch.tutteli.atrium.api.infix.en_GB.notToBe +import ch.tutteli.atrium.api.verbs.expect +import org.spekframework.spek2.Spek +import java.nio.file.Paths + +object ProofSmokeSpec : Spek({ + test("see if `Path.existsNot` can be used") { + expect(Paths.get("nonExisting")) notToBe existing + } +}) diff --git a/logic/atrium-logic/src/commonMain/kotlin/ch/tutteli/atrium/logic/creating/iterable/contains/searchbehaviours/impl/InAnyOrderOnlySearchBehaviourImpl.kt b/logic/atrium-logic/src/commonMain/kotlin/ch/tutteli/atrium/logic/creating/iterable/contains/searchbehaviours/impl/InAnyOrderOnlySearchBehaviourImpl.kt index 7a86c743e3..1b4b14e3c7 100644 --- a/logic/atrium-logic/src/commonMain/kotlin/ch/tutteli/atrium/logic/creating/iterable/contains/searchbehaviours/impl/InAnyOrderOnlySearchBehaviourImpl.kt +++ b/logic/atrium-logic/src/commonMain/kotlin/ch/tutteli/atrium/logic/creating/iterable/contains/searchbehaviours/impl/InAnyOrderOnlySearchBehaviourImpl.kt @@ -1,12 +1,11 @@ package ch.tutteli.atrium.logic.creating.iterable.contains.searchbehaviours.impl import ch.tutteli.atrium.logic.creating.iterable.contains.searchbehaviours.InAnyOrderOnlySearchBehaviour -import ch.tutteli.atrium.translations.DescriptionIterableLikeExpectation class InAnyOrderOnlySearchBehaviourImpl : InAnyOrderOnlySearchBehaviour { //TODO 1.3.0 replace with Representable and remove suppression @Suppress("DEPRECATION") override fun decorateDescription(description: ch.tutteli.atrium.reporting.translating.Translatable): ch.tutteli.atrium.reporting.translating.Translatable = - ch.tutteli.atrium.reporting.translating.TranslatableWithArgs(DescriptionIterableLikeExpectation.IN_ANY_ORDER_ONLY, description) + ch.tutteli.atrium.reporting.translating.TranslatableWithArgs(ch.tutteli.atrium.translations.DescriptionIterableLikeExpectation.IN_ANY_ORDER_ONLY, description) } diff --git a/logic/atrium-logic/src/commonMain/kotlin/ch/tutteli/atrium/logic/creating/iterable/contains/searchbehaviours/impl/InAnyOrderSearchBehaviourImpl.kt b/logic/atrium-logic/src/commonMain/kotlin/ch/tutteli/atrium/logic/creating/iterable/contains/searchbehaviours/impl/InAnyOrderSearchBehaviourImpl.kt index 7e473c9296..3e25db6a7d 100644 --- a/logic/atrium-logic/src/commonMain/kotlin/ch/tutteli/atrium/logic/creating/iterable/contains/searchbehaviours/impl/InAnyOrderSearchBehaviourImpl.kt +++ b/logic/atrium-logic/src/commonMain/kotlin/ch/tutteli/atrium/logic/creating/iterable/contains/searchbehaviours/impl/InAnyOrderSearchBehaviourImpl.kt @@ -1,12 +1,11 @@ package ch.tutteli.atrium.logic.creating.iterable.contains.searchbehaviours.impl import ch.tutteli.atrium.logic.creating.iterable.contains.searchbehaviours.InAnyOrderSearchBehaviour -import ch.tutteli.atrium.translations.DescriptionIterableLikeExpectation class InAnyOrderSearchBehaviourImpl : InAnyOrderSearchBehaviour { //TODO 1.3.0 replace with Representable and remove suppression @Suppress("DEPRECATION") override fun decorateDescription(description: ch.tutteli.atrium.reporting.translating.Translatable): ch.tutteli.atrium.reporting.translating.Translatable = - ch.tutteli.atrium.reporting.translating.TranslatableWithArgs(DescriptionIterableLikeExpectation.IN_ANY_ORDER, description) + ch.tutteli.atrium.reporting.translating.TranslatableWithArgs(ch.tutteli.atrium.translations.DescriptionIterableLikeExpectation.IN_ANY_ORDER, description) } diff --git a/logic/atrium-logic/src/commonMain/kotlin/ch/tutteli/atrium/logic/creating/iterable/contains/searchbehaviours/impl/InOrderOnlyGroupedSearchBehaviourImpl.kt b/logic/atrium-logic/src/commonMain/kotlin/ch/tutteli/atrium/logic/creating/iterable/contains/searchbehaviours/impl/InOrderOnlyGroupedSearchBehaviourImpl.kt index 646eb2112b..d54069f510 100644 --- a/logic/atrium-logic/src/commonMain/kotlin/ch/tutteli/atrium/logic/creating/iterable/contains/searchbehaviours/impl/InOrderOnlyGroupedSearchBehaviourImpl.kt +++ b/logic/atrium-logic/src/commonMain/kotlin/ch/tutteli/atrium/logic/creating/iterable/contains/searchbehaviours/impl/InOrderOnlyGroupedSearchBehaviourImpl.kt @@ -1,11 +1,10 @@ package ch.tutteli.atrium.logic.creating.iterable.contains.searchbehaviours.impl import ch.tutteli.atrium.logic.creating.iterable.contains.searchbehaviours.InOrderOnlyGroupedSearchBehaviour -import ch.tutteli.atrium.translations.DescriptionIterableLikeExpectation class InOrderOnlyGroupedSearchBehaviourImpl : InOrderOnlyGroupedSearchBehaviour { //TODO 1.3.0 replace with Representable and remove suppression @Suppress("DEPRECATION") override fun decorateDescription(description: ch.tutteli.atrium.reporting.translating.Translatable): ch.tutteli.atrium.reporting.translating.Translatable = - ch.tutteli.atrium.reporting.translating.TranslatableWithArgs(DescriptionIterableLikeExpectation.IN_ORDER_ONLY_GROUPED, description) + ch.tutteli.atrium.reporting.translating.TranslatableWithArgs(ch.tutteli.atrium.translations.DescriptionIterableLikeExpectation.IN_ORDER_ONLY_GROUPED, description) } diff --git a/logic/atrium-logic/src/commonMain/kotlin/ch/tutteli/atrium/logic/creating/iterable/contains/searchbehaviours/impl/InOrderOnlyGroupedWithinSearchBehaviourImpl.kt b/logic/atrium-logic/src/commonMain/kotlin/ch/tutteli/atrium/logic/creating/iterable/contains/searchbehaviours/impl/InOrderOnlyGroupedWithinSearchBehaviourImpl.kt index 1b2467fd05..0937544191 100644 --- a/logic/atrium-logic/src/commonMain/kotlin/ch/tutteli/atrium/logic/creating/iterable/contains/searchbehaviours/impl/InOrderOnlyGroupedWithinSearchBehaviourImpl.kt +++ b/logic/atrium-logic/src/commonMain/kotlin/ch/tutteli/atrium/logic/creating/iterable/contains/searchbehaviours/impl/InOrderOnlyGroupedWithinSearchBehaviourImpl.kt @@ -1,11 +1,10 @@ package ch.tutteli.atrium.logic.creating.iterable.contains.searchbehaviours.impl import ch.tutteli.atrium.logic.creating.iterable.contains.searchbehaviours.InOrderOnlyGroupedWithinSearchBehaviour -import ch.tutteli.atrium.translations.DescriptionIterableLikeExpectation class InOrderOnlyGroupedWithinSearchBehaviourImpl : InOrderOnlyGroupedWithinSearchBehaviour { //TODO 1.3.0 replace with Representable and remove suppression @Suppress("DEPRECATION") override fun decorateDescription(description: ch.tutteli.atrium.reporting.translating.Translatable): ch.tutteli.atrium.reporting.translating.Translatable = - ch.tutteli.atrium.reporting.translating.TranslatableWithArgs(DescriptionIterableLikeExpectation.IN_ORDER_ONLY_GROUPED, description) + ch.tutteli.atrium.reporting.translating.TranslatableWithArgs(ch.tutteli.atrium.translations.DescriptionIterableLikeExpectation.IN_ORDER_ONLY_GROUPED, description) } diff --git a/logic/atrium-logic/src/commonMain/kotlin/ch/tutteli/atrium/logic/creating/iterable/contains/searchbehaviours/impl/InOrderOnlySearchBehaviourImpl.kt b/logic/atrium-logic/src/commonMain/kotlin/ch/tutteli/atrium/logic/creating/iterable/contains/searchbehaviours/impl/InOrderOnlySearchBehaviourImpl.kt index b041f3f3e1..98da972eba 100644 --- a/logic/atrium-logic/src/commonMain/kotlin/ch/tutteli/atrium/logic/creating/iterable/contains/searchbehaviours/impl/InOrderOnlySearchBehaviourImpl.kt +++ b/logic/atrium-logic/src/commonMain/kotlin/ch/tutteli/atrium/logic/creating/iterable/contains/searchbehaviours/impl/InOrderOnlySearchBehaviourImpl.kt @@ -1,11 +1,10 @@ package ch.tutteli.atrium.logic.creating.iterable.contains.searchbehaviours.impl import ch.tutteli.atrium.logic.creating.iterable.contains.searchbehaviours.InOrderOnlySearchBehaviour -import ch.tutteli.atrium.translations.DescriptionIterableLikeExpectation class InOrderOnlySearchBehaviourImpl : InOrderOnlySearchBehaviour { //TODO 1.3.0 replace with Representable and remove suppression @Suppress("DEPRECATION") override fun decorateDescription(description: ch.tutteli.atrium.reporting.translating.Translatable): ch.tutteli.atrium.reporting.translating.Translatable = - ch.tutteli.atrium.reporting.translating.TranslatableWithArgs(DescriptionIterableLikeExpectation.IN_ORDER_ONLY, description) + ch.tutteli.atrium.reporting.translating.TranslatableWithArgs(ch.tutteli.atrium.translations.DescriptionIterableLikeExpectation.IN_ORDER_ONLY, description) } diff --git a/logic/atrium-logic/src/commonMain/kotlin/ch/tutteli/atrium/logic/creating/iterable/contains/searchbehaviours/impl/InOrderSearchBehaviourImpl.kt b/logic/atrium-logic/src/commonMain/kotlin/ch/tutteli/atrium/logic/creating/iterable/contains/searchbehaviours/impl/InOrderSearchBehaviourImpl.kt index 864f1b8800..2d9cb65cc4 100644 --- a/logic/atrium-logic/src/commonMain/kotlin/ch/tutteli/atrium/logic/creating/iterable/contains/searchbehaviours/impl/InOrderSearchBehaviourImpl.kt +++ b/logic/atrium-logic/src/commonMain/kotlin/ch/tutteli/atrium/logic/creating/iterable/contains/searchbehaviours/impl/InOrderSearchBehaviourImpl.kt @@ -1,11 +1,10 @@ package ch.tutteli.atrium.logic.creating.iterable.contains.searchbehaviours.impl import ch.tutteli.atrium.logic.creating.iterable.contains.searchbehaviours.InOrderSearchBehaviour -import ch.tutteli.atrium.translations.DescriptionIterableLikeExpectation class InOrderSearchBehaviourImpl : InOrderSearchBehaviour { //TODO 1.3.0 replace with Representable and remove suppression @Suppress("DEPRECATION") override fun decorateDescription(description: ch.tutteli.atrium.reporting.translating.Translatable): ch.tutteli.atrium.reporting.translating.Translatable = - ch.tutteli.atrium.reporting.translating.TranslatableWithArgs(DescriptionIterableLikeExpectation.IN_ORDER, description) + ch.tutteli.atrium.reporting.translating.TranslatableWithArgs( ch.tutteli.atrium.translations.DescriptionIterableLikeExpectation.IN_ORDER, description) } diff --git a/logic/atrium-logic/src/commonMain/kotlin/ch/tutteli/atrium/logic/creating/iterable/contains/searchbehaviours/impl/NotSearchBehaviourImpl.kt b/logic/atrium-logic/src/commonMain/kotlin/ch/tutteli/atrium/logic/creating/iterable/contains/searchbehaviours/impl/NotSearchBehaviourImpl.kt index 752a5d7cc3..006ecf5c0f 100644 --- a/logic/atrium-logic/src/commonMain/kotlin/ch/tutteli/atrium/logic/creating/iterable/contains/searchbehaviours/impl/NotSearchBehaviourImpl.kt +++ b/logic/atrium-logic/src/commonMain/kotlin/ch/tutteli/atrium/logic/creating/iterable/contains/searchbehaviours/impl/NotSearchBehaviourImpl.kt @@ -1,12 +1,11 @@ package ch.tutteli.atrium.logic.creating.iterable.contains.searchbehaviours.impl import ch.tutteli.atrium.logic.creating.iterable.contains.searchbehaviours.NotSearchBehaviour -import ch.tutteli.atrium.translations.DescriptionIterableLikeExpectation class NotSearchBehaviourImpl : NotSearchBehaviour { //TODO 1.3.0 replace with Representable and remove suppression @Suppress("DEPRECATION") override fun decorateDescription(description: ch.tutteli.atrium.reporting.translating.Translatable): ch.tutteli.atrium.reporting.translating.Translatable = - DescriptionIterableLikeExpectation.NOT_TO_CONTAIN + ch.tutteli.atrium.translations.DescriptionIterableLikeExpectation.NOT_TO_CONTAIN } diff --git a/logic/atrium-logic/src/commonMain/kotlin/ch/tutteli/atrium/logic/creating/maplike/contains/searchbehaviours/impl/InAnyOrderOnlySearchBehaviourImpl.kt b/logic/atrium-logic/src/commonMain/kotlin/ch/tutteli/atrium/logic/creating/maplike/contains/searchbehaviours/impl/InAnyOrderOnlySearchBehaviourImpl.kt index d114066e6f..9bdce077a3 100644 --- a/logic/atrium-logic/src/commonMain/kotlin/ch/tutteli/atrium/logic/creating/maplike/contains/searchbehaviours/impl/InAnyOrderOnlySearchBehaviourImpl.kt +++ b/logic/atrium-logic/src/commonMain/kotlin/ch/tutteli/atrium/logic/creating/maplike/contains/searchbehaviours/impl/InAnyOrderOnlySearchBehaviourImpl.kt @@ -1,11 +1,10 @@ package ch.tutteli.atrium.logic.creating.maplike.contains.searchbehaviours.impl import ch.tutteli.atrium.logic.creating.maplike.contains.searchbehaviours.InAnyOrderOnlySearchBehaviour -import ch.tutteli.atrium.translations.DescriptionMapLikeExpectation class InAnyOrderOnlySearchBehaviourImpl : InAnyOrderOnlySearchBehaviour { //TODO 1.3.0 replace with Representable and remove suppression @Suppress("DEPRECATION") override fun decorateDescription(description: ch.tutteli.atrium.reporting.translating.Translatable): ch.tutteli.atrium.reporting.translating.Translatable = - ch.tutteli.atrium.reporting.translating.TranslatableWithArgs(DescriptionMapLikeExpectation.IN_ANY_ORDER_ONLY, description) + ch.tutteli.atrium.reporting.translating.TranslatableWithArgs(ch.tutteli.atrium.translations.DescriptionMapLikeExpectation.IN_ANY_ORDER_ONLY, description) } diff --git a/logic/atrium-logic/src/commonMain/kotlin/ch/tutteli/atrium/logic/creating/maplike/contains/searchbehaviours/impl/InAnyOrderSearchBehaviourImpl.kt b/logic/atrium-logic/src/commonMain/kotlin/ch/tutteli/atrium/logic/creating/maplike/contains/searchbehaviours/impl/InAnyOrderSearchBehaviourImpl.kt index fbfb728f25..0bd262c40e 100644 --- a/logic/atrium-logic/src/commonMain/kotlin/ch/tutteli/atrium/logic/creating/maplike/contains/searchbehaviours/impl/InAnyOrderSearchBehaviourImpl.kt +++ b/logic/atrium-logic/src/commonMain/kotlin/ch/tutteli/atrium/logic/creating/maplike/contains/searchbehaviours/impl/InAnyOrderSearchBehaviourImpl.kt @@ -1,11 +1,10 @@ package ch.tutteli.atrium.logic.creating.maplike.contains.searchbehaviours.impl import ch.tutteli.atrium.logic.creating.maplike.contains.searchbehaviours.InAnyOrderSearchBehaviour -import ch.tutteli.atrium.translations.DescriptionMapLikeExpectation class InAnyOrderSearchBehaviourImpl : InAnyOrderSearchBehaviour { //TODO 1.3.0 replace with Representable and remove suppression @Suppress("DEPRECATION") override fun decorateDescription(description: ch.tutteli.atrium.reporting.translating.Translatable): ch.tutteli.atrium.reporting.translating.Translatable = - ch.tutteli.atrium.reporting.translating.TranslatableWithArgs(DescriptionMapLikeExpectation.IN_ANY_ORDER, description) + ch.tutteli.atrium.reporting.translating.TranslatableWithArgs(ch.tutteli.atrium.translations.DescriptionMapLikeExpectation.IN_ANY_ORDER, description) } diff --git a/logic/atrium-logic/src/commonMain/kotlin/ch/tutteli/atrium/logic/creating/maplike/contains/searchbehaviours/impl/InOrderOnlySearchBehaviourImpl.kt b/logic/atrium-logic/src/commonMain/kotlin/ch/tutteli/atrium/logic/creating/maplike/contains/searchbehaviours/impl/InOrderOnlySearchBehaviourImpl.kt index 46df419e57..ff9d92eada 100644 --- a/logic/atrium-logic/src/commonMain/kotlin/ch/tutteli/atrium/logic/creating/maplike/contains/searchbehaviours/impl/InOrderOnlySearchBehaviourImpl.kt +++ b/logic/atrium-logic/src/commonMain/kotlin/ch/tutteli/atrium/logic/creating/maplike/contains/searchbehaviours/impl/InOrderOnlySearchBehaviourImpl.kt @@ -1,11 +1,10 @@ package ch.tutteli.atrium.logic.creating.maplike.contains.searchbehaviours.impl import ch.tutteli.atrium.logic.creating.maplike.contains.searchbehaviours.InOrderOnlySearchBehaviour -import ch.tutteli.atrium.translations.DescriptionMapLikeExpectation class InOrderOnlySearchBehaviourImpl : InOrderOnlySearchBehaviour { //TODO 1.3.0 replace with Representable and remove suppression @Suppress("DEPRECATION") override fun decorateDescription(description: ch.tutteli.atrium.reporting.translating.Translatable): ch.tutteli.atrium.reporting.translating.Translatable = - ch.tutteli.atrium.reporting.translating.TranslatableWithArgs(DescriptionMapLikeExpectation.IN_ORDER_ONLY, description) + ch.tutteli.atrium.reporting.translating.TranslatableWithArgs(ch.tutteli.atrium.translations.DescriptionMapLikeExpectation.IN_ORDER_ONLY, description) } diff --git a/logic/atrium-logic/src/commonMain/kotlin/ch/tutteli/atrium/logic/creating/maplike/contains/searchbehaviours/impl/InOrderSearchBehaviourImpl.kt b/logic/atrium-logic/src/commonMain/kotlin/ch/tutteli/atrium/logic/creating/maplike/contains/searchbehaviours/impl/InOrderSearchBehaviourImpl.kt index fed5c61200..c55bf5d027 100644 --- a/logic/atrium-logic/src/commonMain/kotlin/ch/tutteli/atrium/logic/creating/maplike/contains/searchbehaviours/impl/InOrderSearchBehaviourImpl.kt +++ b/logic/atrium-logic/src/commonMain/kotlin/ch/tutteli/atrium/logic/creating/maplike/contains/searchbehaviours/impl/InOrderSearchBehaviourImpl.kt @@ -1,11 +1,10 @@ package ch.tutteli.atrium.logic.creating.maplike.contains.searchbehaviours.impl import ch.tutteli.atrium.logic.creating.maplike.contains.searchbehaviours.InOrderSearchBehaviour -import ch.tutteli.atrium.translations.DescriptionMapLikeExpectation class InOrderSearchBehaviourImpl : InOrderSearchBehaviour { //TODO 1.3.0 replace with Representable and remove suppression @Suppress("DEPRECATION") override fun decorateDescription(description: ch.tutteli.atrium.reporting.translating.Translatable): ch.tutteli.atrium.reporting.translating.Translatable = - ch.tutteli.atrium.reporting.translating.TranslatableWithArgs(DescriptionMapLikeExpectation.IN_ORDER, description) + ch.tutteli.atrium.reporting.translating.TranslatableWithArgs(ch.tutteli.atrium.translations.DescriptionMapLikeExpectation.IN_ORDER, description) } diff --git a/logic/atrium-logic/src/commonTest/kotlin/ch/tutteli/atrium/logic/creating/EitherSpec.kt b/logic/atrium-logic/src/commonTest/kotlin/ch/tutteli/atrium/logic/creating/EitherSpec.kt index 800f1f2337..3df987034b 100644 --- a/logic/atrium-logic/src/commonTest/kotlin/ch/tutteli/atrium/logic/creating/EitherSpec.kt +++ b/logic/atrium-logic/src/commonTest/kotlin/ch/tutteli/atrium/logic/creating/EitherSpec.kt @@ -36,8 +36,8 @@ object EitherSpec : Spek({ expect(either).toBeRight { toBeLessThan(2) } }.toThrow { messageToContain( - "value of Right: ❗❗ is not a Right", - "${DescriptionComparableExpectation.TO_BE_LESS_THAN.getDefault()}: 2" + "value of Right : ❗❗ is not a Right", + "${DescriptionComparableExpectation.TO_BE_LESS_THAN.getDefault()} : 2" ) } } @@ -51,8 +51,8 @@ object EitherSpec : Spek({ expect(either).toBeLeft { toStartWith("h") } }.toThrow { messageToContain( - "value of Left: ❗❗ is not a Left", - "${DescriptionCharSequenceExpectation.TO_START_WITH.getDefault()}: \"h\"" + "value of Left : ❗❗ is not a Left", + "${DescriptionCharSequenceExpectation.TO_START_WITH.getDefault()} : \"h\"" ) } } diff --git a/logic/atrium-logic/src/jvmMain/kotlin/ch/tutteli/atrium/logic/creating/filesystem/hints/hints.kt b/logic/atrium-logic/src/jvmMain/kotlin/ch/tutteli/atrium/logic/creating/filesystem/hints/hints.kt index e73d0be887..a480b6182d 100644 --- a/logic/atrium-logic/src/jvmMain/kotlin/ch/tutteli/atrium/logic/creating/filesystem/hints/hints.kt +++ b/logic/atrium-logic/src/jvmMain/kotlin/ch/tutteli/atrium/logic/creating/filesystem/hints/hints.kt @@ -169,7 +169,7 @@ fun AssertionContainer<*>.findHintForProblemWithParent(path: Path): Assertion? { explanation = hintForNotDirectory(attributes.fileType) ) } - } catch (e: AccessDeniedException) { + } catch (_: AccessDeniedException) { return hintForParentFailure( currentParentPart.parent, explanation = hintForAccessDenied(currentParentPart.parent) @@ -221,7 +221,7 @@ fun hintForAccessDenied(path: Path): Assertion { assertionBuilder.explanatoryGroup.withDefaultType .withAssertions(hints) .build() - } catch (e: IOException) { + } catch (_: IOException) { failureDueToAccessDeniedHint } } @@ -381,7 +381,7 @@ fun hintForClosestExistingParent(path: Path): Assertion { explanation = hintForNotDirectory(testPathAttributes.fileType) ) } - } catch (e: NoSuchFileException) { + } catch (_: NoSuchFileException) { /* continue searching. Any other IOException should not occur because [path] does not exist */ } testPath = testPath.parent @@ -391,7 +391,7 @@ fun hintForClosestExistingParent(path: Path): Assertion { private fun hintForExistingParentDirectory(parent: Path?) = assertionBuilder.explanatory - .withExplanation(HINT_CLOSEST_EXISTING_PARENT_DIRECTORY, parent ?: DescriptionBasic.NONE) + .withExplanation(HINT_CLOSEST_EXISTING_PARENT_DIRECTORY, parent?.toRealPath() ?: DescriptionBasic.NONE) .build() //TODO 1.3.0 remove suppress again, use InlineElement instead diff --git a/logic/atrium-logic/src/jvmTest/kotlin/ch/tutteli/atrium/logic/utils/NullableSpec.kt b/logic/atrium-logic/src/jvmTest/kotlin/ch/tutteli/atrium/logic/utils/NullableSpec.kt index 23d36aaf0c..ee61654c1a 100644 --- a/logic/atrium-logic/src/jvmTest/kotlin/ch/tutteli/atrium/logic/utils/NullableSpec.kt +++ b/logic/atrium-logic/src/jvmTest/kotlin/ch/tutteli/atrium/logic/utils/NullableSpec.kt @@ -4,7 +4,12 @@ import ch.tutteli.atrium.api.fluent.en_GB.* import ch.tutteli.atrium.api.verbs.internal.expect import ch.tutteli.atrium.logic.Test import ch.tutteli.atrium.specs.describeFunTemplate +import ch.tutteli.atrium.specs.f +import ch.tutteli.atrium.specs.g +import ch.tutteli.atrium.specs.indentF +import ch.tutteli.atrium.specs.indentG import ch.tutteli.atrium.specs.toEqualDescr +import ch.tutteli.atrium.specs.x import org.spekframework.spek2.Spek import org.spekframework.spek2.style.specification.Suite import kotlin.reflect.KFunction1 @@ -103,7 +108,14 @@ object NullableSpec : Spek({ it("throws if the value was actually null") { expect { expect(nullableKeyMap(testee.numbersWithString)).getExisting(1).toEqual("a") - }.toThrow { messageToContain("get(1): null", "$toEqualDescr: \"a\"") } + }.toThrow { + message { + toContainRegex( + "\\Q$g${f}get(1)\\E\\s+: null", + "$indentG$indentF$x$toEqualDescr\\s+: \"a\"" + ) + } + } } it("can pass `null` as key") { expect(nullableKeyMap(testee.numbersWithString)[null]).toEqual("tada") @@ -122,10 +134,12 @@ object NullableSpec : Spek({ expect { expect(nullableValueMap(testee.numbersWithString)).getExisting(1).toEqual("test") }.toThrow { - messageToContain( - "get(1): null", - "$toEqualDescr: \"test\"" - ) + message { + toContainRegex( + "\\Q$g${f}get(1)\\E\\s+: null", + "$indentG$indentF$x$toEqualDescr\\s+: \"test\"" + ) + } } } @@ -142,10 +156,12 @@ object NullableSpec : Spek({ expect { expect(nullableKeyValueMap(testee.numbersWithString)).getExisting(1).toEqual("hello") }.toThrow { - messageToContain( - "get(1): null", - "$toEqualDescr: \"hello\"" - ) + message { + toContainRegex( + "\\Q$g${f}get(1)\\E\\s+: null", + "$indentG$indentF$x$toEqualDescr\\s+: \"hello\"" + ) + } } } diff --git a/misc/atrium-specs/src/commonMain/kotlin/ch/tutteli/atrium/specs/defaultBulletPoints.kt b/misc/atrium-specs/src/commonMain/kotlin/ch/tutteli/atrium/specs/defaultBulletPoints.kt index 94825dc7ec..6e82906162 100644 --- a/misc/atrium-specs/src/commonMain/kotlin/ch/tutteli/atrium/specs/defaultBulletPoints.kt +++ b/misc/atrium-specs/src/commonMain/kotlin/ch/tutteli/atrium/specs/defaultBulletPoints.kt @@ -10,7 +10,7 @@ const val s = "✔ " const val g = "🚩\uFE0F " const val x = "🚫\uFE0F " const val f = "▶ " -const val i = "i\uFE0F " +const val i = "ℹ\uFE0F " const val d = "🔎\uFE0F" const val u = "💡\uFE0F " const val bb = "❗❗ " @@ -24,11 +24,12 @@ val indentExplanatory = " ".repeat(explanatoryBulletPoint.length) val indentFeature = " ".repeat(featureBulletPoint.length) -val indentSuccess = " ".repeat(s.length) +val indentS = " ".repeat(s.length) val indentG = " ".repeat(3) val indentGg = "$indentG$indentG" val indentX = " ".repeat(3) val indentF = " ".repeat(f.length) +val indentI = " ".repeat(3) val indentBb = " ".repeat(4) val indentGrouping = " ".repeat(4) diff --git a/misc/atrium-specs/src/commonMain/kotlin/ch/tutteli/atrium/specs/integration/ArrayAsListExpectationsSpec.kt b/misc/atrium-specs/src/commonMain/kotlin/ch/tutteli/atrium/specs/integration/ArrayAsListExpectationsSpec.kt index 74bd8813f6..64001606f2 100644 --- a/misc/atrium-specs/src/commonMain/kotlin/ch/tutteli/atrium/specs/integration/ArrayAsListExpectationsSpec.kt +++ b/misc/atrium-specs/src/commonMain/kotlin/ch/tutteli/atrium/specs/integration/ArrayAsListExpectationsSpec.kt @@ -5,8 +5,8 @@ import ch.tutteli.atrium.api.fluent.en_GB.toContainExactly import ch.tutteli.atrium.api.verbs.internal.expect import ch.tutteli.atrium.creating.Expect import ch.tutteli.atrium.logic.utils.expectLambda +import ch.tutteli.atrium.reporting.reportables.descriptions.DescriptionIterableLikeProof import ch.tutteli.atrium.specs.* -import ch.tutteli.atrium.translations.DescriptionIterableLikeExpectation import org.spekframework.spek2.Spek import org.spekframework.spek2.style.specification.describe @@ -80,7 +80,7 @@ abstract class ArrayAsListExpectationsSpec( fun doubles(vararg doubles: Double) = doubles fun booleans(vararg booleans: Boolean) = booleans - val anElementWhichEquals = DescriptionIterableLikeExpectation.AN_ELEMENT_WHICH_EQUALS.getDefault() + val anElementWhichEquals = DescriptionIterableLikeProof.AN_ELEMENT_WHICH_EQUALS.string include(object : AssertionCreatorSpec>( "$describePrefix[arr] ", arrayOf(1), assertionCreatorSpecTriple( diff --git a/misc/atrium-specs/src/commonMain/kotlin/ch/tutteli/atrium/specs/integration/FloatingPointWithErrorToleranceExpectationsSpec.kt b/misc/atrium-specs/src/commonMain/kotlin/ch/tutteli/atrium/specs/integration/FloatingPointWithErrorToleranceExpectationsSpec.kt index f777aa2314..a4c1dcd908 100644 --- a/misc/atrium-specs/src/commonMain/kotlin/ch/tutteli/atrium/specs/integration/FloatingPointWithErrorToleranceExpectationsSpec.kt +++ b/misc/atrium-specs/src/commonMain/kotlin/ch/tutteli/atrium/specs/integration/FloatingPointWithErrorToleranceExpectationsSpec.kt @@ -11,8 +11,7 @@ import ch.tutteli.atrium.core.polyfills.fullName import ch.tutteli.atrium.specs.Fun2 import ch.tutteli.atrium.specs.SubjectLessSpec import ch.tutteli.atrium.specs.forSubjectLess -import ch.tutteli.atrium.translations.DescriptionFloatingPointException -import ch.tutteli.atrium.translations.DescriptionFloatingPointException.* +import ch.tutteli.atrium.reporting.reportables.descriptions.DescriptionFloatingPointProof.* import org.spekframework.spek2.Spek import org.spekframework.spek2.dsl.Root import org.spekframework.spek2.style.specification.describe @@ -82,15 +81,15 @@ fun Root.checkFloatingPoint( } } - val toEqualInclErrorToleranceDescr = TO_EQUAL_WITH_ERROR_TOLERANCE.getDefault().format(tolerance) - val failureNotice = FAILURE_DUE_TO_FLOATING_POINT_NUMBER.getDefault().format(subject::class.fullName) + val toEqualInclErrorToleranceDescr = TO_EQUAL_WITH_ERROR_TOLERANCE.string.format(tolerance) + val failureNotice = FAILURE_DUE_TO_FLOATING_POINT_NUMBER.string.format(subject::class.fullName) failing.forEach { num -> it("... compare to $num throws AssertionError") { expect { expect(subject).toEqualWithErrorTolerance(num, tolerance) }.toThrow { message { - val exactCheck = TO_EQUAL_WITH_ERROR_TOLERANCE_EXPLAINED.getDefault().format( + val exactCheck = TO_EQUAL_WITH_ERROR_TOLERANCE_EXPLAINED.string.format( @Suppress("DEPRECATION") formatFloatingPointNumber(subject), @Suppress("DEPRECATION") diff --git a/misc/atrium-specs/src/commonMain/kotlin/ch/tutteli/atrium/specs/integration/Fun0ExpectationsSpec.kt b/misc/atrium-specs/src/commonMain/kotlin/ch/tutteli/atrium/specs/integration/Fun0ExpectationsSpec.kt index e39c3d079b..18d8e7d1d9 100644 --- a/misc/atrium-specs/src/commonMain/kotlin/ch/tutteli/atrium/specs/integration/Fun0ExpectationsSpec.kt +++ b/misc/atrium-specs/src/commonMain/kotlin/ch/tutteli/atrium/specs/integration/Fun0ExpectationsSpec.kt @@ -81,7 +81,7 @@ abstract class Fun0ExpectationsSpec( } }.toThrow { message { - toContainSubject("() -> kotlin.Int") + toContain("$expectationVerb : ") toContainDescr( DescriptionFunLikeProof.THROWN_EXCEPTION_WHEN_CALLED, DescriptionFunLikeProof.NO_EXCEPTION_OCCURRED.string diff --git a/misc/atrium-specs/src/commonMain/kotlin/ch/tutteli/atrium/specs/integration/GroupingTest.kt b/misc/atrium-specs/src/commonMain/kotlin/ch/tutteli/atrium/specs/integration/GroupingTest.kt index 001e089fef..71df6ece3b 100644 --- a/misc/atrium-specs/src/commonMain/kotlin/ch/tutteli/atrium/specs/integration/GroupingTest.kt +++ b/misc/atrium-specs/src/commonMain/kotlin/ch/tutteli/atrium/specs/integration/GroupingTest.kt @@ -34,12 +34,13 @@ abstract class GroupingTest( } }.toThrow { message { + //TODO 1.3.0 should use groupingIcon toContainRegex( - "${groupingBulletPoint}my group name: 123.*$lineSeparator" + - "${indentGrouping}$rootBulletPoint$toEqualDescr: 2.*$lineSeparator" + - "${indentGrouping}$rootBulletPoint$toBeGreaterThanDescr: 4" + "${g}my group name\\s+: 123.*$lineSeparator" + + "$indentG$x$toEqualDescr\\s+: 2$lineSeparator" + + "$indentG$x$toBeGreaterThanDescr : 4" ) - notToContain("$rootBulletPoint$toBeLessThanDescr: 10") + notToContain.regex("$x$toBeLessThanDescr\\s+: 10") } } } @@ -71,12 +72,12 @@ abstract class GroupingTest( }.toThrow { message { toContainRegex( - "${groupingBulletPoint}my group name: 123.*$lineSeparator" + - "${indentGrouping}$rootBulletPoint$toEqualDescr: 2.*$lineSeparator" + - "${indentGrouping}${groupingBulletPoint}other name: \"hello\".*$lineSeparator" + - "${indentGrouping}${indentGrouping}$rootBulletPoint$toBeGreaterThanDescr: 4" + "${g}my group name\\s+: 123.*$lineSeparator" + + "$indentG$x$toEqualDescr\\s+: 2$lineSeparator" + + "$indentG${g}other name\\s+: \"hello\".*$lineSeparator" + + "$indentG$indentG$x$toBeGreaterThanDescr : 4" ) - notToContain("$rootBulletPoint$toBeLessThanDescr: 10") + notToContain.regex("$rootBulletPoint$toBeLessThanDescr\\s+: 10") } } } diff --git a/misc/atrium-specs/src/commonMain/kotlin/ch/tutteli/atrium/specs/integration/IterableNotToContainEntriesExpectationsSpec.kt b/misc/atrium-specs/src/commonMain/kotlin/ch/tutteli/atrium/specs/integration/IterableNotToContainEntriesExpectationsSpec.kt index bb5b41289b..bc3158c7a2 100644 --- a/misc/atrium-specs/src/commonMain/kotlin/ch/tutteli/atrium/specs/integration/IterableNotToContainEntriesExpectationsSpec.kt +++ b/misc/atrium-specs/src/commonMain/kotlin/ch/tutteli/atrium/specs/integration/IterableNotToContainEntriesExpectationsSpec.kt @@ -6,6 +6,7 @@ import ch.tutteli.atrium.core.polyfills.format import ch.tutteli.atrium.creating.Expect import ch.tutteli.atrium.logic.utils.expectLambda import ch.tutteli.atrium.reporting.reportables.descriptions.DescriptionIterableLikeProof +import ch.tutteli.atrium.reporting.reportables.descriptions.DescriptionIterableLikeProof.USE_NOT_TO_HAVE_ELEMENTS_OR_NONE import ch.tutteli.atrium.specs.* abstract class IterableNotToContainEntriesExpectationsSpec( @@ -71,11 +72,7 @@ abstract class IterableNotToContainEntriesExpectationsSpec( "$indentX$explanatoryBulletPoint$notToContainDescr : $lineSeparator" + "$indentX$indentExplanatory$listBulletPoint$anElementWhichNeedsDescr : $lineSeparator" + "$indentX$indentExplanatory$indentList$explanatoryBulletPoint$toEqualDescr : 4.0$lineSeparator" + - "$indentX$u${ - DescriptionIterableLikeProof.USE_NOT_TO_HAVE_ELEMENTS_OR_NONE.string.format( - notToHaveElementsOrNoneFunName - ) - }" + "$indentX$u${USE_NOT_TO_HAVE_ELEMENTS_OR_NONE.string.format(notToHaveElementsOrNoneFunName)}" ) } } @@ -105,8 +102,8 @@ abstract class IterableNotToContainEntriesExpectationsSpec( "$expectationVerb :.*$lineSeparator" + "\\Q$g\\E$notToContainDescr : $lineSeparator" + "$indentG$g$anElementWhichNeedsDescr : $lineSeparator" + - "$indentGg$explanatoryBulletPoint$toBeGreaterThanDescr : 1.0$lineSeparator" + - "$indentGg$explanatoryBulletPoint$toBeLessThanDescr : 4.0$lineSeparator" + + "$indentGg$explanatoryBulletPoint$toBeGreaterThanDescr\\s+: 1.0$lineSeparator" + + "$indentGg$explanatoryBulletPoint$toBeLessThanDescr\\s+: 4.0$lineSeparator" + "$indentGg$bb$mismatches : $lineSeparator" + "$indentGg${indentBb}$listBulletPoint${mismatchedIndex(1, "2.0")}$lineSeparator" + "$indentGg${indentBb}$listBulletPoint${mismatchedIndex(5, "3.0")}" diff --git a/misc/atrium-specs/src/commonMain/kotlin/ch/tutteli/atrium/specs/integration/IterableNotToContainValuesExpectationsSpec.kt b/misc/atrium-specs/src/commonMain/kotlin/ch/tutteli/atrium/specs/integration/IterableNotToContainValuesExpectationsSpec.kt index ff7280aa5d..740b9f3f4c 100644 --- a/misc/atrium-specs/src/commonMain/kotlin/ch/tutteli/atrium/specs/integration/IterableNotToContainValuesExpectationsSpec.kt +++ b/misc/atrium-specs/src/commonMain/kotlin/ch/tutteli/atrium/specs/integration/IterableNotToContainValuesExpectationsSpec.kt @@ -5,6 +5,7 @@ import ch.tutteli.atrium.api.verbs.internal.expect import ch.tutteli.atrium.core.polyfills.format import ch.tutteli.atrium.creating.Expect import ch.tutteli.atrium.reporting.reportables.descriptions.DescriptionIterableLikeProof +import ch.tutteli.atrium.reporting.reportables.descriptions.DescriptionIterableLikeProof.USE_NOT_TO_HAVE_ELEMENTS_OR_NONE import ch.tutteli.atrium.specs.* import ch.tutteli.atrium.specs.lineSeparator @@ -27,8 +28,6 @@ abstract class IterableNotToContainValuesExpectationsSpec( fun Expect>.notToContainNullableFun(a: Double?, vararg aX: Double?) = notToContainNullableValues(this, a, aX) - val anElementWhichIsWithIndent = "$indentRoot$listBulletPoint$anElementWhichEquals" - nonNullableCases( describePrefix, notToContainValues, @@ -43,19 +42,15 @@ abstract class IterableNotToContainValuesExpectationsSpec( it("4.0 throws AssertionError") { expect { expect(fluentEmpty()).notToContainFun(4.0) - }.toThrow { - message { - toContainRegex( - "${toHaveDescr}\\s+: ${aNextElement}$lineSeparator" + - "$indentRoot\\Q$explanatoryBulletPoint\\E$notToContainDescr: $lineSeparator" + - "$indentList$anElementWhichIsWithIndent: 4.0.*", - "$u${ - DescriptionIterableLikeProof.USE_NOT_TO_HAVE_ELEMENTS_OR_NONE.getDefault() - .format(notToHaveElementsOrNoneFunName) - }" - ) - } - } + }.toThrow().message.toMatch( + Regex( + "$expectationVerb : .+$lineSeparator" + + "\\Q$x\\E${toHaveDescr}\\s+: ${aNextElement}$lineSeparator" + + "$indentG$explanatoryBulletPoint$notToContainDescr\\s+: $lineSeparator" + + "$indentX$indentExplanatory$listBulletPoint$anElementWhichEquals : 4.0$lineSeparator" + + "$indentX$u${USE_NOT_TO_HAVE_ELEMENTS_OR_NONE.string.format(notToHaveElementsOrNoneFunName)}" + ) + ) } } @@ -77,56 +72,44 @@ abstract class IterableNotToContainValuesExpectationsSpec( it("4.0 throws AssertionError") { expect { expect(oneToSeven()).notToContainFun(4.0) - }.toThrow { - message { - toContainRegex( - "\\Q$rootBulletPoint\\E$notToContainDescr: $lineSeparator" + - "$anElementWhichIsWithIndent: 4.0.*$lineSeparator" + - "$afterExplanatoryIndent\\Q$bb$mismatches:\\E $lineSeparator" + - "$afterMismatchedWarning${mismatchedIndex(2, "4.0")}.*$lineSeparator" + - "$afterMismatchedWarning${mismatchedIndex(3, "4.0")}.*$lineSeparator" + - "$afterMismatchedWarning${mismatchedIndex(8, "4.0")}.*" - ) - } - } + }.toThrow().message.toContainRegex( + "\\Q$g\\E$notToContainDescr : $lineSeparator" + + "$indentG\\Q$g\\E$anElementWhichEquals : 4.0$lineSeparator" + + "$indentGg$bb$mismatches : $lineSeparator" + + "$indentGg$indentBb$listBulletPoint${mismatchedIndex(2, "4.0")}$lineSeparator" + + "$indentGg$indentBb$listBulletPoint${mismatchedIndex(3, "4.0")}$lineSeparator" + + "$indentGg$indentBb$listBulletPoint${mismatchedIndex(8, "4.0")}" + ) } it("1.0, 4.0 throws AssertionError") { expect { expect(oneToSeven()).notToContainFun(1.0, 4.0) - }.toThrow { - message { - toContainRegex( - "\\Q$rootBulletPoint\\E$notToContainDescr: $lineSeparator" + - "$anElementWhichIsWithIndent: 1.0.*$lineSeparator" + - "$afterExplanatoryIndent\\Q$bb$mismatches:\\E $lineSeparator" + - "$afterMismatchedWarning${mismatchedIndex(0, "1.0")}.*$lineSeparator" + - "$anElementWhichIsWithIndent: 4.0.*$lineSeparator" + - "$afterExplanatoryIndent\\Q$bb$mismatches:\\E $lineSeparator" + - "$afterMismatchedWarning${mismatchedIndex(2, "4.0")}.*$lineSeparator" + - "$afterMismatchedWarning${mismatchedIndex(3, "4.0")}.*$lineSeparator" + - "$afterMismatchedWarning${mismatchedIndex(8, "4.0")}.*" - ) - } - } + }.toThrow().message.toContainRegex( + "\\Q$g\\E$notToContainDescr : $lineSeparator" + + "$indentG\\Q$g\\E$anElementWhichEquals : 1.0$lineSeparator" + + "$indentGg$bb$mismatches : $lineSeparator" + + "$indentGg$indentBb$listBulletPoint${mismatchedIndex(0, "1.0")}$lineSeparator" + + "$indentG\\Q$g\\E$anElementWhichEquals : 4.0$lineSeparator" + + "$indentGg$bb$mismatches : $lineSeparator" + + "$indentGg$indentBb$listBulletPoint${mismatchedIndex(2, "4.0")}$lineSeparator" + + "$indentGg$indentBb$listBulletPoint${mismatchedIndex(3, "4.0")}$lineSeparator" + + "$indentGg$indentBb$listBulletPoint${mismatchedIndex(8, "4.0")}" + ) } - it("4.0, 1.1 throws AssertionError") { + it("4.0, 1.0 throws AssertionError") { expect { expect(oneToSeven()).notToContainFun(4.0, 1.0) - }.toThrow { - message { - toContainRegex( - "\\Q$rootBulletPoint\\E$notToContainDescr: $lineSeparator" + - "$anElementWhichIsWithIndent: 4.0.*$lineSeparator" + - "$afterExplanatoryIndent\\Q$bb$mismatches:\\E $lineSeparator" + - "$afterMismatchedWarning${mismatchedIndex(2, "4.0")}.*$lineSeparator" + - "$afterMismatchedWarning${mismatchedIndex(3, "4.0")}.*$lineSeparator" + - "$afterMismatchedWarning${mismatchedIndex(8, "4.0")}.*$lineSeparator" + - "$anElementWhichIsWithIndent: 1.0.*$lineSeparator" + - "$afterExplanatoryIndent\\Q$bb$mismatches:\\E $lineSeparator" + - "$afterMismatchedWarning${mismatchedIndex(0, "1.0")}.*" - ) - } - } + }.toThrow().message.toContainRegex( + "\\Q$g\\E$notToContainDescr : $lineSeparator" + + "$indentG\\Q$g\\E$anElementWhichEquals : 4.0$lineSeparator" + + "$indentGg$bb$mismatches : $lineSeparator" + + "$indentGg$indentBb$listBulletPoint${mismatchedIndex(2, "4.0")}$lineSeparator" + + "$indentGg$indentBb$listBulletPoint${mismatchedIndex(3, "4.0")}$lineSeparator" + + "$indentGg$indentBb$listBulletPoint${mismatchedIndex(8, "4.0")}$lineSeparator" + + "$indentG\\Q$g\\E$anElementWhichEquals : 1.0$lineSeparator" + + "$indentGg$bb$mismatches : $lineSeparator" + + "$indentGg$indentBb$listBulletPoint${mismatchedIndex(0, "1.0")}" + ) } } @@ -144,17 +127,14 @@ abstract class IterableNotToContainValuesExpectationsSpec( it("null throws AssertionError") { expect { expect(oneToSevenNullable()).notToContainNullableFun(null) - }.toThrow { - message { - toContainRegex( - "\\Q$rootBulletPoint\\E$notToContainDescr: $lineSeparator" + - "$anElementWhichIsWithIndent: null$lineSeparator" + - "$afterExplanatoryIndent\\Q$bb$mismatches:\\E $lineSeparator" + - "$afterMismatchedWarning${mismatchedIndex(1, "null")}.*$lineSeparator" + - "$afterMismatchedWarning${mismatchedIndex(5, "null")}.*" - ) - } - } + }.toThrow().message.toContainRegex( + "\\Q$g\\E$notToContainDescr : $lineSeparator" + + "$indentG\\Q$g\\E$anElementWhichEquals : null$lineSeparator" + + "$indentGg$bb$mismatches : $lineSeparator" + + //TODO 1.3.0 no need to show the value, we say not to equal null so it is clear the element at those index are null + "$indentGg$indentBb$listBulletPoint${mismatchedIndex(1, "null")}$lineSeparator" + + "$indentGg$indentBb$listBulletPoint${mismatchedIndex(5, "null")}" + ) } it("1.1, null throws AssertionError mentioning only null") { @@ -163,13 +143,14 @@ abstract class IterableNotToContainValuesExpectationsSpec( }.toThrow { message { toContainRegex( - "\\Q$rootBulletPoint\\E$notToContainDescr: $lineSeparator" + - "$anElementWhichIsWithIndent: null$lineSeparator" + - "$afterExplanatoryIndent\\Q$bb$mismatches:\\E $lineSeparator" + - "$afterMismatchedWarning${mismatchedIndex(1, "null")}.*$lineSeparator" + - "$afterMismatchedWarning${mismatchedIndex(5, "null")}.*" + "\\Q$g\\E$notToContainDescr : $lineSeparator" + + "$indentG\\Q$g\\E$anElementWhichEquals : null$lineSeparator" + + "$indentGg$bb$mismatches : $lineSeparator" + + //TODO 1.3.0 no need to show the value, we say not to equal null so it is clear the element at those index are null + "$indentGg$indentBb$listBulletPoint${mismatchedIndex(1, "null")}$lineSeparator" + + "$indentGg$indentBb$listBulletPoint${mismatchedIndex(5, "null")}" ) - notToContain("$notToContainDescr: 1.1") + notToContain.regex("$notToContainDescr\\s+: 1.1") } } } diff --git a/misc/atrium-specs/src/commonMain/kotlin/ch/tutteli/atrium/specs/integration/IterableToContainEntriesSpecBase.kt b/misc/atrium-specs/src/commonMain/kotlin/ch/tutteli/atrium/specs/integration/IterableToContainEntriesSpecBase.kt index 37a01b3473..bc229dd36f 100644 --- a/misc/atrium-specs/src/commonMain/kotlin/ch/tutteli/atrium/specs/integration/IterableToContainEntriesSpecBase.kt +++ b/misc/atrium-specs/src/commonMain/kotlin/ch/tutteli/atrium/specs/integration/IterableToContainEntriesSpecBase.kt @@ -36,7 +36,7 @@ abstract class IterableToContainEntriesSpecBase( fun index(index: Int) = DescriptionIterableLikeProof.INDEX.string.format(index) //@formatter:off - val afterExplanatoryIndent = "$indentRoot$indentList$indentSuccess" + val afterExplanatoryIndent = "$indentRoot$indentList$indentS" val afterExplanatory = "$afterExplanatoryIndent\\Q$explanatoryBulletPoint\\E" val afterMismatchedWarning = "$afterExplanatoryIndent$indentBb\\Q$listBulletPoint\\E" //@formatter:on diff --git a/misc/atrium-specs/src/commonMain/kotlin/ch/tutteli/atrium/specs/integration/IterableToContainInAnyOrderOnlyEntriesExpectationsSpec.kt b/misc/atrium-specs/src/commonMain/kotlin/ch/tutteli/atrium/specs/integration/IterableToContainInAnyOrderOnlyEntriesExpectationsSpec.kt index 65671b7263..b8ff4fa646 100644 --- a/misc/atrium-specs/src/commonMain/kotlin/ch/tutteli/atrium/specs/integration/IterableToContainInAnyOrderOnlyEntriesExpectationsSpec.kt +++ b/misc/atrium-specs/src/commonMain/kotlin/ch/tutteli/atrium/specs/integration/IterableToContainInAnyOrderOnlyEntriesExpectationsSpec.kt @@ -39,8 +39,7 @@ abstract class IterableToContainInAnyOrderOnlyEntriesExpectationsSpec( //@formatter:off - val anEntryAfterSuccess = "$anElementWhichNeedsDescr: $lineSeparator$indentRoot$indentSuccess$indentList$explanatoryBulletPoint" - val anEntryAfterFailing = "$anElementWhichNeedsDescr: $lineSeparator$indentRoot$indentX$indentList$explanatoryBulletPoint" + val anEntryAfterSuccess = "$anElementWhichNeedsDescr : $lineSeparator$indentG$indentS$explanatoryBulletPoint" //@formatter:on nonNullableCases( @@ -61,8 +60,9 @@ abstract class IterableToContainInAnyOrderOnlyEntriesExpectationsSpec( }.toThrow { message { toContain( - "$rootBulletPoint$toContainInAnyOrderOnly:", - "$x$anEntryAfterFailing$toBeLessThanDescr: 1.0" + "$g$toContainInAnyOrderOnly :", + "$indentG$g${anElementWhichNeedsDescr} : $lineSeparator" + + "$indentGg$explanatoryBulletPoint$toBeLessThanDescr : 1.0" ) notToContain(additionalElements) toContainSize(0, 1) @@ -75,9 +75,11 @@ abstract class IterableToContainInAnyOrderOnlyEntriesExpectationsSpec( }.toThrow { message { toContain.exactly(1).values( - "$rootBulletPoint$toContainInAnyOrderOnly:", - "$x$anEntryAfterFailing$toBeLessThanDescr: 1.0", - "$x$anEntryAfterFailing$toBeGreaterThanDescr: 4.0" + "$g$toContainInAnyOrderOnly :", + "$indentG$g${anElementWhichNeedsDescr} : $lineSeparator" + + "$indentGg$explanatoryBulletPoint$toBeLessThanDescr : 1.0$lineSeparator" + + "$indentG$g${anElementWhichNeedsDescr} : $lineSeparator" + + "$indentGg$explanatoryBulletPoint$toBeGreaterThanDescr : 4.0" ) notToContain(additionalElements) toContainSize(0, 2) @@ -145,13 +147,13 @@ abstract class IterableToContainInAnyOrderOnlyEntriesExpectationsSpec( }.toThrow { message { toContain.exactly(1).values( - "$rootBulletPoint$toContainInAnyOrderOnly:", - "$s$anEntryAfterSuccess$toEqualDescr: 1.0", - "$s$anEntryAfterSuccess$toEqualDescr: 2.0", - "$s$anEntryAfterSuccess$toEqualDescr: 3.0", - "$s$anEntryAfterSuccess$toEqualDescr: 4.0", - "$bb$additionalElements:", - "${listBulletPoint}4.0" + "$g$toContainInAnyOrderOnly :", + "$indentG$s$anEntryAfterSuccess$toEqualDescr : 1.0", + "$indentG$s$anEntryAfterSuccess$toEqualDescr : 2.0", + "$indentG$s$anEntryAfterSuccess$toEqualDescr : 3.0", + "$indentG$s$anEntryAfterSuccess$toEqualDescr : 4.0", + "$indentG$bb$additionalElements :", + "$indentG$indentBb${listBulletPoint}4.0" ) toContainSize(5, 4) } @@ -164,13 +166,13 @@ abstract class IterableToContainInAnyOrderOnlyEntriesExpectationsSpec( }.toThrow { message { toContain.exactly(1).values( - "$rootBulletPoint$toContainInAnyOrderOnly:", - "$s$anEntryAfterSuccess$toBeLessThanDescr: 3.0", - "$s$anEntryAfterSuccess$toBeGreaterThanDescr: 3.0", - "$bb$additionalElements:", - "${listBulletPoint}2.0", - "${listBulletPoint}3.0", - "${listBulletPoint}4.0" + "$g$toContainInAnyOrderOnly :", + "$indentG$s$anEntryAfterSuccess$toBeLessThanDescr : 3.0", + "$indentG$s$anEntryAfterSuccess$toBeGreaterThanDescr : 3.0", + "$indentG$bb$additionalElements :", + "$indentG$indentBb${listBulletPoint}2.0", + "$indentG$indentBb${listBulletPoint}3.0", + "$indentG$indentBb${listBulletPoint}4.0" ) toContainSize(5, 2) } @@ -190,13 +192,15 @@ abstract class IterableToContainInAnyOrderOnlyEntriesExpectationsSpec( }.toThrow { message { toContain.exactly(1).values( - "$rootBulletPoint$toContainInAnyOrderOnly:", - "$s$anEntryAfterSuccess$toBeLessThanDescr: 5.0", - "$x$anEntryAfterFailing$toEqualDescr: 1.0", - "$s$anEntryAfterSuccess$toEqualDescr: 2.0", - "$s$anEntryAfterSuccess$toEqualDescr: 3.0", - "$s$anEntryAfterSuccess$toEqualDescr: 4.0", - "$bb$mismatches:", + "$g$toContainInAnyOrderOnly :", + "$s$anEntryAfterSuccess$toBeLessThanDescr : 5.0", + //TODO 1.3.0 should be $x instead of $g + "$g${anElementWhichNeedsDescr} : $lineSeparator" + + "$indentGg$explanatoryBulletPoint$toEqualDescr : 1.0", + "$s$anEntryAfterSuccess$toEqualDescr : 2.0", + "$s$anEntryAfterSuccess$toEqualDescr : 3.0", + "$s$anEntryAfterSuccess$toEqualDescr : 4.0", + "$bb$mismatches :", "${listBulletPoint}4.0" ) notToContain(sizeDescr) @@ -215,11 +219,13 @@ abstract class IterableToContainInAnyOrderOnlyEntriesExpectationsSpec( }.toThrow { message { toContain.exactly(1).values( - "$rootBulletPoint$toContainInAnyOrderOnly:", - "$s$anEntryAfterSuccess$toEqualDescr: 1.0", - "$s$anEntryAfterSuccess$toBeGreaterThanDescr: 3.0", - "$x$anEntryAfterFailing$toBeGreaterThanDescr: 4.0", - "$bb$mismatchesAdditionalElements:", + "$g$toContainInAnyOrderOnly :", + "$s$anEntryAfterSuccess$toEqualDescr : 1.0", + "$s$anEntryAfterSuccess$toBeGreaterThanDescr : 3.0", + //TODO 1.3.0 should be $x instead of $g + "$g${anElementWhichNeedsDescr} : $lineSeparator" + + "$indentGg$explanatoryBulletPoint$toBeGreaterThanDescr : 4.0", + "$bb$mismatchesAdditionalElements :", "${listBulletPoint}2.0", "${listBulletPoint}3.0", "${listBulletPoint}4.0" @@ -243,14 +249,17 @@ abstract class IterableToContainInAnyOrderOnlyEntriesExpectationsSpec( }.toThrow { message { toContain.exactly(1).values( - "$rootBulletPoint$toContainInAnyOrderOnly:", - "$s$anEntryAfterSuccess$toEqualDescr: 1.0", - "$s$anEntryAfterSuccess$toEqualDescr: 2.0", - "$s$anEntryAfterSuccess$toEqualDescr: 3.0", - "$x$anEntryAfterSuccess$toEqualDescr: 5.0" + "$g$toContainInAnyOrderOnly :", + //TODO 1.3.0 check why $s is not aligned, I would have expected $s $anEntry... + "$s$anEntryAfterSuccess$toEqualDescr : 1.0", + "$s$anEntryAfterSuccess$toEqualDescr : 2.0", + "$s$anEntryAfterSuccess$toEqualDescr : 3.0", + //TODO 1.3.0 should be $x instead of $g + "$g$anElementWhichNeedsDescr : $lineSeparator" + + "$indentGg$explanatoryBulletPoint$toEqualDescr : 5.0" ) toContain.exactly(2) - .value("$s$anEntryAfterSuccess$toEqualDescr: 4.0") + .value("$s$anEntryAfterSuccess$toEqualDescr : 4.0") toContainSize(5, 6) notToContain(additionalElements, mismatches, mismatchesAdditionalElements) } @@ -269,13 +278,13 @@ abstract class IterableToContainInAnyOrderOnlyEntriesExpectationsSpec( message { toContainSize(5, 1) toContain.exactly(1).values( - "$rootBulletPoint$toContainInAnyOrderOnly:", - "$bb$additionalElements:", + "$g$toContainInAnyOrderOnly :", + "$bb$additionalElements :", "${listBulletPoint}1.0", "${listBulletPoint}3.0" ) toContain.exactly(2).value("${listBulletPoint}4.0") - notToContain("$toEqualDescr: 2.0") + notToContain("$toEqualDescr : 2.0") } } @@ -293,12 +302,14 @@ abstract class IterableToContainInAnyOrderOnlyEntriesExpectationsSpec( }.toThrow { message { toContainSize(5, 6) - toContain.exactly(1).values("$listBulletPoint$anEntryAfterSuccess$toEqualDescr: 5.0") - notToContain( - "$toEqualDescr: 1.0", - "$toEqualDescr: 2.0", - "$toEqualDescr: 3.0", - "$toEqualDescr: 4.0" + //TODO 1.3.0 should be $x instead of $g + toContain.exactly(1).values("$g$anElementWhichNeedsDescr : $lineSeparator"+ + "$indentGg$explanatoryBulletPoint$toEqualDescr : 5.0") + notToContain.regex( + "$toEqualDescr\\s+: 1.0", + "$toEqualDescr\\s+: 2.0", + "$toEqualDescr\\s+: 3.0", + "$toEqualDescr\\s+: 4.0" ) notToContain(additionalElements, mismatches, mismatchesAdditionalElements) } @@ -326,22 +337,25 @@ abstract class IterableToContainInAnyOrderOnlyEntriesExpectationsSpec( }.toThrow { message { toContain.exactly(1).values( - "$listBulletPoint$anEntryAfterSuccess$toEqualDescr: -1.0", - "$listBulletPoint$anEntryAfterSuccess$toEqualDescr: -2.0", - "$bb$mismatches:", + //TODO 1.3.0 should be $x instead of $g + "$g$anElementWhichNeedsDescr : $lineSeparator"+ + "$indentGg$explanatoryBulletPoint$toEqualDescr : -1.0", + "$g$anElementWhichNeedsDescr : $lineSeparator"+ + "$indentGg$explanatoryBulletPoint$toEqualDescr : -2.0", + "$bb$mismatches :", "${listBulletPoint}5.0", "${listBulletPoint}8.0" ) notToContain( - "$toEqualDescr: 1.0", - "$toEqualDescr: 2.0", - "$toEqualDescr: 3.0", - "$toEqualDescr: 4.0", - "$toEqualDescr: 6.0", - "$toEqualDescr: 7.0", - "$toEqualDescr: 9.0", - "$toEqualDescr: 10.0", - "$toEqualDescr: 11.0", + "$toEqualDescr : 1.0", + "$toEqualDescr : 2.0", + "$toEqualDescr : 3.0", + "$toEqualDescr : 4.0", + "$toEqualDescr : 6.0", + "$toEqualDescr : 7.0", + "$toEqualDescr : 9.0", + "$toEqualDescr : 10.0", + "$toEqualDescr : 11.0", additionalElements, mismatchesAdditionalElements ) @@ -367,18 +381,22 @@ abstract class IterableToContainInAnyOrderOnlyEntriesExpectationsSpec( }.toThrow { message { toContain.exactly(1).values( - "$s$anEntryAfterSuccess$toEqualDescr: 1.0", - "$s$anEntryAfterSuccess$toEqualDescr: 2.0", - "$s$anEntryAfterSuccess$toEqualDescr: 3.0", - "$s$anEntryAfterSuccess$toEqualDescr: 4.0", - "$x$anEntryAfterFailing$toEqualDescr: -1.0", - "$s$anEntryAfterSuccess$toEqualDescr: 6.0", - "$s$anEntryAfterSuccess$toEqualDescr: 7.0", - "$x$anEntryAfterFailing$toEqualDescr: -2.0", - "$s$anEntryAfterSuccess$toEqualDescr: 9.0", - "$s$anEntryAfterSuccess$toEqualDescr: 10.0", - "$s$anEntryAfterSuccess$toEqualDescr: 11.0", - "$bb$mismatches:", + "$s$anEntryAfterSuccess$toEqualDescr : 1.0", + "$s$anEntryAfterSuccess$toEqualDescr : 2.0", + "$s$anEntryAfterSuccess$toEqualDescr : 3.0", + "$s$anEntryAfterSuccess$toEqualDescr : 4.0", + //TODO 1.3.0 should be $x instead of $g + "$g$anElementWhichNeedsDescr : $lineSeparator" + + "$indentGg$explanatoryBulletPoint$toEqualDescr : -1.0", + "$s$anEntryAfterSuccess$toEqualDescr : 6.0", + "$s$anEntryAfterSuccess$toEqualDescr : 7.0", + //TODO 1.3.0 should be $x instead of $g + "$g$anElementWhichNeedsDescr : $lineSeparator" + + "$indentGg$explanatoryBulletPoint$toEqualDescr : -2.0", + "$s$anEntryAfterSuccess$toEqualDescr : 9.0", + "$s$anEntryAfterSuccess$toEqualDescr : 10.0", + "$s$anEntryAfterSuccess$toEqualDescr : 11.0", + "$bb$mismatches :", "${listBulletPoint}5.0", "${listBulletPoint}8.0" ) @@ -434,11 +452,11 @@ abstract class IterableToContainInAnyOrderOnlyEntriesExpectationsSpec( }.toThrow { message { toContain.exactly(1).values( - "$rootBulletPoint$toContainInAnyOrderOnly:", - "$s$anEntryAfterSuccess$toEqualDescr: null", - "$s$anEntryAfterSuccess$toEqualDescr: 1.0", - "$s$anEntryAfterSuccess$toEqualDescr: 3.0", - "$bb$additionalElements:", + "$g$toContainInAnyOrderOnly :", + "$s$anEntryAfterSuccess$toEqualDescr : null", + "$s$anEntryAfterSuccess$toEqualDescr : 1.0", + "$s$anEntryAfterSuccess$toEqualDescr : 3.0", + "$bb$additionalElements :", "${listBulletPoint}null" ) toContainSize(4, 3) @@ -456,14 +474,16 @@ abstract class IterableToContainInAnyOrderOnlyEntriesExpectationsSpec( }.toThrow { message { toContain.exactly(2).values( - "$s$anEntryAfterSuccess$toEqualDescr: null", - "$s$anEntryAfterSuccess$toEqualDescr: null" + "$s$anEntryAfterSuccess$toEqualDescr : null", + "$s$anEntryAfterSuccess$toEqualDescr : null" ) toContain.exactly(1).values( - "$rootBulletPoint$toContainInAnyOrderOnly:", - "$s$anEntryAfterSuccess$toBeLessThanDescr: 4.0", - "$x$anEntryAfterFailing$toEqualDescr: 1.0", - "$bb$mismatches:", + "$g$toContainInAnyOrderOnly :", + "$s$anEntryAfterSuccess$toBeLessThanDescr : 4.0", + //TODO 1.3.0 should be $x instead of $g + "$g$anElementWhichNeedsDescr : $lineSeparator" + + "$indentGg$explanatoryBulletPoint$toEqualDescr : 1.0", + "$bb$mismatches :", "${listBulletPoint}3.0" ) notToContain(sizeDescr) diff --git a/misc/atrium-specs/src/commonMain/kotlin/ch/tutteli/atrium/specs/integration/IterableToContainInAnyOrderOnlyValuesExpectationsSpec.kt b/misc/atrium-specs/src/commonMain/kotlin/ch/tutteli/atrium/specs/integration/IterableToContainInAnyOrderOnlyValuesExpectationsSpec.kt index 1730d4e5bc..2e9388e644 100644 --- a/misc/atrium-specs/src/commonMain/kotlin/ch/tutteli/atrium/specs/integration/IterableToContainInAnyOrderOnlyValuesExpectationsSpec.kt +++ b/misc/atrium-specs/src/commonMain/kotlin/ch/tutteli/atrium/specs/integration/IterableToContainInAnyOrderOnlyValuesExpectationsSpec.kt @@ -103,13 +103,16 @@ abstract class IterableToContainInAnyOrderOnlyValuesExpectationsSpec( message { toContain.exactly(1).values( "$g$toContainInAnyOrderOnly :", - "$s$anElementWhichEquals : 1.0", - "$s$anElementWhichEquals : 2.0", - "$s$anElementWhichEquals : 3.0", - "$s$anElementWhichEquals : 4.0", "$bb$additionalElements :", "${listBulletPoint}4.0" ) + toContain.exactly(1).regex( + //TODO 1.3.0 should be just $anElementWhichEquals : + "$s$anElementWhichEquals\\s+: 1.0", + "$s$anElementWhichEquals\\s+: 2.0", + "$s$anElementWhichEquals\\s+: 3.0", + "$s$anElementWhichEquals\\s+: 4.0", + ) toContainSize(5, 4) } } @@ -122,13 +125,15 @@ abstract class IterableToContainInAnyOrderOnlyValuesExpectationsSpec( message { toContain.exactly(1).values( "$g$toContainInAnyOrderOnly :", - "$s$anElementWhichEquals : 1.0", - "$s$anElementWhichEquals : 4.0", "$bb$additionalElements :", "${listBulletPoint}2.0", "${listBulletPoint}3.0", "${listBulletPoint}4.0" ) + toContain.exactly(1).regex( + "$s$anElementWhichEquals\\s+: 1.0", + "$s$anElementWhichEquals\\s+: 4.0", + ) toContainSize(5, 2) } } @@ -143,13 +148,15 @@ abstract class IterableToContainInAnyOrderOnlyValuesExpectationsSpec( message { toContain.exactly(1).values( "$g$toContainInAnyOrderOnly :", - "$s$anElementWhichEquals : 1.0", - "$s$anElementWhichEquals : 2.0", - "$s$anElementWhichEquals : 3.0", - "$x$anElementWhichEquals : 5.0", - "$bb$mismatches:", + "$bb$mismatches :", "${listBulletPoint}4.0" ) + toContain.exactly(1).regex( + "$s $anElementWhichEquals\\s+: 1.0", + "$s $anElementWhichEquals\\s+: 2.0", + "$s $anElementWhichEquals\\s+: 3.0", + "$x$anElementWhichEquals\\s+: 5.0", + ) notToContain(sizeDescr) } } @@ -163,14 +170,16 @@ abstract class IterableToContainInAnyOrderOnlyValuesExpectationsSpec( }.toThrow { message { toContain.exactly(1).values( - "$rootBulletPoint$toContainInAnyOrderOnly:", - "$s$anElementWhichEquals: 1.0", - "$s$anElementWhichEquals: 3.0", - "$x$anElementWhichEquals: 5.0", - "$bb$mismatchesAdditionalElements :", - "${listBulletPoint}2.0" + "$g$toContainInAnyOrderOnly :", + "$indentG$bb$mismatchesAdditionalElements :", + "$indentG$indentBb${listBulletPoint}2.0" + ) + toContain.exactly(1).regex( + "$s $anElementWhichEquals\\s+: 1.0", + "$s $anElementWhichEquals\\s+: 3.0", + "$x$anElementWhichEquals\\s+: 5.0", ) - toContain.exactly(2).value("${listBulletPoint}4.0") + toContain.exactly(2).value("$indentG$indentBb${listBulletPoint}4.0") toContainSize(5, 3) } } @@ -185,12 +194,14 @@ abstract class IterableToContainInAnyOrderOnlyValuesExpectationsSpec( message { toContain.exactly(1).values( "$g$toContainInAnyOrderOnly :", - "$s$anElementWhichEquals : 1.0", - "$s$anElementWhichEquals : 2.0", - "$s$anElementWhichEquals : 3.0", - "$x$anElementWhichEquals : 5.0" ) - toContain.exactly(2).value("$s$anElementWhichEquals : 4.0") + toContain.exactly(1).regex( + "$s $anElementWhichEquals\\s+: 1.0", + "$s $anElementWhichEquals\\s+: 2.0", + "$s $anElementWhichEquals\\s+: 3.0", + "$x$anElementWhichEquals\\s+: 5.0" + ) + toContain.exactly(2).regex("$s $anElementWhichEquals\\s+: 4.0") toContainSize(5, 6) notToContain(additionalElements, mismatches, mismatchesAdditionalElements) } @@ -215,7 +226,7 @@ abstract class IterableToContainInAnyOrderOnlyValuesExpectationsSpec( "${listBulletPoint}3.0" ) toContain.exactly(2).value("${listBulletPoint}4.0") - notToContain("$anElementWhichEquals : 2.0") + notToContain.regex("$anElementWhichEquals\\s+: 2.0") } } @@ -233,12 +244,12 @@ abstract class IterableToContainInAnyOrderOnlyValuesExpectationsSpec( }.toThrow { message { toContainSize(5, 6) - toContain.exactly(1).values("$listBulletPoint$anElementWhichEquals : 5.0") - notToContain( - "$anElementWhichEquals : 1.0", - "$anElementWhichEquals : 2.0", - "$anElementWhichEquals : 3.0", - "$anElementWhichEquals : 4.0" + toContain.exactly(1).regex("$x$anElementWhichEquals\\s+: 5.0") + notToContain.regex( + "$anElementWhichEquals\\s+: 1.0", + "$anElementWhichEquals\\s+: 2.0", + "$anElementWhichEquals\\s+: 3.0", + "$anElementWhichEquals\\s+: 4.0" ) notToContain(additionalElements, mismatches, mismatchesAdditionalElements) } @@ -265,23 +276,23 @@ abstract class IterableToContainInAnyOrderOnlyValuesExpectationsSpec( ) }.toThrow { message { - toContain.exactly(1).values( - "$listBulletPoint$anElementWhichEquals : -1.0", - "$listBulletPoint$anElementWhichEquals : -2.0", - "$bb$mismatches:", + toContain.exactly(1).regex( + "$x$anElementWhichEquals\\s+: -1.0", + "$x$anElementWhichEquals\\s+: -2.0", + "$bb$mismatches :", "${listBulletPoint}5.0", "${listBulletPoint}8.0" ) - notToContain( - "$anElementWhichEquals : 1.0", - "$anElementWhichEquals : 2.0", - "$anElementWhichEquals : 3.0", - "$anElementWhichEquals : 4.0", - "$anElementWhichEquals : 6.0", - "$anElementWhichEquals : 7.0", - "$anElementWhichEquals : 9.0", - "$anElementWhichEquals : 10.0", - "$anElementWhichEquals : 11.0", + notToContain.regex( + "$anElementWhichEquals\\s+: 1.0", + "$anElementWhichEquals\\s+: 2.0", + "$anElementWhichEquals\\s+: 3.0", + "$anElementWhichEquals\\s+: 4.0", + "$anElementWhichEquals\\s+: 6.0", + "$anElementWhichEquals\\s+: 7.0", + "$anElementWhichEquals\\s+: 9.0", + "$anElementWhichEquals\\s+: 10.0", + "$anElementWhichEquals\\s+: 11.0", additionalElements, mismatchesAdditionalElements ) @@ -306,19 +317,19 @@ abstract class IterableToContainInAnyOrderOnlyValuesExpectationsSpec( ) }.toThrow { message { - toContain.exactly(1).values( - "$s$anElementWhichEquals : 1.0", - "$s$anElementWhichEquals : 2.0", - "$s$anElementWhichEquals : 3.0", - "$s$anElementWhichEquals : 4.0", - "$x$anElementWhichEquals : -1.0", - "$s$anElementWhichEquals : 6.0", - "$s$anElementWhichEquals : 7.0", - "$x$anElementWhichEquals : -2.0", - "$s$anElementWhichEquals : 9.0", - "$s$anElementWhichEquals : 10.0", - "$s$anElementWhichEquals : 11.0", - "$bb$mismatches:", + toContain.exactly(1).regex( + "$s $anElementWhichEquals\\s+: 1.0", + "$s $anElementWhichEquals\\s+: 2.0", + "$s $anElementWhichEquals\\s+: 3.0", + "$s $anElementWhichEquals\\s+: 4.0", + "$x$anElementWhichEquals\\s+: -1.0", + "$s $anElementWhichEquals\\s+: 6.0", + "$s $anElementWhichEquals\\s+: 7.0", + "$x$anElementWhichEquals\\s+: -2.0", + "$s $anElementWhichEquals\\s+: 9.0", + "$s $anElementWhichEquals\\s+: 10.0", + "$s $anElementWhichEquals\\s+: 11.0", + "$bb$mismatches :", "${listBulletPoint}5.0", "${listBulletPoint}8.0" ) @@ -367,11 +378,11 @@ abstract class IterableToContainInAnyOrderOnlyValuesExpectationsSpec( expect(null1null3()).toContainFun(null, 1.0, 3.0) }.toThrow { message { - toContain.exactly(1).values( + toContain.exactly(1).regex( "$g$toContainInAnyOrderOnly :", - "$s$anElementWhichEquals : null", - "$s$anElementWhichEquals : 1.0", - "$s$anElementWhichEquals : 3.0", + "$s$anElementWhichEquals\\s+: null", + "$s$anElementWhichEquals\\s+: 1.0", + "$s$anElementWhichEquals\\s+: 3.0", "$bb$additionalElements :", "${listBulletPoint}null" ) diff --git a/misc/atrium-specs/src/commonMain/kotlin/ch/tutteli/atrium/specs/integration/IterableToContainInOrderOnlyEntriesExpectationsSpec.kt b/misc/atrium-specs/src/commonMain/kotlin/ch/tutteli/atrium/specs/integration/IterableToContainInOrderOnlyEntriesExpectationsSpec.kt index f27a00221c..c4b60d5cef 100644 --- a/misc/atrium-specs/src/commonMain/kotlin/ch/tutteli/atrium/specs/integration/IterableToContainInOrderOnlyEntriesExpectationsSpec.kt +++ b/misc/atrium-specs/src/commonMain/kotlin/ch/tutteli/atrium/specs/integration/IterableToContainInOrderOnlyEntriesExpectationsSpec.kt @@ -40,8 +40,8 @@ abstract class IterableToContainInOrderOnlyEntriesExpectationsSpec( fun Expect.elementSuccess(index: Int, actual: Any, expected: String): Expect { return this.toContain.exactly(1).regex( - "\\Q$s$f${elementWithIndex(index)}: $actual\\E.*$lineSeparator" + - "$indentRoot$indentSuccess$indentF$featureBulletPoint$expected" + "$indentG\\Q$s\\E$f${elementWithIndex(index)}\\s+: $actual$lineSeparator" + + "$indentG$indentS$indentF$s$expected" ) } @@ -50,20 +50,19 @@ abstract class IterableToContainInOrderOnlyEntriesExpectationsSpec( actual: Any, expected: String, explaining: Boolean = false, - withBulletPoint: Boolean = true ): Expect { return this.toContain.exactly(1).regex( - "\\Q${if (withBulletPoint) x else ""}$f${elementWithIndex(index)}: $actual\\E.*$lineSeparator" + - "$indentRoot$indentX$indentF${if (explaining) "$indentFeature$explanatoryBulletPoint" else featureBulletPoint}$expected" + //TODO 1.3.0 should be $x and not $g + "$indentG\\Q$g\\E$f${elementWithIndex(index)}\\s+: \\Q$actual\\E$lineSeparator" + + "$indentGg$indentF${if (explaining) explanatoryBulletPoint else x}$expected" ) } fun Expect.elementNonExisting( index: Int, expected: String, - withBulletPoint: Boolean = true ): Expect = - elementFailing(index, sizeExceeded, expected, explaining = true, withBulletPoint = withBulletPoint) + elementFailing(index, sizeExceeded, expected, explaining = true) nonNullableCases( describePrefix, @@ -83,8 +82,8 @@ abstract class IterableToContainInOrderOnlyEntriesExpectationsSpec( expect(fluentEmpty()).toContainEntriesFun({ toBeLessThan(1.0) }) }.toThrow { message { - toContain("$rootBulletPoint$toContainInOrderOnly:") - elementNonExisting(0, "$toBeLessThanDescr: 1.0") + toContain("$g$toContainInOrderOnly :") + elementNonExisting(0, "$toBeLessThanDescr") notToContain(additionalElements) toContainSize(0, 1) } @@ -95,9 +94,9 @@ abstract class IterableToContainInOrderOnlyEntriesExpectationsSpec( expect(fluentEmpty()).toContainEntriesFun({ toBeLessThan(1.0) }, { toBeGreaterThan(4.0) }) }.toThrow { message { - toContain.exactly(1).value("$rootBulletPoint$toContainInOrderOnly:") - elementNonExisting(0, "$toBeLessThanDescr: 1.0") - elementNonExisting(1, "$toBeGreaterThanDescr: 4.0") + toContain.exactly(1).value("$g$toContainInOrderOnly :") + elementNonExisting(0, "$toBeLessThanDescr : 1.0") + elementNonExisting(1, "$toBeGreaterThanDescr : 4.0") notToContain(additionalElements) toContainSize(0, 2) } @@ -138,12 +137,12 @@ abstract class IterableToContainInOrderOnlyEntriesExpectationsSpec( { toEqual(4.0) }) }.toThrow { message { - toContain.exactly(1).value("$rootBulletPoint$toContainInOrderOnly:") - elementSuccess(0, 1.0, "$toBeLessThanDescr: 5.0") - elementFailing(1, 2.0, "$toEqualDescr: 1.0") - elementFailing(2, 3.0, "$toEqualDescr: 2.0") - elementSuccess(3, 4.0, "$toBeGreaterThanDescr: 2.0") - elementSuccess(4, 4.0, "$toEqualDescr: 4.0") + toContain.exactly(1).value("$g$toContainInOrderOnly :") + elementSuccess(0, 1.0, "$toBeLessThanDescr : 5.0") + elementFailing(1, 2.0, "$toEqualDescr : 1.0") + elementFailing(2, 3.0, "$toEqualDescr : 2.0") + elementSuccess(3, 4.0, "$toBeGreaterThanDescr : 2.0") + elementSuccess(4, 4.0, "$toEqualDescr : 4.0") notToContain(sizeDescr) } } @@ -158,15 +157,13 @@ abstract class IterableToContainInOrderOnlyEntriesExpectationsSpec( { toEqual(4.0) }) }.toThrow { message { - toContain.exactly(1).value("$rootBulletPoint$toContainInOrderOnly:") - elementSuccess(0, 1.0, "$toEqualDescr: 1.0") - elementSuccess(1, 2.0, "$toEqualDescr: 2.0") - elementSuccess(2, 3.0, "$toEqualDescr: 3.0") - elementSuccess(3, 4.0, "$toEqualDescr: 4.0") - toContain( - "$bb$additionalElements:", - "$listBulletPoint${elementWithIndex(4)}: 4.0" - ) + toContain.exactly(1).value("$g$toContainInOrderOnly :") + elementSuccess(0, 1.0, "$toEqualDescr : 1.0") + elementSuccess(1, 2.0, "$toEqualDescr : 2.0") + elementSuccess(2, 3.0, "$toEqualDescr : 3.0") + elementSuccess(3, 4.0, "$toEqualDescr : 4.0") + toContain("$bb$additionalElements :") + toContainRegex("$listBulletPoint${elementWithIndex(4)}\\s+: 4.0") toContainSize(5, 4) } } @@ -177,14 +174,14 @@ abstract class IterableToContainInOrderOnlyEntriesExpectationsSpec( expect(oneToFour()).toContainEntriesFun({ toEqual(1.0) }, { toEqual(4.0) }) }.toThrow { message { - toContain.exactly(1).value("$rootBulletPoint$toContainInOrderOnly:") - elementSuccess(0, 1.0, "$toEqualDescr: 1.0") - elementFailing(1, 2.0, "$toEqualDescr: 4.0") - toContain( - "$bb$additionalElements:", - "$listBulletPoint${elementWithIndex(2)}: 3.0", - "$listBulletPoint${elementWithIndex(3)}: 4.0", - "$listBulletPoint${elementWithIndex(4)}: 4.0" + toContain.exactly(1).value("$g$toContainInOrderOnly :") + elementSuccess(0, 1.0, "$toEqualDescr : 1.0") + elementFailing(1, 2.0, "$toEqualDescr : 4.0") + toContain("$bb$additionalElements :") + toContainRegex( + "$listBulletPoint${elementWithIndex(2)}\\s+: 3.0", + "$listBulletPoint${elementWithIndex(3)}\\s+: 4.0", + "$listBulletPoint${elementWithIndex(4)}\\s+: 4.0" ) toContainSize(5, 2) } @@ -192,18 +189,19 @@ abstract class IterableToContainInOrderOnlyEntriesExpectationsSpec( } it("1.0, 3.0, $toBeGreaterThanFun(4.0) -- $toBeGreaterThanFun(4.0) is wrong and 4.0 and 4.0 are missing") { expect { - expect(oneToFour()).toContainEntriesFun({ toEqual(1.0) }, + expect(oneToFour()).toContainEntriesFun( + { toEqual(1.0) }, { toEqual(3.0) }, { toBeGreaterThan(4.0) }) }.toThrow { message { - toContain.exactly(1).value("$rootBulletPoint$toContainInOrderOnly:") - elementSuccess(0, 1.0, "$toEqualDescr: 1.0") - elementFailing(1, 2.0, "$toEqualDescr: 3.0") - elementFailing(2, 3.0, "$toBeGreaterThanDescr: 4.0") - toContain( - "$bb$additionalElements:", - "$listBulletPoint${elementWithIndex(3)}: 4.0", - "$listBulletPoint${elementWithIndex(4)}: 4.0" + toContain.exactly(1).value("$g$toContainInOrderOnly :") + elementSuccess(0, 1.0, "$toEqualDescr : 1.0") + elementFailing(1, 2.0, "$toEqualDescr : 3.0") + elementFailing(2, 3.0, "$toBeGreaterThanDescr : 4.0") + toContain("$bb$additionalElements :") + toContainRegex( + "$listBulletPoint${elementWithIndex(3)}\\s+: 4.0", + "$listBulletPoint${elementWithIndex(4)}\\s+: 4.0" ) toContainSize(5, 3) } @@ -220,13 +218,13 @@ abstract class IterableToContainInOrderOnlyEntriesExpectationsSpec( { toEqual(5.0) }) }.toThrow { message { - toContain.exactly(1).value("$rootBulletPoint$toContainInOrderOnly:") - elementSuccess(0, 1.0, "$toEqualDescr: 1.0") - elementSuccess(1, 2.0, "$toEqualDescr: 2.0") - elementSuccess(2, 3.0, "$toEqualDescr: 3.0") - elementSuccess(3, 4.0, "$toEqualDescr: 4.0") - elementSuccess(4, 4.0, "$toEqualDescr: 4.0") - elementNonExisting(5, "$toEqualDescr: 5.0") + toContain.exactly(1).value("$g$toContainInOrderOnly :") + elementSuccess(0, 1.0, "$toEqualDescr : 1.0") + elementSuccess(1, 2.0, "$toEqualDescr : 2.0") + elementSuccess(2, 3.0, "$toEqualDescr : 3.0") + elementSuccess(3, 4.0, "$toEqualDescr : 4.0") + elementSuccess(4, 4.0, "$toEqualDescr : 4.0") + elementNonExisting(5, "$toEqualDescr : 5.0") toContainSize(5, 6) } } @@ -253,7 +251,7 @@ abstract class IterableToContainInOrderOnlyEntriesExpectationsSpec( notToContainElement(2, 3.0) notToContainElement(3, 4.0) notToContainElement(4, 4.0) - elementNonExisting(5, "$toEqualDescr: 5.0", withBulletPoint = false) + elementNonExisting(5, "$toEqualDescr : 5.0") } } } @@ -274,7 +272,7 @@ abstract class IterableToContainInOrderOnlyEntriesExpectationsSpec( notToContainElement(2, 3.0) notToContainElement(3, 4.0) notToContainElement(4, 4.0) - elementNonExisting(5, "$toEqualDescr: 5.0", withBulletPoint = false) + elementNonExisting(5, "$toEqualDescr : 5.0") } } } @@ -303,10 +301,10 @@ abstract class IterableToContainInOrderOnlyEntriesExpectationsSpec( notToContainElement(1, 2.0) notToContainElement(2, 3.0) notToContainElement(3, 4.0) - elementFailing(4, 5.0, "$toEqualDescr: -1.0", withBulletPoint = false) + elementFailing(4, 5.0, "$toEqualDescr : -1.0") notToContainElement(5, 6.0) notToContainElement(6, 7.0) - elementFailing(7, 8.0, "$toEqualDescr: -2.0", withBulletPoint = false) + elementFailing(7, 8.0, "$toEqualDescr : -2.0") notToContainElement(8, 9.0) notToContainElement(9, 10.0) notToContainElement(10, 11.0) @@ -331,17 +329,17 @@ abstract class IterableToContainInOrderOnlyEntriesExpectationsSpec( ) }.toThrow { message { - elementSuccess(0, 1.0, "$toEqualDescr: 1.0") - elementSuccess(1, 2.0, "$toEqualDescr: 2.0") - elementSuccess(2, 3.0, "$toEqualDescr: 3.0") - elementSuccess(3, 4.0, "$toEqualDescr: 4.0") - elementFailing(4, 5.0, "$toEqualDescr: -1.0", withBulletPoint = false) - elementSuccess(5, 6.0, "$toEqualDescr: 6.0") - elementSuccess(6, 7.0, "$toEqualDescr: 7.0") - elementFailing(7, 8.0, "$toEqualDescr: -2.0", withBulletPoint = false) - elementSuccess(8, 9.0, "$toEqualDescr: 9.0") - elementSuccess(9, 10.0, "$toEqualDescr: 10.0") - elementSuccess(10, 11.0, "$toEqualDescr: 11.0") + elementSuccess(0, 1.0, "$toEqualDescr : 1.0") + elementSuccess(1, 2.0, "$toEqualDescr : 2.0") + elementSuccess(2, 3.0, "$toEqualDescr : 3.0") + elementSuccess(3, 4.0, "$toEqualDescr : 4.0") + elementFailing(4, 5.0, "$toEqualDescr : -1.0") + elementSuccess(5, 6.0, "$toEqualDescr : 6.0") + elementSuccess(6, 7.0, "$toEqualDescr : 7.0") + elementFailing(7, 8.0, "$toEqualDescr : -2.0") + elementSuccess(8, 9.0, "$toEqualDescr : 9.0") + elementSuccess(9, 10.0, "$toEqualDescr : 10.0") + elementSuccess(10, 11.0, "$toEqualDescr : 11.0") } } } @@ -393,11 +391,11 @@ abstract class IterableToContainInOrderOnlyEntriesExpectationsSpec( ) }.toThrow { message { - toContain.exactly(1).value("$rootBulletPoint$toContainInOrderOnly:") - elementSuccess(0, "null", "$toEqualDescr: null") - elementFailing(1, 1.0, "$toEqualDescr: null") - elementFailing(2, "null", "$toBeLessThanDescr: 5.0", explaining = true) - elementSuccess(3, 3.0, "$toBeGreaterThanDescr: 2.0") + toContain.exactly(1).value("$g$toContainInOrderOnly :") + elementSuccess(0, "null", "$toEqualDescr : null") + elementFailing(1, 1.0, "$toEqualDescr : null") + elementFailing(2, "null", "$toBeLessThanDescr : 5.0", explaining = true) + elementSuccess(3, 3.0, "$toBeGreaterThanDescr : 2.0") notToContain(sizeDescr) } } @@ -414,12 +412,12 @@ abstract class IterableToContainInOrderOnlyEntriesExpectationsSpec( ) }.toThrow { message { - toContain.exactly(1).value("$rootBulletPoint$toContainInOrderOnly:") - elementSuccess(0, "null", "$toEqualDescr: null") - elementSuccess(1, 1.0, "$toEqualDescr: 1.0") - elementSuccess(2, "null", "$toEqualDescr: null") - elementSuccess(3, 3.0, "$toEqualDescr: 3.0") - elementNonExisting(4, "$toEqualDescr: null") + toContain.exactly(1).value("$g$toContainInOrderOnly :") + elementSuccess(0, "null", "$toEqualDescr : null") + elementSuccess(1, 1.0, "$toEqualDescr : 1.0") + elementSuccess(2, "null", "$toEqualDescr : null") + elementSuccess(3, 3.0, "$toEqualDescr : 3.0") + elementNonExisting(4, "$toEqualDescr : null") toContainSize(4, 5) } } diff --git a/misc/atrium-specs/src/commonMain/kotlin/ch/tutteli/atrium/specs/integration/IterableToContainInOrderOnlyGroupedEntriesExpectationsSpec.kt b/misc/atrium-specs/src/commonMain/kotlin/ch/tutteli/atrium/specs/integration/IterableToContainInOrderOnlyGroupedEntriesExpectationsSpec.kt index a4aab9ea12..313521e3a8 100644 --- a/misc/atrium-specs/src/commonMain/kotlin/ch/tutteli/atrium/specs/integration/IterableToContainInOrderOnlyGroupedEntriesExpectationsSpec.kt +++ b/misc/atrium-specs/src/commonMain/kotlin/ch/tutteli/atrium/specs/integration/IterableToContainInOrderOnlyGroupedEntriesExpectationsSpec.kt @@ -7,10 +7,10 @@ import ch.tutteli.atrium.creating.Expect import ch.tutteli.atrium.logic.creating.iterablelike.contains.reporting.InAnyOrderOnlyReportingOptions import ch.tutteli.atrium.logic.creating.iterablelike.contains.reporting.InOrderOnlyReportingOptions import ch.tutteli.atrium.logic.utils.Group +import ch.tutteli.atrium.reporting.reportables.descriptions.DescriptionCollectionProof +import ch.tutteli.atrium.reporting.reportables.descriptions.DescriptionIterableLikeProof import ch.tutteli.atrium.specs.* import ch.tutteli.atrium.specs.lineSeparator -import ch.tutteli.atrium.translations.DescriptionCollectionExpectation -import ch.tutteli.atrium.translations.DescriptionIterableLikeExpectation import org.spekframework.spek2.style.specification.Suite abstract class IterableToContainInOrderOnlyGroupedEntriesExpectationsSpec( @@ -67,62 +67,51 @@ abstract class IterableToContainInOrderOnlyGroupedEntriesExpectationsSpec( reportInGroup: InAnyOrderOnlyReportingOptions.() -> Unit = emptyInAnyOrderOnlyReportOptions ) = toContainInOrderOnlyGroupedEntries(this, t1, t2, tX, report, reportInGroup) - fun element(prefix: String, bulletPoint: String, indentRootBulletPoint: String, expected: Array) = - expected.joinToString(".*$lineSeparator") { - "$prefix\\Q$bulletPoint$anElementWhichNeedsDescr: \\E$lineSeparator" + - "$prefix$indentRootBulletPoint$indentList$explanatoryBulletPoint$it" + fun element(prefix: String, bulletPoint: String, indent: String, expected: Array) = + expected.joinToString(lineSeparator) { + "$prefix\\Q$bulletPoint$anElementWhichNeedsDescr : \\E$lineSeparator" + + "$prefix$indent$explanatoryBulletPoint$it" } fun size(prefix: String, bulletPoint: String, actual: Int?, expected: Int) = - "$prefix\\Q$bulletPoint\\E${f}${DescriptionCollectionExpectation.SIZE.getDefault()}:${actual?.let { " $it" } ?: ""}[^:]+: $expected" + "$prefix\\Q$bulletPoint\\E${f}${DescriptionCollectionProof.SIZE.string}\\s+:${actual?.let { " $it" } ?: ""}[^:]+: $expected" - fun sizeCheck(actual: Int, expected: Int) = size( - "$indentRoot$indentX$indentF", featureBulletPoint, actual, expected - ) + fun sizeFail(actual: Int, expected: Int) = size("$indentG$indentF", g, actual, expected) + fun sizeSuccessInFail(actual: Int, expected: Int) = size("$indentG$indentF", s, actual, expected) + fun sizeSuccessInSuccess(actual: Int, expected: Int) = size("$indentS$indentF", s, actual, expected) - val afterFail = "$indentRoot$indentX$indentF$indentFeature" - fun failAfterFail(vararg expected: String, withBulletPoint: Boolean = true) = - element(afterFail, if (withBulletPoint) x else listBulletPoint, indentX, expected) - - fun successAfterFail(vararg expected: String) = - element(afterFail, s, indentSuccess, expected) + val inFail = "$indentGg$indentF" + fun failInFail(vararg expected: String) = + //TODO 1.3.0 should be x and not g + element("$inFail$indentG", g, indentX, expected) + fun successInFail(vararg expected: String) = element("$inFail$indentG", s, indentS, expected) fun Expect.notToContainIndex(from: Int, to: Int) = - notToContain.regex("\\Q${DescriptionIterableLikeExpectation.INDEX.getDefault().format("$from..$to")}") - - val additionalElementsFail = "$indentRoot$indentX" - - fun additionalElementsWarning(msg: String, values: Array, act: (T) -> String) = - "$additionalElementsFail\\Q$bb$msg\\E: $lineSeparator" + - values.joinToString(".*$lineSeparator") { - "$additionalElementsFail$indentBb$listBulletPoint${ - act( - it - ) - }" - } - - fun warning(msg: String, values: Array, act: (T) -> String) = - "$afterFail\\Q$bb$msg\\E: $lineSeparator" + - values.joinToString(".*$lineSeparator") { "$afterFail$indentBb$listBulletPoint${act(it)}" } - - fun mismatchesAfterFail(vararg mismatched: Double) = warning(mismatches, mismatched.toTypedArray()) { "$it" } - - fun additional(vararg entryWithValue: Pair) = - additionalElementsWarning(additionalElements, entryWithValue) { "${elementWithIndex(it.first)}: ${it.second}" } - - - val afterSuccess = "$indentRoot$indentSuccess$indentF$indentFeature" - fun successAfterSuccess(vararg expected: String) = - element(afterSuccess, s, indentSuccess, expected) - fun failAfterSuccess(vararg expected: String) = element(afterSuccess, x, indentX, expected) + notToContain.regex("\\Q${DescriptionIterableLikeProof.INDEX.string.format("$from..$to")}") + + fun mismatches(vararg mismatched: Double) = + "$inFail\\Q$bb$mismatches\\E : $lineSeparator" + + mismatched.toTypedArray().joinToString(lineSeparator) { "$inFail$indentBb$listBulletPoint$it" } + + fun Expect.additional(vararg entryWithValue: Pair) = + //TODO 1.3.0 should be defined on an own level and hence \\s+ should not be necessary + toContainRegex( + "$indentG$bb$additionalElements : $lineSeparator" + + entryWithValue + .joinToString(lineSeparator) { + "$indentG$indentBb$listBulletPoint${elementWithIndex(it.first)}\\s+: ${it.second}" + } + ) + val inSuccess = "$indentG$indentS$indentF$indentS" + fun successInSuccess(vararg expected: String) = + element(inSuccess, s, indentS, expected) fun Expect.indexSuccess(index: Int, actual: Any, expected: String): Expect { return this.toContain.exactly(1).regex( - "\\Q$s$f${index(index)}: $actual\\E.*$lineSeparator" + - "$indentRoot$indentSuccess$indentF$featureBulletPoint$expected" + "$indentG\\Q$s$f\\E${index(index)}\\s+: \\Q$actual\\E$lineSeparator" + + "$indentG$indentS$indentF$s$expected" ) } @@ -134,11 +123,10 @@ abstract class IterableToContainInOrderOnlyGroupedEntriesExpectationsSpec( vararg expected: String ): Expect { return this.toContain.exactly(1).regex( - "\\Q$s$f${index(fromIndex, toIndex)}: $actual\\E.*$lineSeparator" + - "$sizeCheck.*$lineSeparator" + - "$indentRoot$indentX$indentF$featureBulletPoint$toContainInAnyOrderOnly: $lineSeparator" + - expected.joinToString(".*$lineSeparator") - + "$indentG\\Q$s$f${index(fromIndex, toIndex)} : $actual\\E.*$lineSeparator" + + "$indentG$sizeCheck$lineSeparator" + + "$indentG$indentS$indentF\\Q$s\\E$toContainInAnyOrderOnly : $lineSeparator" + + expected.joinToString(lineSeparator) ) } @@ -146,11 +134,10 @@ abstract class IterableToContainInOrderOnlyGroupedEntriesExpectationsSpec( index: Int, actual: Any, expected: String, - withBulletPoint: Boolean = true ): Expect { return this.toContain.exactly(1).regex( - "\\Q${if (withBulletPoint) x else ""}$f${index(index)}: $actual\\E.*$lineSeparator" + - "$indentRoot$indentX$indentF$featureBulletPoint$expected" + "$indentG\\Q$g\\E$f${index(index)}\\s+: \\Q$actual\\E$lineSeparator" + + "$indentGg$indentF$x$expected" ) } @@ -159,23 +146,21 @@ abstract class IterableToContainInOrderOnlyGroupedEntriesExpectationsSpec( toIndex: Int, actual: List, sizeCheck: String?, - vararg expected: String, - withBulletPoint: Boolean = true + vararg expected: String ): Expect { return this.toContain.exactly(1).regex( - "\\Q${if (withBulletPoint) x else ""}$f${ - index(fromIndex, toIndex) - }: $actual\\E.*$lineSeparator" + - (sizeCheck?.let { "$sizeCheck.*$lineSeparator" } ?: "") + - "$indentRoot${if (withBulletPoint) indentX else indentList}$indentF$featureBulletPoint$toContainInAnyOrderOnly: $lineSeparator" + - expected.joinToString(".*$lineSeparator") + "$indentG\\Q$g$f\\E${index(fromIndex, toIndex)} : \\Q$actual\\E.*$lineSeparator" + + (sizeCheck?.let { "$indentG$sizeCheck$lineSeparator" } ?: "") + + "$indentGg$indentF\\Q$g\\E$toContainInAnyOrderOnly : $lineSeparator" + + expected.joinToString(lineSeparator) ) } - fun Expect.indexNonExisting(index: Int, expected: String, withBulletPoint: Boolean = true): Expect { + fun Expect.indexNonExisting(index: Int, expected: String): Expect { return this.toContain.exactly(1).regex( - "\\Q${if (withBulletPoint) x else ""}$f${IterableToContainSpecBase.index(index)}: $sizeExceeded\\E.*$lineSeparator" + - "$afterFail$explanatoryBulletPoint$expected" + //TODO 1.3.0 should be x instead of g + "\\Q$g$f${IterableToContainSpecBase.index(index)} : $sizeExceeded\\E$lineSeparator" + + "$inFail$explanatoryBulletPoint$expected" ) } @@ -183,15 +168,15 @@ abstract class IterableToContainInOrderOnlyGroupedEntriesExpectationsSpec( fromIndex: Int, toIndex: Int, sizeCheck: String, vararg expected: String, - withBulletPoint: Boolean = true ): Expect { return this.toContain.exactly(1).regex( - "\\Q${if (withBulletPoint) x else ""}$f${ - index(fromIndex, toIndex) - }: $sizeExceeded\\E.*$lineSeparator" + - "$afterFail$sizeCheck.*$lineSeparator" + - "$indentRoot${if (withBulletPoint) indentX else indentList}$indentF$indentFeature$explanatoryBulletPoint$toContainInAnyOrderOnly: $lineSeparator" + - expected.joinToString(".*$lineSeparator") { ".*$anElementWhichNeedsDescr:.*$lineSeparator.*$it" } + "$indentG\\Q$g$f${index(fromIndex, toIndex)} : $sizeExceeded\\E.*$lineSeparator" + + "$inFail$sizeCheck.*$lineSeparator" + + "$inFail$explanatoryBulletPoint$toContainInAnyOrderOnly : $lineSeparator" + + expected.joinToString(lineSeparator) { + "$inFail$indentExplanatory$listBulletPoint$anElementWhichNeedsDescr : $lineSeparator" + + "$inFail$indentExplanatory$indentList$explanatoryBulletPoint$it" + } ) } @@ -240,20 +225,14 @@ abstract class IterableToContainInOrderOnlyGroupedEntriesExpectationsSpec( context("empty iterable") { it("(1.0), (1.2) throws AssertionError") { expect { - expect(setOf().asIterable()).toContainInOrderOnlyGroupedEntriesFun(context({ - toEqual( - 1.0 - ) - }), context({ - toEqual( - 1.2 - ) - })) + expect(setOf().asIterable()).toContainInOrderOnlyGroupedEntriesFun( + context({ toEqual(1.0) }), context({ toEqual(1.2) }) + ) }.toThrow { message { - toContain.exactly(1).value("$rootBulletPoint$toContainInOrderOnlyGrouped:") - indexNonExisting(0, "$toEqualDescr: 1.0") - indexNonExisting(1, "$toEqualDescr: 1.2") + toContain.exactly(1).value("$g$toContainInOrderOnlyGrouped :") + indexNonExisting(0, "$toEqualDescr : 1.0") + indexNonExisting(1, "$toEqualDescr : 1.2") notToContain(additionalElements) toContainSize(0, 2) } @@ -312,21 +291,21 @@ abstract class IterableToContainInOrderOnlyGroupedEntriesExpectationsSpec( ) }.toThrow { message { - toContain.exactly(1).value("$rootBulletPoint$toContainInOrderOnlyGrouped:") + toContain.exactly(1).value("$g$toContainInOrderOnlyGrouped :") indexFail( 0, 1, listOf(1.0, 2.0), - sizeCheck(2, 2), - failAfterFail("$toEqualDescr: 4.0"), - successAfterFail("$toEqualDescr: 1.0"), - mismatchesAfterFail(2.0) + sizeSuccessInFail(2, 2), + failInFail("$toEqualDescr : 4.0"), + successInFail("$toEqualDescr : 1.0"), + mismatches(2.0) ) indexFail( 2, 4, listOf(3.0, 4.0, 4.0), - sizeCheck(3, 3), - failAfterFail("$toEqualDescr: 2.0"), - successAfterFail("$toEqualDescr: 3.0"), - successAfterFail("$toEqualDescr: 4.0"), - mismatchesAfterFail(4.0) + sizeSuccessInFail(3, 3), + failInFail("$toEqualDescr : 2.0"), + successInFail("$toEqualDescr : 3.0"), + successInFail("$toEqualDescr : 4.0"), + mismatches(4.0) ) notToContain(size(indentRoot, s, 5, 5)) } @@ -342,20 +321,20 @@ abstract class IterableToContainInOrderOnlyGroupedEntriesExpectationsSpec( ) }.toThrow { message { - toContain.exactly(1).value("$rootBulletPoint$toContainInOrderOnlyGrouped:") + toContain.exactly(1).value("$g$toContainInOrderOnlyGrouped :") indexFail( 0, 1, listOf(1.0, 2.0), - sizeCheck(2, 2), - successAfterFail("$toBeLessThanDescr: 2.1"), - failAfterFail("$toBeLessThanDescr: 2.0"), - mismatchesAfterFail(2.0) + sizeSuccessInFail(2, 2), + successInFail("$toBeLessThanDescr : 2.1"), + failInFail("$toBeLessThanDescr : 2.0"), + mismatches(2.0) ) indexSuccess( 2, 4, listOf(3.0, 4.0, 4.0), - sizeCheck(3, 3), - successAfterSuccess("$toEqualDescr: 4.0"), - successAfterSuccess("$toEqualDescr: 3.0"), - successAfterSuccess("$toEqualDescr: 4.0") + sizeSuccessInSuccess(3, 3), + successInSuccess("$toEqualDescr : 4.0"), + successInSuccess("$toEqualDescr : 3.0"), + successInSuccess("$toEqualDescr : 4.0") ) notToContain(size(indentRoot, s, 5, 5)) } @@ -371,18 +350,18 @@ abstract class IterableToContainInOrderOnlyGroupedEntriesExpectationsSpec( }.toThrow { message { toContainSize(5, 4) - toContain.exactly(1).value("$rootBulletPoint$toContainInOrderOnlyGrouped:") - indexSuccess(0, 1.0, "$toEqualDescr: 1.0") + toContain.exactly(1).value("$g$toContainInOrderOnlyGrouped :") + indexSuccess(0, 1.0, "$toEqualDescr : 1.0") indexSuccess( 1, 3, listOf(2.0, 3.0, 4.0), - sizeCheck(3, 3), - successAfterSuccess( - "$toEqualDescr: 4.0", - "$toEqualDescr: 2.0", - "$toEqualDescr: 3.0" + sizeSuccessInSuccess(3, 3), + successInSuccess( + "$toEqualDescr : 4.0", + "$toEqualDescr : 2.0", + "$toEqualDescr : 3.0" ) ) - toContainRegex(additional(4 to 4.0)) + additional(4 to 4.0) } } } @@ -397,10 +376,10 @@ abstract class IterableToContainInOrderOnlyGroupedEntriesExpectationsSpec( }.toThrow { message { toContainSize(5, 2) - toContain.exactly(1).value("$rootBulletPoint$toContainInOrderOnlyGrouped:") - indexSuccess(0, 1.0, "$toEqualDescr: 1.0") - indexFail(1, 2.0, "$toEqualDescr: 4.0") - toContainRegex(additional(2 to 3.0, 3 to 4.0, 4 to 4.0)) + toContain.exactly(1).value("$g$toContainInOrderOnlyGrouped :") + indexSuccess(0, 1.0, "$toEqualDescr : 1.0") + indexFail(1, 2.0, "$toEqualDescr : 4.0") + additional(2 to 3.0, 3 to 4.0, 4 to 4.0) } } } @@ -412,16 +391,16 @@ abstract class IterableToContainInOrderOnlyGroupedEntriesExpectationsSpec( ) }.toThrow { message { - toContain.exactly(1).value("$rootBulletPoint$toContainInOrderOnlyGrouped:") + toContain.exactly(1).value("$g$toContainInOrderOnlyGrouped :") indexFail( 0, 1, listOf(1.0, 2.0), - sizeCheck(2, 2), - successAfterFail("$toEqualDescr: 1.0"), - failAfterFail("$toEqualDescr: 3.0"), - mismatchesAfterFail(2.0) + sizeSuccessInFail(2, 2), + successInFail("$toEqualDescr : 1.0"), + failInFail("$toEqualDescr : 3.0"), + mismatches(2.0) ) - indexFail(2, 3.0, "$toEqualDescr: 5.0") - toContainRegex(additional(3 to 4.0, 4 to 4.0)) + indexFail(2, 3.0, "$toEqualDescr : 5.0") + additional(3 to 4.0, 4 to 4.0) } } } @@ -434,22 +413,22 @@ abstract class IterableToContainInOrderOnlyGroupedEntriesExpectationsSpec( }.toThrow { message { toContainSize(5, 6) - toContain.exactly(1).value("$rootBulletPoint$toContainInOrderOnlyGrouped:") + toContain.exactly(1).value("$g$toContainInOrderOnlyGrouped :") indexSuccess( 0, 3, listOf(1.0, 2.0, 3.0, 4.0), - sizeCheck(4, 4), - successAfterSuccess( - "$toEqualDescr: 4.0", - "$toEqualDescr: 1.0", - "$toEqualDescr: 3.0", - "$toEqualDescr: 2.0" + sizeSuccessInSuccess(4, 4), + successInSuccess( + "$toEqualDescr : 4.0", + "$toEqualDescr : 1.0", + "$toEqualDescr : 3.0", + "$toEqualDescr : 2.0" ) ) indexFail( 4, 5, listOf(4.0), - sizeCheck(1, 2), - failAfterFail("$toEqualDescr: 5.0"), - successAfterFail("$toEqualDescr: 4.0") + sizeFail(1, 2), + failInFail("$toEqualDescr : 5.0"), + successInFail("$toEqualDescr : 4.0") ) } } @@ -482,33 +461,31 @@ abstract class IterableToContainInOrderOnlyGroupedEntriesExpectationsSpec( }.toThrow { message { toContainSize(5, 14) - toContain.exactly(1).value("$rootBulletPoint$toContainInOrderOnlyGrouped:") + toContain.exactly(1).value("$g$toContainInOrderOnlyGrouped :") notToContainIndex(0, 0) indexFail( 1, 2, listOf(2.0, 3.0), null, - successAfterSuccess("$toEqualDescr: 2.0"), - failAfterSuccess("$toEqualDescr: 4.0"), - withBulletPoint = false + successInFail("$toEqualDescr : 2.0"), + failInFail("$toEqualDescr : 4.0"), ) indexFail( 3, 13, listOf(4.0, 4.0), - sizeCheck(2, 11), - failAfterFail("$toEqualDescr: 1.0", withBulletPoint = false), - failAfterFail("$toEqualDescr: 2.0", withBulletPoint = false), - failAfterFail("$toEqualDescr: 3.0", withBulletPoint = false), - failAfterFail("$toEqualDescr: 5.0", withBulletPoint = false), - failAfterFail("$toEqualDescr: 6.0", withBulletPoint = false), - failAfterFail("$toEqualDescr: 7.0", withBulletPoint = false), - failAfterFail("$toEqualDescr: 8.0", withBulletPoint = false), - failAfterFail("$toEqualDescr: 9.0", withBulletPoint = false), - failAfterFail("$toEqualDescr: 10.0", withBulletPoint = false), - failAfterFail("$toEqualDescr: 11.0", withBulletPoint = false), - withBulletPoint = false - ) - mismatchesAfterFail(4.0) + sizeFail(2, 11), + failInFail("$toEqualDescr : 1.0"), + failInFail("$toEqualDescr : 2.0"), + failInFail("$toEqualDescr : 3.0"), + failInFail("$toEqualDescr : 5.0"), + failInFail("$toEqualDescr : 6.0"), + failInFail("$toEqualDescr : 7.0"), + failInFail("$toEqualDescr : 8.0"), + failInFail("$toEqualDescr : 9.0"), + failInFail("$toEqualDescr : 10.0"), + failInFail("$toEqualDescr : 11.0"), + mismatches(4.0) + ) } } } @@ -524,37 +501,38 @@ abstract class IterableToContainInOrderOnlyGroupedEntriesExpectationsSpec( }.toThrow { message { toContainSize(5, 6) - toContain.exactly(1).value("$rootBulletPoint$toContainInOrderOnlyGrouped:") - notToContainIndex(1, 2) + toContain.exactly(1).value("$g$toContainInOrderOnlyGrouped :") + notToContainIndex(0, 2) indexFail( 3, 5, listOf(4.0, 4.0), - sizeCheck(2, 3), - failAfterFail("$toEqualDescr: 5.0", withBulletPoint = false), - withBulletPoint = false + sizeFail(2, 3), + failInFail("$toEqualDescr : 5.0"), ) - notToContain("$anElementWhichEquals: 4.0") + notToContain("$anElementWhichEquals : 4.0") } } } - it("shows only failing indices with report option `showOnlyFailingIfMoreExpectedElementsThan(3)` because there are 5 but still all elements in group") { + it("shows only failing indices with report option `showOnlyFailingIfMoreExpectedElementsThan(1)` because we have 2 groups but still all elements in group (as no has more than 10 expected elements)") { expect { expect(oneToFour() as Iterable).toContainInOrderOnlyGroupedEntriesFun( context({ toEqual(1.0) }, { toEqual(2.0) }, { toEqual(3.0) }), context({ toEqual(4.0) }, { toEqual(4.0) }, { toEqual(5.0) }), - report = { showOnlyFailingIfMoreExpectedElementsThan(3) } + report = { + // showOnlyFailingIfMoreExpectedElementsThan means if more than expected groups + showOnlyFailingIfMoreExpectedElementsThan(1) + } ) }.toThrow { message { toContainSize(5, 6) - toContain.exactly(1).value("$rootBulletPoint$toContainInOrderOnlyGrouped:") - notToContainIndex(1, 2) + toContain.exactly(1).value("$g$toContainInOrderOnlyGrouped :") + notToContainIndex(0, 2) indexFail( 3, 5, listOf(4.0, 4.0), - sizeCheck(2, 3), - successAfterSuccess("$toEqualDescr: 4.0", "$toEqualDescr: 4.0"), - failAfterFail("$toEqualDescr: 5.0"), - withBulletPoint = false + sizeFail(2, 3), + successInFail("$toEqualDescr : 4.0", "$toEqualDescr : 4.0"), + failInFail("$toEqualDescr : 5.0"), ) } } @@ -581,62 +559,55 @@ abstract class IterableToContainInOrderOnlyGroupedEntriesExpectationsSpec( message { toContainSize(11, 20) - toContain.exactly(1).value("$rootBulletPoint$toContainInOrderOnlyGrouped:") + toContain.exactly(1).value("$g$toContainInOrderOnlyGrouped :") indexFail( 0, 1, listOf(1.0, 2.0), null, //i.e no size check is shown as 2=2 and summary is only for inReportGroup - successAfterFail("$toEqualDescr: 1.0"), - failAfterSuccess("$toEqualDescr: 1.0"), - withBulletPoint = false + successInFail("$toEqualDescr : 1.0"), + failInFail("$toEqualDescr : 1.0"), + mismatches(2.0) ) - mismatchesAfterFail(2.0) - indexFail(2, 3.0, "$toEqualDescr: 2.0", withBulletPoint = false) + indexFail(2, 3.0, "$toEqualDescr : 2.0") indexFail( 3, 4, listOf(4.0, 5.0), null, //i.e no size check is shown as 2=2 and summary is only for inReportGroup - failAfterSuccess("$toEqualDescr: 3.0"), - failAfterFail("$toEqualDescr: -3.0"), - withBulletPoint = false + failInFail("$toEqualDescr : 3.0"), + failInFail("$toEqualDescr : -3.0"), + mismatches(4.0, 5.0) ) - mismatchesAfterFail(4.0, 5.0) indexFail( 5, 6, listOf(6.0, 7.0), null, //i.e no size check is shown as 2=2 and summary is only for inReportGroup - failAfterSuccess("$toEqualDescr: 1.0"), - failAfterFail("$toEqualDescr: 4.0"), - withBulletPoint = false + failInFail("$toEqualDescr : 1.0"), + failInFail("$toEqualDescr : 4.0"), + mismatches(6.0, 7.0) ) - mismatchesAfterFail(6.0, 7.0) notToContainIndex(7, 7) notToContainIndex(8, 9) indexFail( 10, 12, listOf(11.0), - sizeCheck(1, 3), - failAfterSuccess("$toEqualDescr: -1.0"), - failAfterFail("$toEqualDescr: -2.0"), - failAfterFail("$toEqualDescr: 9.0"), - withBulletPoint = false + sizeFail(1, 3), + failInFail("$toEqualDescr : -1.0"), + failInFail("$toEqualDescr : -2.0"), + failInFail("$toEqualDescr : 9.0"), + mismatches(11.0) ) - mismatchesAfterFail(11.0) indexNonExisting( 13, 14, size("", explanatoryBulletPoint, null, 2), - "$toEqualDescr: 7.0", "$toEqualDescr: 8.0", - withBulletPoint = false + "$toEqualDescr : 7.0", "$toEqualDescr : 8.0", ) indexNonExisting( 15, 16, size("", explanatoryBulletPoint, null, 2), - "$toEqualDescr: 9.0", "$toEqualDescr: -8.0", - withBulletPoint = false + "$toEqualDescr : 9.0", "$toEqualDescr : -8.0", ) indexNonExisting( 17, 18, size("", explanatoryBulletPoint, null, 2), - "$toEqualDescr: 10.0", "$toEqualDescr: 11.0", - withBulletPoint = false + "$toEqualDescr : 10.0", "$toEqualDescr : 11.0", ) - indexNonExisting(19, "$toEqualDescr: 12.0", withBulletPoint = false) + indexNonExisting(19, "$toEqualDescr : 12.0") } } } @@ -661,58 +632,58 @@ abstract class IterableToContainInOrderOnlyGroupedEntriesExpectationsSpec( toContainSize(11, 20) indexFail( 0, 1, listOf(1.0, 2.0), - sizeCheck(2, 2), - successAfterFail("$toEqualDescr: 1.0"), - failAfterSuccess("$toEqualDescr: 1.0") + sizeSuccessInFail(2, 2), + successInFail("$toEqualDescr : 1.0"), + failInFail("$toEqualDescr : 1.0"), + mismatches(2.0) ) - mismatchesAfterFail(2.0) - indexFail(2, 3.0, "$toEqualDescr: 2.0") + indexFail(2, 3.0, "$toEqualDescr : 2.0") indexFail( 3, 4, listOf(4.0, 5.0), - sizeCheck(2, 2), - failAfterSuccess("$toEqualDescr: 3.0"), - failAfterFail("$toEqualDescr: -3.0") + sizeSuccessInFail(2, 2), + failInFail("$toEqualDescr : 3.0"), + failInFail("$toEqualDescr : -3.0"), + mismatches(4.0, 5.0) ) - mismatchesAfterFail(4.0, 5.0) indexFail( 5, 6, listOf(6.0, 7.0), - sizeCheck(2, 2), - failAfterSuccess("$toEqualDescr: 1.0"), - failAfterFail("$toEqualDescr: 4.0") + sizeSuccessInFail(2, 2), + failInFail("$toEqualDescr : 1.0"), + failInFail("$toEqualDescr : 4.0"), + mismatches(6.0, 7.0) ) - mismatchesAfterFail(6.0, 7.0) - indexSuccess(7, 8.0, "$toEqualDescr: 8.0") + indexSuccess(7, 8.0, "$toEqualDescr : 8.0") indexSuccess( 8, 9, listOf(9.0, 10.0), //TODO 1.3.0: https://github.com/robstoll/atrium/issues/724 should not be shown, is enough to show the indices - sizeCheck(2, 2), - successAfterSuccess("$toEqualDescr: 10.0"), - successAfterSuccess("$toEqualDescr: 9.0") + sizeSuccessInSuccess(2, 2), + successInSuccess("$toEqualDescr : 10.0"), + successInSuccess("$toEqualDescr : 9.0") ) indexFail( 10, 12, listOf(11.0), - sizeCheck(1, 3), - failAfterFail("$toEqualDescr: -1.0"), - failAfterFail("$toEqualDescr: -2.0"), - failAfterFail("$toEqualDescr: 9.0") + sizeFail(1, 3), + failInFail("$toEqualDescr : -1.0"), + failInFail("$toEqualDescr : -2.0"), + failInFail("$toEqualDescr : 9.0"), + mismatches(11.0) ) - mismatchesAfterFail(11.0) indexNonExisting( 13, 14, size("", explanatoryBulletPoint, null, 2), - "$toEqualDescr: 7.0", "$toEqualDescr: 8.0" + "$toEqualDescr : 7.0", "$toEqualDescr : 8.0" ) indexNonExisting( 15, 16, size("", explanatoryBulletPoint, null, 2), - "$toEqualDescr: 9.0", "$toEqualDescr: -8.0" + "$toEqualDescr : 9.0", "$toEqualDescr : -8.0" ) indexNonExisting( 17, 18, size("", explanatoryBulletPoint, null, 2), - "$toEqualDescr: 10.0", "$toEqualDescr: 11.0" + "$toEqualDescr : 10.0", "$toEqualDescr : 11.0" ) - indexNonExisting(19, "$toEqualDescr: 12.0") + indexNonExisting(19, "$toEqualDescr : 12.0") } } } @@ -736,61 +707,54 @@ abstract class IterableToContainInOrderOnlyGroupedEntriesExpectationsSpec( }.toThrow { message { toContainSize(11, 20) - toContain.exactly(1).value("$rootBulletPoint$toContainInOrderOnlyGrouped:") + toContain.exactly(1).value("$g$toContainInOrderOnlyGrouped :") indexFail( 0, 1, listOf(1.0, 2.0), null, //i.e no size check is shown as 2=2 and summary is only for inReportGroup - failAfterFail("$toEqualDescr: 1.0", withBulletPoint = false), - withBulletPoint = false + failInFail("$toEqualDescr : 1.0"), ) - mismatchesAfterFail(2.0) - indexFail(2, 3.0, "$toEqualDescr: 2.0", withBulletPoint = false) + mismatches(2.0) + indexFail(2, 3.0, "$toEqualDescr : 2.0") indexFail( 3, 4, listOf(4.0, 5.0), null, //i.e no size check is shown as 2=2 and summary is only for inReportGroup - failAfterFail("$toEqualDescr: 3.0", withBulletPoint = false), - failAfterFail("$toEqualDescr: -3.0", withBulletPoint = false), - withBulletPoint = false + failInFail("$toEqualDescr : 3.0"), + failInFail("$toEqualDescr : -3.0"), ) - mismatchesAfterFail(4.0, 5.0) + mismatches(4.0, 5.0) indexFail( 5, 6, listOf(6.0, 7.0), null, //i.e no size check is shown as 2=2 and summary is only for inReportGroup - failAfterFail("$toEqualDescr: 1.0", withBulletPoint = false), - failAfterFail("$toEqualDescr: 4.0", withBulletPoint = false), - withBulletPoint = false + failInFail("$toEqualDescr : 1.0"), + failInFail("$toEqualDescr : 4.0"), ) - mismatchesAfterFail(6.0, 7.0) + mismatches(6.0, 7.0) notToContainIndex(7, 7) notToContainIndex(8, 9) indexFail( 10, 12, listOf(11.0), - sizeCheck(1, 3), - failAfterFail("$toEqualDescr: -1.0", withBulletPoint = false), - failAfterFail("$toEqualDescr: -2.0", withBulletPoint = false), - failAfterFail("$toEqualDescr: 9.0", withBulletPoint = false), - withBulletPoint = false + sizeFail(1, 3), + failInFail("$toEqualDescr : -1.0"), + failInFail("$toEqualDescr : -2.0"), + failInFail("$toEqualDescr : 9.0"), ) - mismatchesAfterFail(11.0) + mismatches(11.0) indexNonExisting( 13, 14, size("", explanatoryBulletPoint, null, 2), - "$toEqualDescr: 7.0", "$toEqualDescr: 8.0", - withBulletPoint = false + "$toEqualDescr : 7.0", "$toEqualDescr : 8.0", ) indexNonExisting( 15, 16, size("", explanatoryBulletPoint, null, 2), - "$toEqualDescr: 9.0", "$toEqualDescr: -8.0", - withBulletPoint = false + "$toEqualDescr : 9.0", "$toEqualDescr : -8.0", ) indexNonExisting( 17, 18, size("", explanatoryBulletPoint, null, 2), - "$toEqualDescr: 10.0", "$toEqualDescr: 11.0", - withBulletPoint = false + "$toEqualDescr : 10.0", "$toEqualDescr : 11.0", ) - indexNonExisting(19, "$toEqualDescr: 12.0", withBulletPoint = false) + indexNonExisting(19, "$toEqualDescr : 12.0") } } } @@ -830,18 +794,18 @@ abstract class IterableToContainInOrderOnlyGroupedEntriesExpectationsSpec( ) }.toThrow { message { - toContain.exactly(1).value("$rootBulletPoint$toContainInOrderOnlyGrouped:") + toContain.exactly(1).value("$g$toContainInOrderOnlyGrouped :") indexFail( 0, 1, listOf(null, 1.0), - sizeCheck(2, 2), - successAfterFail("$toEqualDescr: null"), - failAfterFail("$toEqualDescr: null") + sizeSuccessInFail(2, 2), + successInFail("$toEqualDescr : null"), + failInFail("$toEqualDescr : null") ) indexFail( 2, 3, listOf(null, 3.0), - sizeCheck(2, 2), - successAfterFail("$toBeLessThanDescr: 5.0"), - failAfterFail("$toBeGreaterThanDescr: 2.0") + sizeSuccessInFail(2, 2), + successInFail("$toBeLessThanDescr : 5.0"), + failInFail("$toBeGreaterThanDescr : 2.0") ) } } @@ -855,22 +819,22 @@ abstract class IterableToContainInOrderOnlyGroupedEntriesExpectationsSpec( ) }.toThrow { message { - toContain.exactly(1).value("$rootBulletPoint$toContainInOrderOnlyGrouped:") + toContainSize(4, 5) + toContain.exactly(1).value("$g$toContainInOrderOnlyGrouped :") indexSuccess( 0, 1, listOf(null, 1.0), - sizeCheck(2, 2), - successAfterSuccess("$toEqualDescr: null"), - successAfterSuccess("$toEqualDescr: 1.0") + sizeSuccessInSuccess(2, 2), + successInSuccess("$toEqualDescr : null"), + successInSuccess("$toEqualDescr : 1.0") ) indexFail( 2, 4, listOf(null, 3.0), - sizeCheck(2, 3), - successAfterFail("$toEqualDescr: 3.0"), - successAfterFail("$toEqualDescr: null"), - failAfterFail("$toEqualDescr: null") + sizeFail(2, 3), + successInFail("$toEqualDescr : 3.0"), + successInFail("$toEqualDescr : null"), + failInFail("$toEqualDescr : null") ) - toContainSize(4, 5) } } } diff --git a/misc/atrium-specs/src/commonMain/kotlin/ch/tutteli/atrium/specs/integration/IterableToContainInOrderOnlyGroupedValuesExpectationsSpec.kt b/misc/atrium-specs/src/commonMain/kotlin/ch/tutteli/atrium/specs/integration/IterableToContainInOrderOnlyGroupedValuesExpectationsSpec.kt index cfbd929826..73d038a5b9 100644 --- a/misc/atrium-specs/src/commonMain/kotlin/ch/tutteli/atrium/specs/integration/IterableToContainInOrderOnlyGroupedValuesExpectationsSpec.kt +++ b/misc/atrium-specs/src/commonMain/kotlin/ch/tutteli/atrium/specs/integration/IterableToContainInOrderOnlyGroupedValuesExpectationsSpec.kt @@ -7,10 +7,10 @@ import ch.tutteli.atrium.creating.Expect import ch.tutteli.atrium.logic.creating.iterablelike.contains.reporting.InAnyOrderOnlyReportingOptions import ch.tutteli.atrium.logic.creating.iterablelike.contains.reporting.InOrderOnlyReportingOptions import ch.tutteli.atrium.logic.utils.Group +import ch.tutteli.atrium.reporting.reportables.descriptions.DescriptionCollectionProof +import ch.tutteli.atrium.reporting.reportables.descriptions.DescriptionIterableLikeProof import ch.tutteli.atrium.specs.* import ch.tutteli.atrium.specs.lineSeparator -import ch.tutteli.atrium.translations.DescriptionCollectionExpectation -import ch.tutteli.atrium.translations.DescriptionIterableLikeExpectation abstract class IterableToContainInOrderOnlyGroupedValuesExpectationsSpec( toContainInOrderOnlyGroupedValues: Fun5< @@ -57,57 +57,49 @@ abstract class IterableToContainInOrderOnlyGroupedValuesExpectationsSpec( ) ) {}) - val toEqualWithFeature = "$indentF$featureBulletPoint$toEqualDescr" - val toEqualAfterSuccess = "$indentRoot$indentSuccess$toEqualWithFeature" - val toEqualAfterFailing = "$indentRoot$indentX$toEqualWithFeature" - fun element(prefix: String, bulletPoint: String, expected: Array) = - expected.joinToString(".*$lineSeparator") { "$prefix\\Q$bulletPoint$anElementWhichEquals: $it\\E" } + expected.joinToString(lineSeparator) { "$prefix\\Q$bulletPoint\\E$anElementWhichEquals\\s+: \\Q$it\\E" } fun size(prefix: String, bulletPoint: String, actual: Int?, expected: Int) = - "$prefix\\Q$bulletPoint\\E${f}${DescriptionCollectionExpectation.SIZE.getDefault()}:${actual?.let { " $it" } ?: ""}[^:]+: $expected" + "$prefix\\Q$bulletPoint\\E${f}${DescriptionCollectionProof.SIZE.string}\\s+:${actual?.let { " $it" } ?: ""}[^:]+: $expected" - val afterFail = "$indentRoot$indentX$indentF$indentFeature" - val additionalElementsFail = "$indentRoot$indentX" - fun failAfterFail(vararg expected: Double?, withBulletPoint: Boolean = true) = - element(afterFail, if (withBulletPoint) x else listBulletPoint, expected) + val inFail = "$indentGg$indentF" + fun failInFail(vararg expected: Double?) = + element("$inFail$indentG", x, expected) - fun successAfterFail(vararg expected: Double?) = element(afterFail, s, expected) + fun successInFail(vararg expected: Double?) = element("$inFail$indentG", "$s ", expected) - fun sizeCheck(actual: Int?, expected: Int, bulletPoint: String = featureBulletPoint) = size( - "$indentRoot$indentX$indentF", bulletPoint, actual, expected - ) + fun sizeFail(actual: Int, expected: Int) = size("$indentG$indentF", g, actual, expected) + fun sizeSuccessInFail(actual: Int, expected: Int) = size("$indentG$indentF", s, actual, expected) + fun sizeSuccessInSuccess(actual: Int, expected: Int) = size("$indentS$indentF", s, actual, expected) fun Expect.notToContainIndex(from: Int, to: Int) = - notToContain.regex("\\Q${DescriptionIterableLikeExpectation.INDEX.getDefault().format("$from..$to")}") - - fun mismatchesWarning(msg: String, values: Array, act: (T) -> String) = - "$afterFail\\Q$bb$msg\\E: $lineSeparator" + - values.joinToString(".*$lineSeparator") { "$afterFail$indentBb$listBulletPoint${act(it)}" } - - fun additionalElementsWarning(msg: String, values: Array, act: (T) -> String) = - "$additionalElementsFail\\Q$bb$msg\\E: $lineSeparator" + - values.joinToString(".*$lineSeparator") { - "$additionalElementsFail$indentBb$listBulletPoint${act(it)}" - } - - fun mismatchesAfterFail(vararg mismatched: Double) = - mismatchesWarning(mismatches, mismatched.toTypedArray()) { "$it" } - - fun additional(vararg entryWithValue: Pair) = - additionalElementsWarning(additionalElements, entryWithValue) { "${elementWithIndex(it.first)}: ${it.second}" } + notToContain.regex("\\Q${DescriptionIterableLikeProof.INDEX.string.format("$from..$to")}") + + fun mismatches(vararg mismatched: Double) = + "$inFail\\Q$bb$mismatches\\E : $lineSeparator" + + mismatched.toTypedArray().joinToString(lineSeparator) { "$inFail$indentBb$listBulletPoint$it" } + + fun Expect.additional(vararg entryWithValue: Pair) = + toContainRegex( + "$indentG$bb$additionalElements : $lineSeparator" + + entryWithValue + .joinToString(lineSeparator) { + "$indentG$indentBb$listBulletPoint${elementWithIndex(it.first)}\\s+: ${it.second}" + } + ) - val afterSuccess = "$indentRoot$indentSuccess$indentF$indentFeature" - fun successAfterSuccess(vararg expected: Double?) = element(afterSuccess, s, expected) - fun failAfterSuccess(vararg expected: Double?) = element(afterSuccess, x, expected) + val inSuccess = "$indentG$indentS$indentF$indentS" + fun successInSuccess(vararg expected: Double?) = element(inSuccess, s, expected) + fun failInSuccess(vararg expected: Double?) = element(inSuccess, x, expected) fun Expect.indexSuccess(index: Int, expected: Double): Expect { return this.toContain.exactly(1).regex( - "\\Q$s$f${index(index)}: $expected\\E.*$lineSeparator" + - "$toEqualAfterSuccess: $expected" + "$indentG\\Q$s$f\\E${index(index)}\\s+: \\Q$expected\\E$lineSeparator" + + "$indentG$indentS$indentF$s$toEqualDescr : $expected" ) } @@ -119,11 +111,10 @@ abstract class IterableToContainInOrderOnlyGroupedValuesExpectationsSpec( vararg expected: String ): Expect { return this.toContain.exactly(1).regex( - "\\Q$s$f${index(fromIndex, toIndex)}: $actual\\E.*$lineSeparator" + - "$sizeCheck.*$lineSeparator" + - "$indentRoot$indentX$indentF$featureBulletPoint$toContainInAnyOrderOnly: $lineSeparator" + - expected.joinToString(".*$lineSeparator") - + "$indentG\\Q$s$f${index(fromIndex, toIndex)} : $actual\\E.*$lineSeparator" + + "$indentG$sizeCheck$lineSeparator" + + "$indentG$indentS$indentF\\Q$s\\E$toContainInAnyOrderOnly : $lineSeparator" + + expected.joinToString(lineSeparator) ) } @@ -131,11 +122,10 @@ abstract class IterableToContainInOrderOnlyGroupedValuesExpectationsSpec( index: Int, actual: Any, expected: Double, - withBulletPoint: Boolean = true ): Expect { return this.toContain.exactly(1).regex( - "\\Q${if (withBulletPoint) x else ""}$f${index(index)}: $actual\\E.*$lineSeparator" + - "$toEqualAfterFailing: $expected" + "$indentG\\Q$g\\E$f${IterableToContainEntriesSpecBase.Companion.index(index)}\\s+: \\Q$actual\\E$lineSeparator" + + "$indentGg$indentF$x$toEqualDescr : $expected" ) } @@ -145,22 +135,20 @@ abstract class IterableToContainInOrderOnlyGroupedValuesExpectationsSpec( actual: List, sizeCheck: String?, vararg expected: String, - withBulletPoint: Boolean = true ): Expect { return this.toContain.exactly(1).regex( - "\\Q${if (withBulletPoint) x else ""}$f${ - index(fromIndex, toIndex) - }: $actual\\E.*$lineSeparator" + - (sizeCheck?.let { "$sizeCheck.*$lineSeparator" } ?: "") + - "$indentRoot${if (withBulletPoint) indentX else indentList}$indentF$featureBulletPoint$toContainInAnyOrderOnly: $lineSeparator" + - expected.joinToString(".*$lineSeparator") + "$indentG\\Q$g$f\\E${index(fromIndex, toIndex)} : \\Q$actual\\E.*$lineSeparator" + + (sizeCheck?.let { "$indentG$sizeCheck$lineSeparator" } ?: "") + + "$indentGg$indentF\\Q$g\\E$toContainInAnyOrderOnly : $lineSeparator" + + expected.joinToString(lineSeparator) ) } - fun Expect.indexNonExisting(index: Int, expected: Double, withBulletPoint: Boolean = true): Expect { + fun Expect.indexNonExisting(index: Int, expected: Double): Expect { return this.toContain.exactly(1).regex( - "\\Q${if (withBulletPoint) x else ""}$f${index(index)}: $sizeExceeded\\E.*$lineSeparator" + - "$afterFail$explanatoryBulletPoint$toEqualDescr: $expected" + //TODO 1.3.0 should be x and not g + "\\Q$g$f${index(index)} : $sizeExceeded\\E$lineSeparator" + + "$inFail$explanatoryBulletPoint$toEqualDescr : $expected" ) } @@ -168,15 +156,15 @@ abstract class IterableToContainInOrderOnlyGroupedValuesExpectationsSpec( fromIndex: Int, toIndex: Int, sizeCheck: String, vararg expected: Double, - withBulletPoint: Boolean = true ): Expect { return this.toContain.exactly(1).regex( - "\\Q${if (withBulletPoint) x else ""}$f${ - index(fromIndex, toIndex) - }: $sizeExceeded\\E.*$lineSeparator" + - "$afterFail$sizeCheck.*$lineSeparator" + - "$indentRoot${if (withBulletPoint) indentX else indentList}$indentF$indentFeature$explanatoryBulletPoint$toContainInAnyOrderOnly: $lineSeparator" + - expected.joinToString(".*$lineSeparator") { ".*$anElementWhichEquals: $it" } + //TODO 1.3.0 should be $x instead of $g + "\\Q$g$f${index(fromIndex, toIndex)} : $sizeExceeded\\E$lineSeparator" + + "$inFail$sizeCheck$lineSeparator" + + "$inFail$explanatoryBulletPoint$toContainInAnyOrderOnly : $lineSeparator" + + expected.joinToString(lineSeparator) { + "$inFail$indentExplanatory$listBulletPoint$anElementWhichEquals\\s+: $it" + } ) } @@ -218,14 +206,14 @@ abstract class IterableToContainInOrderOnlyGroupedValuesExpectationsSpec( } } - context("empty collection") { + context("empty iterable") { it("(1.0), (1.2) throws AssertionError") { expect { expect(fluentEmpty()).toContainFun(context(1.0), context(1.2)) }.toThrow { message { toContainSize(0, 2) - toContain.exactly(1).value("$rootBulletPoint$toContainInOrderOnlyGrouped:") + toContain.exactly(1).value("$g$toContainInOrderOnlyGrouped :") indexNonExisting(0, 1.0) indexNonExisting(1, 1.2) notToContain(additionalElements) @@ -258,21 +246,21 @@ abstract class IterableToContainInOrderOnlyGroupedValuesExpectationsSpec( expect(oneToFour()).toContainFun(context(4.0, 1.0), context(2.0, 3.0, 4.0)) }.toThrow { message { - toContain.exactly(1).value("$rootBulletPoint$toContainInOrderOnlyGrouped:") + toContain.exactly(1).value("$g$toContainInOrderOnlyGrouped :") indexFail( 0, 1, listOf(1.0, 2.0), - sizeCheck(2, 2), - failAfterFail(4.0), - successAfterFail(1.0), - mismatchesAfterFail(2.0) + sizeSuccessInFail(2, 2), + failInFail(4.0), + successInFail(1.0), + mismatches(2.0) ) indexFail( 2, 4, listOf(3.0, 4.0, 4.0), - sizeCheck(3, 3), - failAfterFail(2.0), - successAfterFail(3.0), - successAfterFail(4.0), - mismatchesAfterFail(4.0) + sizeSuccessInFail(3, 3), + failInFail(2.0), + successInFail(3.0), + successInFail(4.0), + mismatches(4.0) ) notToContain(size(indentRoot, s, 5, 5)) } @@ -284,15 +272,15 @@ abstract class IterableToContainInOrderOnlyGroupedValuesExpectationsSpec( expect(oneToFour()).toContainFun(context(1.0), context(4.0, 2.0, 3.0)) }.toThrow { message { - toContain.exactly(1).value("$rootBulletPoint$toContainInOrderOnlyGrouped:") + toContainSize(5, 4) + toContain.exactly(1).value("$g$toContainInOrderOnlyGrouped :") indexSuccess(0, 1.0) indexSuccess( 1, 3, listOf(2.0, 3.0, 4.0), - sizeCheck(3, 3), - successAfterSuccess(4.0, 2.0, 3.0) + sizeSuccessInSuccess(3, 3), + successInSuccess(4.0, 2.0, 3.0) ) - sizeCheck(5, 4) - toContainRegex(additional(4 to 4.0)) + additional(4 to 4.0) } } } @@ -302,11 +290,11 @@ abstract class IterableToContainInOrderOnlyGroupedValuesExpectationsSpec( expect(oneToFour()).toContainFun(context(1.0), context(4.0)) }.toThrow { message { - toContain.exactly(1).value("$rootBulletPoint$toContainInOrderOnlyGrouped:") + toContainSize(5, 2) + toContain.exactly(1).value("$g$toContainInOrderOnlyGrouped :") indexSuccess(0, 1.0) indexFail(1, 2.0, 4.0) - sizeCheck(5, 2) - toContainRegex(additional(2 to 3.0, 3 to 4.0, 4 to 4.0)) + additional(2 to 3.0, 3 to 4.0, 4 to 4.0) } } } @@ -315,17 +303,17 @@ abstract class IterableToContainInOrderOnlyGroupedValuesExpectationsSpec( expect(oneToFour()).toContainFun(context(1.0, 3.0), context(5.0)) }.toThrow { message { - toContain.exactly(1).value("$rootBulletPoint$toContainInOrderOnlyGrouped:") + toContainSize(5, 3) + toContain.exactly(1).value("$g$toContainInOrderOnlyGrouped :") indexFail( 0, 1, listOf(1.0, 2.0), - sizeCheck(2, 2), - successAfterFail(1.0), - failAfterFail(3.0), - mismatchesAfterFail(2.0) + sizeSuccessInFail(2, 2), + successInFail(1.0), + failInFail(3.0), + mismatches(2.0) ) indexFail(2, 3.0, 5.0) - sizeCheck(5, 3) - toContainRegex(additional(3 to 4.0, 4 to 4.0)) + additional(3 to 4.0, 4 to 4.0) } } } @@ -334,19 +322,19 @@ abstract class IterableToContainInOrderOnlyGroupedValuesExpectationsSpec( expect(oneToFour()).toContainFun(context(4.0, 1.0, 3.0, 2.0), context(5.0, 4.0)) }.toThrow { message { - toContain.exactly(1).value("$rootBulletPoint$toContainInOrderOnlyGrouped:") + toContainSize(5, 6) + toContain.exactly(1).value("$g$toContainInOrderOnlyGrouped :") indexSuccess( 0, 3, listOf(1.0, 2.0, 3.0, 4.0), - sizeCheck(4, 4), - successAfterSuccess(4.0, 1.0, 3.0, 2.0) + sizeSuccessInSuccess(4, 4), + successInSuccess(4.0, 1.0, 3.0, 2.0) ) indexFail( 4, 5, listOf(4.0), - sizeCheck(1, 2), - failAfterFail(5.0), - successAfterFail(4.0) + sizeFail(1, 2), + failInFail(5.0), + successInFail(4.0) ) - sizeCheck(5, 7) // TODO change back to 5,6 } } } @@ -365,33 +353,32 @@ abstract class IterableToContainInOrderOnlyGroupedValuesExpectationsSpec( }.toThrow { message { toContainSize(5, 14) - toContain.exactly(1).value("$rootBulletPoint$toContainInOrderOnlyGrouped:") + toContain.exactly(1).value("$g$toContainInOrderOnlyGrouped :") notToContainIndex(0, 0) indexFail( 1, 2, listOf(2.0, 3.0), null, - successAfterSuccess(2.0), - failAfterSuccess(4.0), - withBulletPoint = false + successInFail(2.0), + failInFail(4.0) ) indexFail( 3, 13, listOf(4.0, 4.0), - sizeCheck(2, 11), - failAfterFail(1.0, withBulletPoint = false), - failAfterFail(2.0, withBulletPoint = false), - failAfterFail(3.0, withBulletPoint = false), - failAfterFail(5.0, withBulletPoint = false), - failAfterFail(6.0, withBulletPoint = false), - failAfterFail(7.0, withBulletPoint = false), - failAfterFail(8.0, withBulletPoint = false), - failAfterFail(9.0, withBulletPoint = false), - failAfterFail(10.0, withBulletPoint = false), - failAfterFail(11.0, withBulletPoint = false), - withBulletPoint = false - ) - mismatchesAfterFail(4.0) + sizeFail(2, 11), + failInFail(1.0), + failInFail(2.0), + failInFail(3.0), + failInFail(5.0), + failInFail(6.0), + failInFail(7.0), + failInFail(8.0), + failInFail(9.0), + failInFail(10.0), + failInFail(11.0), + mismatches(4.0) + ) + } } } @@ -407,36 +394,34 @@ abstract class IterableToContainInOrderOnlyGroupedValuesExpectationsSpec( }.toThrow { message { toContainSize(5, 6) - toContain.exactly(1).value("$rootBulletPoint$toContainInOrderOnlyGrouped:") - notToContainIndex(1, 2) + toContain.exactly(1).value("$g$toContainInOrderOnlyGrouped :") + notToContainIndex(0, 2) indexFail( 3, 5, listOf(4.0, 4.0), - sizeCheck(2, 3), - failAfterFail(5.0, withBulletPoint = false), - withBulletPoint = false + sizeFail(2, 3), + failInFail(5.0) ) - notToContain("$anElementWhichEquals: 4.0") + notToContain.regex("$anElementWhichEquals\\s+: 4.0") } } } - it("shows only failing indices with report option `showOnlyFailingIfMoreExpectedElementsThan(3)` because there are 5 but still all elements in group") { + it("shows only failing indices with report option `showOnlyFailingIfMoreExpectedElementsThan(1)` because we have 2 groups but still all elements in group (as no has more than 10 expected elements)") { expect { expect(oneToFour()).toContainFun( context(1.0, 2.0, 3.0), context(4.0, 4.0, 5.0), - report = { showOnlyFailingIfMoreExpectedElementsThan(3) }) + report = { showOnlyFailingIfMoreExpectedElementsThan(1) }) }.toThrow { message { toContainSize(5, 6) - toContain.exactly(1).value("$rootBulletPoint$toContainInOrderOnlyGrouped:") - notToContainIndex(1, 2) + toContain.exactly(1).value("$g$toContainInOrderOnlyGrouped :") + notToContainIndex(0, 2) indexFail( 3, 5, listOf(4.0, 4.0), - sizeCheck(2, 3), - successAfterSuccess(4.0, 4.0), - failAfterFail(5.0), - withBulletPoint = false + sizeFail(2, 3), + successInFail(4.0, 4.0), + failInFail(5.0) ) } } @@ -463,62 +448,55 @@ abstract class IterableToContainInOrderOnlyGroupedValuesExpectationsSpec( message { toContainSize(11, 20) - toContain.exactly(1).value("$rootBulletPoint$toContainInOrderOnlyGrouped:") + toContain.exactly(1).value("$g$toContainInOrderOnlyGrouped :") indexFail( 0, 1, listOf(1.0, 2.0), null, //i.e no size check is shown as 2=2 and summary is only for inReportGroup - successAfterFail(1.0), - failAfterSuccess(1.0), - withBulletPoint = false + successInFail(1.0), + failInFail(1.0), + mismatches(2.0) ) - mismatchesAfterFail(2.0) - indexFail(2, 3.0, 2.0, withBulletPoint = false) + indexFail(2, 3.0, 2.0) indexFail( 3, 4, listOf(4.0, 5.0), null, //i.e no size check is shown as 2=2 and summary is only for inReportGroup - failAfterSuccess(3.0), - failAfterFail(-3.0), - withBulletPoint = false + failInFail(3.0), + failInFail(-3.0), + mismatches(4.0, 5.0) ) - mismatchesAfterFail(4.0, 5.0) indexFail( 5, 6, listOf(6.0, 7.0), null, //i.e no size check is shown as 2=2 and summary is only for inReportGroup - failAfterSuccess(1.0), - failAfterFail(4.0), - withBulletPoint = false + failInFail(1.0), + failInFail(4.0), + mismatches(6.0, 7.0) ) - mismatchesAfterFail(6.0, 7.0) notToContainIndex(7, 7) notToContainIndex(8, 9) indexFail( 10, 12, listOf(11.0), - sizeCheck(1, 3), - failAfterSuccess(-1.0), - failAfterFail(-2.0), - failAfterFail(9.0), - withBulletPoint = false + sizeFail(1, 3), + failInFail(-1.0), + failInFail(-2.0), + failInFail(9.0), + mismatches(11.0) ) - mismatchesAfterFail(11.0) indexNonExisting( 13, 14, size("", explanatoryBulletPoint, null, 2), - 7.0, 8.0, - withBulletPoint = false + 7.0, 8.0 ) indexNonExisting( 15, 16, size("", explanatoryBulletPoint, null, 2), - 9.0, -8.0, - withBulletPoint = false + 9.0, -8.0 ) indexNonExisting( 17, 18, size("", explanatoryBulletPoint, null, 2), - 10.0, 11.0, - withBulletPoint = false + 10.0, 11.0 ) - indexNonExisting(19, 12.0, withBulletPoint = false) + indexNonExisting(19, 12.0) } } } @@ -543,42 +521,42 @@ abstract class IterableToContainInOrderOnlyGroupedValuesExpectationsSpec( toContainSize(11, 20) indexFail( 0, 1, listOf(1.0, 2.0), - sizeCheck(2, 2), - successAfterFail(1.0), - failAfterSuccess(1.0) + sizeSuccessInFail(2, 2), + successInFail(1.0), + failInFail(1.0), + mismatches(2.0) ) - mismatchesAfterFail(2.0) indexFail(2, 3.0, 2.0) indexFail( 3, 4, listOf(4.0, 5.0), - sizeCheck(2, 2), - failAfterSuccess(3.0), - failAfterFail(-3.0) + sizeSuccessInFail(2, 2), + failInFail(3.0), + failInFail(-3.0), + mismatches(4.0, 5.0) ) - mismatchesAfterFail(4.0, 5.0) indexFail( 5, 6, listOf(6.0, 7.0), - sizeCheck(2, 2), - failAfterSuccess(1.0), - failAfterFail(4.0) + sizeSuccessInFail(2, 2), + failInFail(1.0), + failInFail(4.0), + mismatches(6.0, 7.0) ) - mismatchesAfterFail(6.0, 7.0) indexSuccess(7, 8.0) indexSuccess( 8, 9, listOf(9.0, 10.0), //TODO 1.3.0: https://github.com/robstoll/atrium/issues/724 should not be shown, is enough to show the indices - sizeCheck(2, 2), - successAfterSuccess(10.0), - successAfterSuccess(9.0) + sizeSuccessInSuccess(2, 2), + successInSuccess(10.0), + successInSuccess(9.0) ) indexFail( 10, 12, listOf(11.0), - sizeCheck(1, 3), - failAfterFail(-1.0), - failAfterFail(-2.0), - failAfterFail(9.0) + sizeFail(1, 3), + failInFail(-1.0), + failInFail(-2.0), + failInFail(9.0), + mismatches(11.0) ) - mismatchesAfterFail(11.0) indexNonExisting( 13, 14, size("", explanatoryBulletPoint, null, 2), @@ -618,61 +596,54 @@ abstract class IterableToContainInOrderOnlyGroupedValuesExpectationsSpec( }.toThrow { message { toContainSize(11, 20) - toContain.exactly(1).value("$rootBulletPoint$toContainInOrderOnlyGrouped:") + toContain.exactly(1).value("$g$toContainInOrderOnlyGrouped :") indexFail( 0, 1, listOf(1.0, 2.0), null, //i.e no size check is shown as 2=2 and summary is only for inReportGroup - failAfterFail(1.0, withBulletPoint = false), - withBulletPoint = false + failInFail(1.0), + mismatches(2.0) ) - mismatchesAfterFail(2.0) - indexFail(2, 3.0, 2.0, withBulletPoint = false) + indexFail(2, 3.0, 2.0) indexFail( 3, 4, listOf(4.0, 5.0), null, //i.e no size check is shown as 2=2 and summary is only for inReportGroup - failAfterFail(3.0, withBulletPoint = false), - failAfterFail(-3.0, withBulletPoint = false), - withBulletPoint = false + failInFail(3.0), + failInFail(-3.0), + mismatches(4.0, 5.0) ) - mismatchesAfterFail(4.0, 5.0) indexFail( 5, 6, listOf(6.0, 7.0), null, //i.e no size check is shown as 2=2 and summary is only for inReportGroup - failAfterFail(1.0, withBulletPoint = false), - failAfterFail(4.0, withBulletPoint = false), - withBulletPoint = false + failInFail(1.0), + failInFail(4.0), + mismatches(6.0, 7.0) ) - mismatchesAfterFail(6.0, 7.0) notToContainIndex(7, 7) notToContainIndex(8, 9) indexFail( 10, 12, listOf(11.0), - sizeCheck(1, 3), - failAfterFail(-1.0, withBulletPoint = false), - failAfterFail(-2.0, withBulletPoint = false), - failAfterFail(9.0, withBulletPoint = false), - withBulletPoint = false + sizeFail(1, 3), + failInFail(-1.0), + failInFail(-2.0), + failInFail(9.0), + mismatches(11.0) ) - mismatchesAfterFail(11.0) indexNonExisting( 13, 14, size("", explanatoryBulletPoint, null, 2), - 7.0, 8.0, - withBulletPoint = false + 7.0, 8.0 ) indexNonExisting( 15, 16, size("", explanatoryBulletPoint, null, 2), - 9.0, -8.0, - withBulletPoint = false + 9.0, -8.0 ) indexNonExisting( 17, 18, size("", explanatoryBulletPoint, null, 2), - 10.0, 11.0, - withBulletPoint = false + 10.0, 11.0 ) - indexNonExisting(19, 12.0, withBulletPoint = false) + indexNonExisting(19, 12.0) } } } @@ -720,18 +691,18 @@ abstract class IterableToContainInOrderOnlyGroupedValuesExpectationsSpec( ) }.toThrow { message { - toContain.exactly(1).value("$rootBulletPoint$toContainInOrderOnlyGrouped:") + toContain.exactly(1).value("$g$toContainInOrderOnlyGrouped :") indexFail( 0, 1, listOf(null, 1.0), - sizeCheck(2, 2), - successAfterFail(null), - failAfterFail(null) + sizeSuccessInFail(2, 2), + successInFail(null), + failInFail(null) ) indexFail( 2, 3, listOf(null, 3.0), - sizeCheck(2, 2), - successAfterFail(3.0), - failAfterFail(1.0) + sizeSuccessInFail(2, 2), + successInFail(3.0), + failInFail(1.0) ) notToContain(size(indentRoot, s, 4, 4)) } @@ -746,19 +717,19 @@ abstract class IterableToContainInOrderOnlyGroupedValuesExpectationsSpec( ) }.toThrow { message { - toContain.exactly(1).value("$rootBulletPoint$toContainInOrderOnlyGrouped:") + toContain.exactly(1).value("$g$toContainInOrderOnlyGrouped :") indexSuccess( 0, 1, listOf(null, 1.0), - sizeCheck(2, 2), - successAfterSuccess(null), - successAfterSuccess(1.0) + sizeSuccessInSuccess(2, 2), + successInSuccess(null), + successInSuccess(1.0) ) indexFail( 2, 4, listOf(null, 3.0), - sizeCheck(2, 3), - successAfterFail(3.0), - successAfterFail(null), - failAfterFail(null) + sizeFail(2, 3), + successInFail(3.0), + successInFail(null), + failInFail(null) ) toContainSize(4, 5) } diff --git a/misc/atrium-specs/src/commonMain/kotlin/ch/tutteli/atrium/specs/integration/IterableToContainInOrderOnlyValuesExpectationsSpec.kt b/misc/atrium-specs/src/commonMain/kotlin/ch/tutteli/atrium/specs/integration/IterableToContainInOrderOnlyValuesExpectationsSpec.kt index 830751d2b2..16fb23df47 100644 --- a/misc/atrium-specs/src/commonMain/kotlin/ch/tutteli/atrium/specs/integration/IterableToContainInOrderOnlyValuesExpectationsSpec.kt +++ b/misc/atrium-specs/src/commonMain/kotlin/ch/tutteli/atrium/specs/integration/IterableToContainInOrderOnlyValuesExpectationsSpec.kt @@ -23,15 +23,14 @@ abstract class IterableToContainInOrderOnlyValuesExpectationsSpec( toContainInOrderOnlyNullableValues.forSubjectLess(2.5, arrayOf(), emptyInOrderOnlyReportOptions) ) {}) - val toBeWithFeature = "$indentF$featureBulletPoint$toEqualDescr" - val toBeAfterSuccess = "$indentRoot$indentSuccess$toBeWithFeature" - val toBeAfterFailing = "$indentRoot$indentX$toBeWithFeature" + val toEqualAfterSuccess = "$indentG$indentS$indentF$s$toEqualDescr" + val toEqualAfterFailing = "$indentGg$indentF$x$toEqualDescr" fun Expect.elementSuccess(index: Int, expected: String, withBulletPoint: Boolean = true): Expect = this.toContain.exactly(1).regex( - "\\Q${if (withBulletPoint) s else ""}$f${elementWithIndex(index)}: $expected\\E.*$lineSeparator" + - "$toBeAfterSuccess: $expected" + "${if (withBulletPoint) "\\Q$s\\E" else ""}$f${elementWithIndex(index)}\\s+: $expected$lineSeparator" + + "$toEqualAfterSuccess\\s+: $expected" ) fun Expect.elementSuccess(index: Int, expected: Double) = elementSuccess(index, expected.toString()) @@ -43,8 +42,8 @@ abstract class IterableToContainInOrderOnlyValuesExpectationsSpec( withBulletPoint: Boolean = true ): Expect { return this.toContain.exactly(1).regex( - "\\Q${if (withBulletPoint) x else ""}$f${elementWithIndex(index)}: $actual\\E.*$lineSeparator" + - "$toBeAfterFailing: $expected" + "${if (withBulletPoint) "\\Q$g\\E" else ""}$f${elementWithIndex(index)}\\s+: $actual$lineSeparator" + + "$toEqualAfterFailing\\s+: $expected" ) } @@ -54,8 +53,8 @@ abstract class IterableToContainInOrderOnlyValuesExpectationsSpec( withBulletPoint: Boolean = true ): Expect { return this.toContain.exactly(1).regex( - "\\Q${if (withBulletPoint) x else ""}$f${elementWithIndex(index)}: $sizeExceeded\\E.*$lineSeparator" + - "$indentRoot$indentX$indentF$indentFeature$explanatoryBulletPoint$toEqualDescr: $expected" + "\\Q${if (withBulletPoint) g else ""}$f${elementWithIndex(index)} : $sizeExceeded\\E.*$lineSeparator" + + "$indentGg$indentF$explanatoryBulletPoint$toEqualDescr : $expected" ) } @@ -78,7 +77,7 @@ abstract class IterableToContainInOrderOnlyValuesExpectationsSpec( expect(fluentEmpty()).toContainFun(1.0) }.toThrow { message { - toContain("$rootBulletPoint$toContainInOrderOnly:") + toContain("$g$toContainInOrderOnly :") elementNonExisting(0, 1.0) notToContain(additionalElements) toContainSize(0, 1) @@ -90,7 +89,7 @@ abstract class IterableToContainInOrderOnlyValuesExpectationsSpec( expect(fluentEmpty()).toContainFun(1.0, 4.0) }.toThrow { message { - toContain("$rootBulletPoint$toContainInOrderOnly:") + toContain("$g$toContainInOrderOnly :") elementNonExisting(0, 1.0) elementNonExisting(1, 4.0) notToContain(additionalElements) @@ -115,7 +114,7 @@ abstract class IterableToContainInOrderOnlyValuesExpectationsSpec( expect(oneToFour()).toContainFun(4.0, 1.0, 2.0, 3.0, 4.0) }.toThrow { message { - toContain.exactly(1).value("$rootBulletPoint$toContainInOrderOnly:") + toContain.exactly(1).value("$g$toContainInOrderOnly :") elementFailing(0, 1.0, 4.0) elementFailing(1, 2.0, 1.0) elementFailing(2, 3.0, 2.0) @@ -131,15 +130,13 @@ abstract class IterableToContainInOrderOnlyValuesExpectationsSpec( expect(oneToFour()).toContainFun(1.0, 2.0, 3.0, 4.0) }.toThrow { message { - toContain.exactly(1).value("$rootBulletPoint$toContainInOrderOnly:") + toContain.exactly(1).value("$g$toContainInOrderOnly :") elementSuccess(0, 1.0) elementSuccess(1, 2.0) elementSuccess(2, 3.0) elementSuccess(3, 4.0) - toContain( - "$bb$additionalElements:", - "$listBulletPoint${elementWithIndex(4)}: 4.0" - ) + toContain("$bb$additionalElements :") + toContainRegex("$listBulletPoint${elementWithIndex(4)}\\s+: 4.0") toContainSize(5, 4) } } @@ -150,14 +147,15 @@ abstract class IterableToContainInOrderOnlyValuesExpectationsSpec( expect(oneToFour()).toContainFun(1.0, 4.0) }.toThrow { message { - toContain.exactly(1).value("$rootBulletPoint$toContainInOrderOnly:") + toContain.exactly(1).value("$g$toContainInOrderOnly :") elementSuccess(0, 1.0) elementFailing(1, 2.0, 4.0) - toContain( - "$bb$additionalElements:", - "$listBulletPoint${elementWithIndex(2)}: 3.0", - "$listBulletPoint${elementWithIndex(3)}: 4.0", - "$listBulletPoint${elementWithIndex(4)}: 4.0" + toContain("$bb$additionalElements :") + toContainRegex( + //TODO 1.3.0 would expect that the elements define an own level + "$listBulletPoint${elementWithIndex(2)}\\s+: 3.0", + "$listBulletPoint${elementWithIndex(3)}\\s+: 4.0", + "$listBulletPoint${elementWithIndex(4)}\\s+: 4.0" ) toContainSize(5, 2) } @@ -168,14 +166,14 @@ abstract class IterableToContainInOrderOnlyValuesExpectationsSpec( expect(oneToFour()).toContainFun(1.0, 3.0, 5.0) }.toThrow { message { - toContain.exactly(1).value("$rootBulletPoint$toContainInOrderOnly:") + toContain.exactly(1).value("$g$toContainInOrderOnly :") elementSuccess(0, 1.0) elementFailing(1, 2.0, 3.0) elementFailing(2, 3.0, 5.0) - toContain( - "$bb$additionalElements:", - "$listBulletPoint${elementWithIndex(3)}: 4.0", - "$listBulletPoint${elementWithIndex(4)}: 4.0" + toContain("$bb$additionalElements :") + toContainRegex( + "$listBulletPoint${elementWithIndex(3)}\\s+: 4.0", + "$listBulletPoint${elementWithIndex(4)}\\s+: 4.0" ) toContainSize(5, 3) } @@ -186,7 +184,7 @@ abstract class IterableToContainInOrderOnlyValuesExpectationsSpec( expect(oneToFour()).toContainFun(1.0, 2.0, 3.0, 4.0, 4.0, 5.0) }.toThrow { message { - toContain.exactly(1).value("$rootBulletPoint$toContainInOrderOnly:") + toContain.exactly(1).value("$g$toContainInOrderOnly :") elementSuccess(0, 1.0) elementSuccess(1, 2.0) elementSuccess(2, 3.0) @@ -252,11 +250,11 @@ abstract class IterableToContainInOrderOnlyValuesExpectationsSpec( toContainSize(5, 2) elementSuccess(0, 1.0) elementSuccess(1, 2.0) - toContain( - "$bb$additionalElements:", - "$listBulletPoint${elementWithIndex(2)}: 3.0", - "$listBulletPoint${elementWithIndex(3)}: 4.0", - "$listBulletPoint${elementWithIndex(4)}: 4.0" + toContain("$bb$additionalElements :") + toContainRegex( + "$listBulletPoint${elementWithIndex(2)}\\s+: 3.0", + "$listBulletPoint${elementWithIndex(3)}\\s+: 4.0", + "$listBulletPoint${elementWithIndex(4)}\\s+: 4.0" ) } @@ -326,14 +324,12 @@ abstract class IterableToContainInOrderOnlyValuesExpectationsSpec( expect(null1null3()).toContainFun(null, 1.0, 3.0) }.toThrow { message { - toContain.exactly(1).value("$rootBulletPoint$toContainInOrderOnly:") + toContain.exactly(1).value("$g$toContainInOrderOnly :") elementSuccess(0, Text.NULL.string) elementSuccess(1, 1.0) elementFailing(2, Text.NULL.string, 3.0) - toContain( - "$bb$additionalElements:", - "$listBulletPoint${elementWithIndex(3)}: 3.0" - ) + toContain("$bb$additionalElements :") + toContainRegex("$listBulletPoint${elementWithIndex(3)}\\s+: 3.0") toContainSize(4, 3) } } diff --git a/misc/atrium-specs/src/commonMain/kotlin/ch/tutteli/atrium/specs/integration/IterableToContainSpecBase.kt b/misc/atrium-specs/src/commonMain/kotlin/ch/tutteli/atrium/specs/integration/IterableToContainSpecBase.kt index 0ef4fd28ec..79d426e201 100644 --- a/misc/atrium-specs/src/commonMain/kotlin/ch/tutteli/atrium/specs/integration/IterableToContainSpecBase.kt +++ b/misc/atrium-specs/src/commonMain/kotlin/ch/tutteli/atrium/specs/integration/IterableToContainSpecBase.kt @@ -68,7 +68,8 @@ abstract class IterableToContainSpecBase(spec: Root.() -> Unit) : Spek(spec) { val emptyInAnyOrderOnlyReportOptions: InAnyOrderOnlyReportingOptions.() -> Unit = {} fun Expect.toContainSize(actual: Int, expected: Int) = - toContain.exactly(1).regex("$g$f${DescriptionCollectionProof.SIZE.string}\\s+: $actual$lineSeparator\\s+$x${DescriptionAnyProof.TO_EQUAL.string}\\s+: $expected") + toContain.exactly(1).regex("$g$f${DescriptionCollectionProof.SIZE.string}\\s+: $actual$lineSeparator"+ + "\\s+$x${DescriptionAnyProof.TO_EQUAL.string}\\s+: $expected") fun Expect.notToContainElement(index: Int, expected: Double): Expect = notToContain.regex("\\Q${elementWithIndex(index)} : ${expected}\\E.*$lineSeparator") diff --git a/misc/atrium-specs/src/commonMain/kotlin/ch/tutteli/atrium/specs/integration/IterableToHaveElementsAndAllExpectationsSpec.kt b/misc/atrium-specs/src/commonMain/kotlin/ch/tutteli/atrium/specs/integration/IterableToHaveElementsAndAllExpectationsSpec.kt index 81c5c257e5..91bf4f8d52 100644 --- a/misc/atrium-specs/src/commonMain/kotlin/ch/tutteli/atrium/specs/integration/IterableToHaveElementsAndAllExpectationsSpec.kt +++ b/misc/atrium-specs/src/commonMain/kotlin/ch/tutteli/atrium/specs/integration/IterableToHaveElementsAndAllExpectationsSpec.kt @@ -5,9 +5,9 @@ import ch.tutteli.atrium.api.verbs.internal.expect import ch.tutteli.atrium.core.polyfills.format import ch.tutteli.atrium.creating.Expect import ch.tutteli.atrium.logic.utils.expectLambda +import ch.tutteli.atrium.reporting.reportables.descriptions.DescriptionIterableLikeProof import ch.tutteli.atrium.specs.* import ch.tutteli.atrium.specs.lineSeparator -import ch.tutteli.atrium.translations.DescriptionIterableLikeExpectation abstract class IterableToHaveElementsAndAllExpectationsSpec( toHaveElementsAndAll: Fun1, Expect.() -> Unit>, @@ -15,11 +15,18 @@ abstract class IterableToHaveElementsAndAllExpectationsSpec( describePrefix: String = "[Atrium] " ) : IterableToContainEntriesSpecBase({ - include(object : SubjectLessSpec>(describePrefix, + include(object : SubjectLessSpec>( + describePrefix, toHaveElementsAndAll.first to expectLambda { toHaveElementsAndAll.second(this) { toEqual(2.5) } } ) {}) - include(object : SubjectLessSpec>(describePrefix, - "${toHaveElementsAndAllNullable.first} for nullable" to expectLambda { toHaveElementsAndAllNullable.second(this, null) } + include(object : SubjectLessSpec>( + describePrefix, + "${toHaveElementsAndAllNullable.first} for nullable" to expectLambda { + toHaveElementsAndAllNullable.second( + this, + null + ) + } ) {}) include(object : AssertionCreatorSpec>( @@ -31,11 +38,11 @@ abstract class IterableToHaveElementsAndAllExpectationsSpec( toHaveElementsAndAllNullable.forAssertionCreatorSpec("$toBeGreaterThanDescr\\s+: 0.0") { toBeGreaterThan(0.0) } ) {}) - val allElementsDescr = DescriptionIterableLikeExpectation.ALL_ELEMENTS.getDefault() + val allElementsDescr = DescriptionIterableLikeProof.ALL_ELEMENTS.string - val explanatoryPointWithIndent = "$indentRoot$indentList$explanatoryBulletPoint" + val explanatoryPointWithIndent = "$indentG$explanatoryBulletPoint" - fun index(index: Int) = listBulletPoint + DescriptionIterableLikeExpectation.INDEX.getDefault().format(index) + fun index(index: Int) = listBulletPoint + DescriptionIterableLikeProof.INDEX.string.format(index) nonNullableCases( describePrefix, @@ -43,15 +50,15 @@ abstract class IterableToHaveElementsAndAllExpectationsSpec( toHaveElementsAndAllNullable ) { toHaveElementsAndAllFun -> - context("empty collection") { + context("empty iterable") { it("throws AssertionError as there needs to be at least one element") { expect { expect(fluentEmpty()).toHaveElementsAndAllFun { toBeLessThan(1.0) } }.toThrow { message.toContainRegex( - "${toHaveDescr}\\s+: ${aNextElement}", - "$explanatoryBulletPoint$allElementsDescr: ", - "$explanatoryPointWithIndent$toBeLessThanDescr: 1.0" + "${toHaveDescr}\\s+: $aNextElement", + "$explanatoryBulletPoint$allElementsDescr : ", + "$explanatoryPointWithIndent$toBeLessThanDescr : 1.0" ) } } @@ -64,14 +71,17 @@ abstract class IterableToHaveElementsAndAllExpectationsSpec( expect(oneToSeven()).toHaveElementsAndAllFun { toBeGreaterThan(2.5); toBeLessThan(7.0) } }.toThrow { message { - toContain.exactly(1).values( - "$rootBulletPoint$allElementsDescr: $lineSeparator", - "$explanatoryPointWithIndent$toBeGreaterThanDescr: 2.5", - "$explanatoryPointWithIndent$toBeLessThanDescr: 7.0", - "$bb$mismatches:", - "${index(0)}: 1.0", - "${index(1)}: 2.0", - "${index(9)}: 7.0" + toContain.exactly(1).values("$g$allElementsDescr : $lineSeparator") + toContain.exactly(1).regex( + "$explanatoryPointWithIndent$toBeGreaterThanDescr\\s+: 2.5", + "$explanatoryPointWithIndent$toBeLessThanDescr\\s+: 7.0", + ) + toContain.exactly(1).regex( + "$bb$mismatches :", + //TODO 1.3.0 we should see why they failed and they should be on an own level + "${index(0)}\\s+: 1.0", + "${index(1)}\\s+: 2.0", + "${index(9)}\\s+: 7.0" ) } } @@ -105,11 +115,13 @@ abstract class IterableToHaveElementsAndAllExpectationsSpec( }.toThrow { message { toContain.exactly(1).values( - "$rootBulletPoint$allElementsDescr: $lineSeparator", - "$explanatoryPointWithIndent$toBeGreaterThanDescr: 0.5", - "$bb$mismatches:", - "${index(1)}: null", - "${index(5)}: null" + "$g$allElementsDescr : $lineSeparator", + "$explanatoryPointWithIndent$toBeGreaterThanDescr : 0.5", + "$bb$mismatches :" + ) + toContain.exactly(1).regex( + "${index(1)}\\s+: null", + "${index(5)}\\s+: null" ) } } diff --git a/misc/atrium-specs/src/commonMain/kotlin/ch/tutteli/atrium/specs/integration/IterableToHaveElementsAndAnyExpectationsSpec.kt b/misc/atrium-specs/src/commonMain/kotlin/ch/tutteli/atrium/specs/integration/IterableToHaveElementsAndAnyExpectationsSpec.kt index 1254fd7be2..6c7c33ad1b 100644 --- a/misc/atrium-specs/src/commonMain/kotlin/ch/tutteli/atrium/specs/integration/IterableToHaveElementsAndAnyExpectationsSpec.kt +++ b/misc/atrium-specs/src/commonMain/kotlin/ch/tutteli/atrium/specs/integration/IterableToHaveElementsAndAnyExpectationsSpec.kt @@ -3,9 +3,9 @@ package ch.tutteli.atrium.specs.integration import ch.tutteli.atrium.api.fluent.en_GB.* import ch.tutteli.atrium.api.verbs.internal.expect import ch.tutteli.atrium.creating.Expect +import ch.tutteli.atrium.reporting.reportables.descriptions.DescriptionComparableProof import ch.tutteli.atrium.specs.* import ch.tutteli.atrium.specs.lineSeparator -import ch.tutteli.atrium.translations.DescriptionComparableExpectation abstract class IterableToHaveElementsAndAnyExpectationsSpec( toHaveElementsAndAny: Fun1, Expect.() -> Unit>, @@ -13,8 +13,6 @@ abstract class IterableToHaveElementsAndAnyExpectationsSpec( describePrefix: String = "[Atrium] " ) : IterableToContainEntriesSpecBase({ - val toBeGreaterThanDescr = DescriptionComparableExpectation.TO_BE_GREATER_THAN.getDefault() - include(object : SubjectLessSpec>(describePrefix, toHaveElementsAndAny.forSubjectLess { toEqual(2.5) } ) {}) @@ -38,15 +36,17 @@ abstract class IterableToHaveElementsAndAnyExpectationsSpec( toHaveElementsAndAnyNullable ) { toHaveElementsAndAnyFun -> - context("empty collection") { + context("empty iterable") { it("throws AssertionError as there needs to be at least one element") { expect { expect(fluentEmpty()).toHaveElementsAndAnyFun { toBeLessThan(1.0) } }.toThrow { messageToContain( - "$rootBulletPoint$toContainInAnyOrder: $lineSeparator", - "$anElementWhichNeedsDescr: $lineSeparator", - "$toBeLessThanDescr: 1.0", + //TODO 1.3.0 should be x and not g + "$g$toContainInAnyOrder : $lineSeparator", + "$anElementWhichNeedsDescr : $lineSeparator", + "$toBeLessThanDescr : 1.0", + //TODO 1.3.0 should not be necessary noSuchElementDescr ) @@ -60,13 +60,17 @@ abstract class IterableToHaveElementsAndAnyExpectationsSpec( expect { expect(oneToSeven()).toHaveElementsAndAnyFun { toBeGreaterThan(1.0); toBeLessThan(2.0) } }.toThrow { - messageToContain( - "$rootBulletPoint$toContainInAnyOrder: $lineSeparator", - "$anElementWhichNeedsDescr: $lineSeparator", - "$toBeGreaterThanDescr: 1.0", - "$toBeLessThanDescr: 2.0", - noSuchElementDescr - ) + message { + toContain.exactly(1).values( + "$g$toContainInAnyOrder : $lineSeparator", + "$anElementWhichNeedsDescr : $lineSeparator" + ) + toContain.exactly(1).regex( + "$toBeGreaterThanDescr\\s+: 1.0", + "$toBeLessThanDescr\\s+: 2.0", + noSuchElementDescr + ) + } } } } @@ -101,9 +105,9 @@ abstract class IterableToHaveElementsAndAnyExpectationsSpec( }.toThrow { message { toContain.exactly(1).values( - "$rootBulletPoint$toContainInAnyOrder: $lineSeparator", - "$anElementWhichNeedsDescr: $lineSeparator", - "$toEqualDescr: 2.0", + "$g$toContainInAnyOrder : $lineSeparator", + "$anElementWhichNeedsDescr : $lineSeparator", + "$toEqualDescr : 2.0", noSuchElementDescr ) } @@ -119,9 +123,9 @@ abstract class IterableToHaveElementsAndAnyExpectationsSpec( }.toThrow { message { toContain.exactly(1).values( - "$rootBulletPoint$toContainInAnyOrder: $lineSeparator", - "$anElementWhichNeedsDescr: $lineSeparator", - "$toEqualDescr: null", + "$g$toContainInAnyOrder : $lineSeparator", + "$anElementWhichNeedsDescr : $lineSeparator", + "$toEqualDescr : null", noSuchElementDescr ) } diff --git a/misc/atrium-specs/src/commonMain/kotlin/ch/tutteli/atrium/specs/integration/IterableToHaveElementsAndNoneExpectationsSpec.kt b/misc/atrium-specs/src/commonMain/kotlin/ch/tutteli/atrium/specs/integration/IterableToHaveElementsAndNoneExpectationsSpec.kt index d29d336739..9fc8ee9a53 100644 --- a/misc/atrium-specs/src/commonMain/kotlin/ch/tutteli/atrium/specs/integration/IterableToHaveElementsAndNoneExpectationsSpec.kt +++ b/misc/atrium-specs/src/commonMain/kotlin/ch/tutteli/atrium/specs/integration/IterableToHaveElementsAndNoneExpectationsSpec.kt @@ -2,21 +2,26 @@ package ch.tutteli.atrium.specs.integration import ch.tutteli.atrium.api.fluent.en_GB.* import ch.tutteli.atrium.api.verbs.internal.expect +import ch.tutteli.atrium.core.polyfills.format import ch.tutteli.atrium.creating.Expect +import ch.tutteli.atrium.reporting.reportables.descriptions.DescriptionIterableLikeProof +import ch.tutteli.atrium.reporting.reportables.descriptions.DescriptionIterableLikeProof.USE_NOT_TO_HAVE_ELEMENTS_OR_NONE import ch.tutteli.atrium.specs.* import ch.tutteli.atrium.specs.lineSeparator -import ch.tutteli.atrium.translations.DescriptionIterableLikeExpectation abstract class IterableToHaveElementsAndNoneExpectationsSpec( toHaveElementsAndNone: Fun1, Expect.() -> Unit>, toHaveElementsAndNoneNullable: Fun1, (Expect.() -> Unit)?>, + notToHaveElementsOrNoneFunName: String, describePrefix: String = "[Atrium] " ) : IterableToContainEntriesSpecBase({ - include(object : SubjectLessSpec>(describePrefix, + include(object : SubjectLessSpec>( + describePrefix, toHaveElementsAndNone.forSubjectLess { toEqual(2.3) } ) {}) - include(object : SubjectLessSpec>(describePrefix, + include(object : SubjectLessSpec>( + describePrefix, toHaveElementsAndNoneNullable.forSubjectLess { toEqual(2.3) } ) {}) @@ -29,28 +34,23 @@ abstract class IterableToHaveElementsAndNoneExpectationsSpec( toHaveElementsAndNoneNullable.forAssertionCreatorSpec("$toBeGreaterThanDescr\\s+: 10.0") { toBeGreaterThan(10.0) } ) {}) - val containsNotDescr = DescriptionIterableLikeExpectation.NOT_TO_CONTAIN.getDefault() - nonNullableCases( describePrefix, toHaveElementsAndNone, toHaveElementsAndNoneNullable ) { toHaveElementsAndNoneFun -> - context("empty collection") { + context("empty iterable") { it("throws AssertionError as there needs to be at least one element") { expect { expect(fluentEmpty()).toHaveElementsAndNoneFun { toBeLessThan(1.0) } - }.toThrow { - message { - toContainRegex( - "${toHaveDescr}\\s+: ${aNextElement}$lineSeparator" + - "$indentRoot\\Q$explanatoryBulletPoint\\E$containsNotDescr: $lineSeparator" + - "$indentRoot$indentList\\Q$listBulletPoint\\E$anElementWhichNeedsDescr: $lineSeparator" + - "$indentList$afterExplanatory$toBeLessThanDescr: 1.0.*" - ) - } - } + }.toThrow().message.toContainRegex( + "\\Q$x\\E$toHaveDescr\\s+: ${aNextElement}$lineSeparator" + + "$indentG$explanatoryBulletPoint$notToContainDescr : $lineSeparator" + + "$indentG$indentExplanatory$listBulletPoint$anElementWhichNeedsDescr : $lineSeparator" + + "$indentG$indentExplanatory$indentList$explanatoryBulletPoint$toBeLessThanDescr : 1.0$lineSeparator" + + "$indentX$u${USE_NOT_TO_HAVE_ELEMENTS_OR_NONE.string.format(notToHaveElementsOrNoneFunName)}" + ) } } @@ -67,19 +67,15 @@ abstract class IterableToHaveElementsAndNoneExpectationsSpec( it("$toEqualDescr(4.0) throws AssertionError") { expect { expect(oneToSeven()).toHaveElementsAndNoneFun { toEqual(4.0) } - }.toThrow { - message { - toContainRegex( - "\\Q$rootBulletPoint\\E$containsNotDescr: $lineSeparator" + - "$indentRoot\\Q$listBulletPoint\\E$anElementWhichNeedsDescr: $lineSeparator" + - "$afterExplanatory$toEqualDescr: 4.0.*$lineSeparator" + - "$afterExplanatoryIndent\\Q$bb$mismatches:\\E $lineSeparator" + - "$afterMismatchedWarning${mismatchedIndex(2, "4.0")}.*$lineSeparator" + - "$afterMismatchedWarning${mismatchedIndex(3, "4.0")}.*$lineSeparator" + - "$afterMismatchedWarning${mismatchedIndex(8, "4.0")}.*" - ) - } - } + }.toThrow().message.toContainRegex( + "\\Q$g\\E${notToContainDescr} : $lineSeparator" + + "$indentG\\Q$g\\E$anElementWhichNeedsDescr : $lineSeparator" + + "$indentGg$explanatoryBulletPoint$toEqualDescr : 4.0$lineSeparator" + + "$indentGg$bb$mismatches : $lineSeparator" + + "$indentGg$indentBb$listBulletPoint${mismatchedIndex(2, "4.0")}$lineSeparator" + + "$indentGg$indentBb$listBulletPoint${mismatchedIndex(3, "4.0")}$lineSeparator" + + "$indentGg$indentBb$listBulletPoint${mismatchedIndex(8, "4.0")}" + ) } } } @@ -97,34 +93,26 @@ abstract class IterableToHaveElementsAndNoneExpectationsSpec( it("null throws AssertionError") { expect { expect(oneToSevenNullable()).toHaveElementsAndNoneFun(null) - }.toThrow { - message { - toContainRegex( - "\\Q$rootBulletPoint\\E$containsNotDescr: $lineSeparator" + - "$indentRoot\\Q$listBulletPoint\\E$anElementWhichNeedsDescr: $lineSeparator" + - "$afterExplanatory$toEqualDescr: null$lineSeparator" + - "$afterExplanatoryIndent\\Q$bb$mismatches:\\E $lineSeparator" + - "$afterMismatchedWarning${mismatchedIndex(1, "null")}.*$lineSeparator" + - "$afterMismatchedWarning${mismatchedIndex(5, "null")}.*" - ) - } - } + }.toThrow().message.toContainRegex( + "\\Q$g\\E${notToContainDescr} : $lineSeparator" + + "$indentG\\Q$g\\E$anElementWhichNeedsDescr : $lineSeparator" + + "$indentGg$explanatoryBulletPoint$toEqualDescr : null$lineSeparator" + + "$indentGg$bb$mismatches : $lineSeparator" + + "$indentGg$indentBb$listBulletPoint${mismatchedIndex(1, "null")}$lineSeparator" + + "$indentGg$indentBb$listBulletPoint${mismatchedIndex(5, "null")}" + ) } it("1.0 throws AssertionError") { expect { expect(oneToSevenNullable()).toHaveElementsAndNoneFun { toEqual(1.0) } - }.toThrow { - message { - toContainRegex( - "\\Q$rootBulletPoint\\E$containsNotDescr: $lineSeparator" + - "$indentRoot\\Q$listBulletPoint\\E$anElementWhichNeedsDescr: $lineSeparator" + - "$afterExplanatory$toEqualDescr: 1.0.*$lineSeparator" + - "$afterExplanatoryIndent\\Q$bb$mismatches:\\E $lineSeparator" + - "$afterMismatchedWarning${mismatchedIndex(0, "1.0")}.*" - ) - } - } + }.toThrow().message.toContainRegex( + "\\Q$g\\E${notToContainDescr} : $lineSeparator" + + "$indentG\\Q$g\\E$anElementWhichNeedsDescr : $lineSeparator" + + "$indentGg$explanatoryBulletPoint$toEqualDescr : 1.0$lineSeparator" + + "$indentGg$bb$mismatches : $lineSeparator" + + "$indentGg$indentBb$listBulletPoint${mismatchedIndex(0, "1.0")}" + ) } } } diff --git a/misc/atrium-specs/src/commonMain/kotlin/ch/tutteli/atrium/specs/integration/IteratorExpectationsSpec.kt b/misc/atrium-specs/src/commonMain/kotlin/ch/tutteli/atrium/specs/integration/IteratorExpectationsSpec.kt index 7f7731c5f3..4da6b25775 100644 --- a/misc/atrium-specs/src/commonMain/kotlin/ch/tutteli/atrium/specs/integration/IteratorExpectationsSpec.kt +++ b/misc/atrium-specs/src/commonMain/kotlin/ch/tutteli/atrium/specs/integration/IteratorExpectationsSpec.kt @@ -1,13 +1,15 @@ package ch.tutteli.atrium.specs.integration +import ch.tutteli.atrium.api.fluent.en_GB.message import ch.tutteli.atrium.api.fluent.en_GB.messageToContain +import ch.tutteli.atrium.api.fluent.en_GB.toContain import ch.tutteli.atrium.api.fluent.en_GB.toEqual import ch.tutteli.atrium.api.fluent.en_GB.toThrow import ch.tutteli.atrium.api.verbs.internal.expect import ch.tutteli.atrium.creating.Expect import ch.tutteli.atrium.reporting.reportables.descriptions.DescriptionBasic +import ch.tutteli.atrium.reporting.reportables.descriptions.DescriptionIterableLikeProof import ch.tutteli.atrium.specs.* -import ch.tutteli.atrium.translations.DescriptionIterableLikeExpectation import org.spekframework.spek2.Spek import org.spekframework.spek2.style.specification.Suite @@ -40,10 +42,8 @@ abstract class IteratorExpectationsSpec( fun describeFun(vararg pairs: SpecPair<*>, body: Suite.() -> Unit) = describeFunTemplate(describePrefix, pairs.map { it.name }.toTypedArray(), body = body) - val toHaveDescr = DescriptionBasic.TO_HAVE.string - val notToHaveDescr = DescriptionBasic.NOT_TO_HAVE.string - val aNextElement = DescriptionIterableLikeExpectation.A_NEXT_ELEMENT.getDefault() - val sizeExceededDescr = DescriptionIterableLikeExpectation.SIZE_EXCEEDED.getDefault() + val aNextElement = DescriptionIterableLikeProof.A_NEXT_ELEMENT.string + val sizeExceededDescr = DescriptionIterableLikeProof.SIZE_EXCEEDED.string describeFun(toHaveNext) { val toHaveNextFun = toHaveNext.lambda @@ -55,7 +55,9 @@ abstract class IteratorExpectationsSpec( it("throws an AssertionError if an iterator does not have next") { expect { expect(emptyList().iterator()).toHaveNextFun() - }.toThrow { messageToContain("$toHaveDescr: $aNextElement") } + }.toThrow { + message { toContainDescr(DescriptionBasic.TO_HAVE, aNextElement) } + } } } @@ -71,7 +73,9 @@ abstract class IteratorExpectationsSpec( it("throws an AssertionError if an iterator has next") { expect { expect(listOf(1, 2).iterator()).notToHaveNextFun() - }.toThrow { messageToContain("$notToHaveDescr: $aNextElement") } + }.toThrow { + message { toContainDescr(DescriptionBasic.NOT_TO_HAVE, aNextElement) } + } } } @@ -92,8 +96,10 @@ abstract class IteratorExpectationsSpec( expect { expect(emptyList().iterator()).nextFun { toEqual(1) } }.toThrow { - messageToContain(sizeExceededDescr) - if(hasExtraHint) messageToContain("$toEqualDescr: 1") + message { + toContain(sizeExceededDescr) + if (hasExtraHint) toContainToEqualDescr(1) + } } } } diff --git a/misc/atrium-specs/src/commonMain/kotlin/ch/tutteli/atrium/specs/integration/KeyValueLikeExpectationsSpec.kt b/misc/atrium-specs/src/commonMain/kotlin/ch/tutteli/atrium/specs/integration/KeyValueLikeExpectationsSpec.kt index 58a9531a35..eac3b870db 100644 --- a/misc/atrium-specs/src/commonMain/kotlin/ch/tutteli/atrium/specs/integration/KeyValueLikeExpectationsSpec.kt +++ b/misc/atrium-specs/src/commonMain/kotlin/ch/tutteli/atrium/specs/integration/KeyValueLikeExpectationsSpec.kt @@ -5,7 +5,7 @@ import ch.tutteli.atrium.api.verbs.internal.expect import ch.tutteli.atrium.creating.Expect import ch.tutteli.atrium.specs.* import ch.tutteli.atrium.reporting.reportables.descriptions.DescriptionCharSequenceProof -import ch.tutteli.atrium.translations.DescriptionComparableExpectation +import ch.tutteli.atrium.reporting.reportables.descriptions.DescriptionComparableProof import org.spekframework.spek2.Spek import org.spekframework.spek2.style.specification.Suite @@ -28,7 +28,8 @@ abstract class KeyValueLikeExpectationsSpec( val mapEntry = creator("hello", 1) val nullMapEntry = creatorNullable(null, null) - include(object : SubjectLessSpec(describePrefix, + include(object : SubjectLessSpec( + describePrefix, keyFeature.forSubjectLess(), key.forSubjectLess { toEndWith("a") }, valueFeature.forSubjectLess(), @@ -74,10 +75,10 @@ abstract class KeyValueLikeExpectationsSpec( expect { expect(mapEntry).keyFun { toEndWith("h") } }.toThrow { - messageToContain( - "$keyName: \"hello\"", - DescriptionCharSequenceProof.TO_END_WITH.string + ": \"h\"" - ) + message { + toContainDescr(keyName, "\"hello\"") + toContainDescr(DescriptionCharSequenceProof.TO_END_WITH, "\"h\"") + } } } } @@ -90,10 +91,10 @@ abstract class KeyValueLikeExpectationsSpec( expect { expect(mapEntry).valueFun { toBeGreaterThan(1) } }.toThrow { - messageToContain( - "$valueName: 1", - DescriptionComparableExpectation.TO_BE_GREATER_THAN.getDefault() + ": 1" - ) + message { + toContainDescr(valueName, 1) + toContainDescr(DescriptionComparableProof.TO_BE_GREATER_THAN, 1) + } } } } @@ -114,7 +115,10 @@ abstract class KeyValueLikeExpectationsSpec( expect { expect(nullableMapEntry).nullableKeyFun { toEqual(null) } }.toThrow { - messageToContain("$keyName: \"hello\"") + message { + toContainDescr(keyName, "\"hello\"") + toContainToEqualDescr("null") + } } } } @@ -126,7 +130,10 @@ abstract class KeyValueLikeExpectationsSpec( expect { expect(nullableMapEntry).nullableValueFun { toEqual(null) } }.toThrow { - messageToContain("$valueName: 1") + message { + toContainDescr(valueName, 1) + toContainToEqualDescr("null") + } } } } @@ -140,7 +147,10 @@ abstract class KeyValueLikeExpectationsSpec( expect { expect(nullMapEntry).nullableKeyFun { toEqual("hello") } }.toThrow { - messageToContain("$keyName: null", "$toEqualDescr: \"hello\"") + message { + toContainDescr(keyName, "null") + toContainToEqualDescr("\"hello\"") + } } } } @@ -152,7 +162,10 @@ abstract class KeyValueLikeExpectationsSpec( expect { expect(nullMapEntry).nullableValueFun { toEqual(1) } }.toThrow { - messageToContain("$valueName: null") + message { + toContainDescr(valueName, "null") + toContainToEqualDescr(1) + } } } } diff --git a/misc/atrium-specs/src/commonMain/kotlin/ch/tutteli/atrium/specs/integration/ListExpectationsSpec.kt b/misc/atrium-specs/src/commonMain/kotlin/ch/tutteli/atrium/specs/integration/ListExpectationsSpec.kt index 272594532f..5083921e55 100644 --- a/misc/atrium-specs/src/commonMain/kotlin/ch/tutteli/atrium/specs/integration/ListExpectationsSpec.kt +++ b/misc/atrium-specs/src/commonMain/kotlin/ch/tutteli/atrium/specs/integration/ListExpectationsSpec.kt @@ -1,13 +1,14 @@ package ch.tutteli.atrium.specs.integration +import ch.tutteli.atrium.api.fluent.en_GB.message import ch.tutteli.atrium.api.fluent.en_GB.messageToContain import ch.tutteli.atrium.api.fluent.en_GB.notToThrow import ch.tutteli.atrium.api.fluent.en_GB.toEqual import ch.tutteli.atrium.api.fluent.en_GB.toThrow import ch.tutteli.atrium.api.verbs.internal.expect import ch.tutteli.atrium.creating.Expect +import ch.tutteli.atrium.reporting.reportables.descriptions.DescriptionListLikeProof import ch.tutteli.atrium.specs.* -import ch.tutteli.atrium.translations.DescriptionListLikeExpectation import org.spekframework.spek2.Spek import org.spekframework.spek2.style.specification.Suite @@ -44,7 +45,7 @@ abstract class ListExpectationsSpec( val listNullable = listOf(1, null, 3, 4) - val indexOutOfBounds = DescriptionListLikeExpectation.INDEX_OUT_OF_BOUNDS.getDefault() + val indexOutOfBounds = DescriptionListLikeProof.INDEX_OUT_OF_BOUNDS.string describeFun(getFeature, get, getFeatureNullable, getNullable) { val getFunctions = uncheckedToNonNullable( @@ -61,13 +62,13 @@ abstract class ListExpectationsSpec( expect { expect(list).getFun(4) { toEqual(3) } }.toThrow { - messageToContain("get(4): $indexOutOfBounds") - if (hasExtraHint) messageToContain("$toEqualDescr: 3") + message { + toContainDescr("get(4)", indexOutOfBounds) + if (hasExtraHint) toContainToEqualDescr(3) + } } } } - - } } diff --git a/misc/atrium-specs/src/commonMain/kotlin/ch/tutteli/atrium/specs/integration/MapEntryExpectationsSpec.kt b/misc/atrium-specs/src/commonMain/kotlin/ch/tutteli/atrium/specs/integration/MapEntryExpectationsSpec.kt index 24a0d7a4db..df32c18383 100644 --- a/misc/atrium-specs/src/commonMain/kotlin/ch/tutteli/atrium/specs/integration/MapEntryExpectationsSpec.kt +++ b/misc/atrium-specs/src/commonMain/kotlin/ch/tutteli/atrium/specs/integration/MapEntryExpectationsSpec.kt @@ -66,7 +66,8 @@ abstract class MapEntryExpectationsSpec( expect(mapEntry).toEqualKeyValueFun("hello", 2) }.toThrow { message { - toContain("value: 1", "$toEqualDescr: 2") + toContainDescr("value", 1) + toContainToEqualDescr(2) notToContain("key") } } @@ -76,7 +77,8 @@ abstract class MapEntryExpectationsSpec( expect(mapEntry).toEqualKeyValueFun("b", 1) }.toThrow { message { - toContain("key: \"hello\"", "$toEqualDescr: \"b\"") + toContainDescr("key", "\"hello\"") + toContainToEqualDescr("\"b\"") notToContain("value") } } @@ -99,7 +101,8 @@ abstract class MapEntryExpectationsSpec( expect(mapEntryNullable2).toEqualKeyValueFun(null, 2) }.toThrow { message { - toContain("value: null", "$toEqualDescr: 2") + toContainDescr("value", "null") + toContainToEqualDescr(2) notToContain("key") } } @@ -109,12 +112,12 @@ abstract class MapEntryExpectationsSpec( expect(mapEntryNullable2).toEqualKeyValueFun("b", null) }.toThrow { message { - toContain("key: null", "$toEqualDescr: \"b\"") + toContainDescr("key", "null") + toContainToEqualDescr("\"b\"") notToContain("value") } } } } } - }) diff --git a/misc/atrium-specs/src/commonMain/kotlin/ch/tutteli/atrium/specs/integration/MapExpectationsSpec.kt b/misc/atrium-specs/src/commonMain/kotlin/ch/tutteli/atrium/specs/integration/MapExpectationsSpec.kt index 1d847f377c..bedadc667d 100644 --- a/misc/atrium-specs/src/commonMain/kotlin/ch/tutteli/atrium/specs/integration/MapExpectationsSpec.kt +++ b/misc/atrium-specs/src/commonMain/kotlin/ch/tutteli/atrium/specs/integration/MapExpectationsSpec.kt @@ -4,9 +4,8 @@ import ch.tutteli.atrium.api.fluent.en_GB.* import ch.tutteli.atrium.api.verbs.internal.expect import ch.tutteli.atrium.creating.Expect import ch.tutteli.atrium.reporting.reportables.descriptions.DescriptionCollectionProof +import ch.tutteli.atrium.reporting.reportables.descriptions.DescriptionMapLikeProof import ch.tutteli.atrium.specs.* -import ch.tutteli.atrium.translations.DescriptionCollectionExpectation -import ch.tutteli.atrium.translations.DescriptionMapLikeExpectation import org.spekframework.spek2.Spek import org.spekframework.spek2.style.specification.Suite @@ -74,42 +73,45 @@ abstract class MapExpectationsSpec( describeFunTemplate(describePrefix, pairs.map { it.name }.toTypedArray(), body = body) val empty = DescriptionCollectionProof.EMPTY.string - val toContainKeyDescr = DescriptionMapLikeExpectation.TO_CONTAIN_KEY.getDefault() - val notToContainKeyDescr = DescriptionMapLikeExpectation.NOT_TO_CONTAIN_KEY.getDefault() - val keyDoesNotExist = DescriptionMapLikeExpectation.KEY_DOES_NOT_EXIST.getDefault() + val toContainKeyDescr = DescriptionMapLikeProof.TO_CONTAIN_KEY.getDefault() + val notToContainKeyDescr = DescriptionMapLikeProof.NOT_TO_CONTAIN_KEY.getDefault() + val keyDoesNotExist = DescriptionMapLikeProof.KEY_DOES_NOT_EXIST.getDefault() describeFun(toContainKey, toContainKeyNullable, notToContainKey, notToContainKeyNullable) { val toContainKeyFunctions = uncheckedToNonNullable(toContainKey, toContainKeyNullable) val notToContainKeyFunctions = uncheckedToNonNullable(notToContainKey, notToContainKeyNullable) - val fluent2 = expect(map as Map) - + val map1 : Map = map context("$map") { toContainKeyFunctions.forEach { (name, toContainKeyFun) -> it("$name - does not throw if the map toContain the key") { - fluent2.toContainKeyFun("a") + expect(map1).toContainKeyFun("a") } it("$name - throws an AssertionError if the map does not contain the key") { expect { - fluent2.toContainKeyFun("c") - }.toThrow { messageToContain("$toContainKeyDescr: \"c\"") } + expect(map1).toContainKeyFun("c") + }.toThrow { + message { toContainDescr(toContainKeyDescr, "\"c\"") } + } } it("$name - does not throw if null is passed and the map toContain null as key") { - fluent2.toContainKeyFun("a") + expect(map1).toContainKeyFun("a") } } notToContainKeyFunctions.forEach { (name, notToContainKeyFun) -> it("$name - does not throw if the map does not contain the key") { - fluent2.notToContainKeyFun("c") + expect(map1).notToContainKeyFun("c") } it("$name - throws an AssertionError if the map toContain the key") { expect { - fluent2.notToContainKeyFun("a") - }.toThrow { messageToContain("$notToContainKeyDescr: \"a\"") } + expect(map1).notToContainKeyFun("a") + }.toThrow { + message { toContainDescr(notToContainKeyDescr, "\"a\"") } + } } } } @@ -128,7 +130,9 @@ abstract class MapExpectationsSpec( it("${notToContainKeyNullable.name} - throws an AssertionError if the map toContain the key") { expect { expect(map2).notToContainNullableKeyFun(null) - }.toThrow { messageToContain("$notToContainKeyDescr: null") } + }.toThrow { + message { toContainDescr(notToContainKeyDescr, "null") } + } } } @@ -137,7 +141,9 @@ abstract class MapExpectationsSpec( it("${toContainKeyNullable.name} - throws an AssertionError if the map does not contain the key") { expect { expect(map3).toContainNullableKeyFun(null) - }.toThrow { messageToContain("$toContainKeyDescr: null") } + }.toThrow { + message { toContainDescr(toContainKeyDescr, "null") } + } } it("${notToContainKeyNullable.name} - does not throw if the map does not contain the key") { @@ -159,14 +165,18 @@ abstract class MapExpectationsSpec( it("${notToBeEmpty.name} - throws an AssertionError") { expect { expect(map2).notToBeEmptyFun() - }.toThrow { messageToContain("$notToBeDescr: $empty") } + }.toThrow { + message { toContainNotToBeDescr(empty) } + } } } context("$map") { it("${toBeEmpty.name} - throws an AssertionError") { expect { expect(map as Map<*, *>).toBeEmptyFun() - }.toThrow { messageToContain("$toBeDescr: $empty") } + }.toThrow { + message { toContainToBeDescr(empty) } + } } it("${notToBeEmpty.name} - does not throw") { expect(map as Map<*, *>).notToBeEmptyFun() @@ -187,7 +197,7 @@ abstract class MapExpectationsSpec( expect { expect(map).keysFun { toHaveSize(1) } }.toThrow { - messageToContain("keys: [a, b]") + message { toContainDescr("keys", "[a, b]") } } } } @@ -199,7 +209,7 @@ abstract class MapExpectationsSpec( expect { expect(map).valuesFun { toHaveSize(1) } }.toThrow { - messageToContain("values: [1, 2]") + message { toContainDescr("values", "[1, 2]") } } } } @@ -218,8 +228,10 @@ abstract class MapExpectationsSpec( expect { expect(map).getExistingFun("c") { toEqual(3) } }.toThrow { - messageToContain("get(\"c\"): $keyDoesNotExist") - if (hasExtraHint) messageToContain("$toEqualDescr: 3") + message { + toContainDescr("get(\"c\")", keyDoesNotExist) + if (hasExtraHint) toContainToEqualDescr(3) + } } } } @@ -244,8 +256,10 @@ abstract class MapExpectationsSpec( expect { expect(nullableMap).getExistingFun("c") { toEqual(null) } }.toThrow { - messageToContain("get(\"c\"): $keyDoesNotExist") - if (hasExtraHint) messageToContain("$toEqualDescr: null") + message { + toContainDescr("get(\"c\")", keyDoesNotExist) + if (hasExtraHint) toContainToEqualDescr(null) + } } } } diff --git a/misc/atrium-specs/src/commonMain/kotlin/ch/tutteli/atrium/specs/integration/MapLikeToContainFormatSpecBase.kt b/misc/atrium-specs/src/commonMain/kotlin/ch/tutteli/atrium/specs/integration/MapLikeToContainFormatSpecBase.kt index 3227c8efde..35d664174f 100644 --- a/misc/atrium-specs/src/commonMain/kotlin/ch/tutteli/atrium/specs/integration/MapLikeToContainFormatSpecBase.kt +++ b/misc/atrium-specs/src/commonMain/kotlin/ch/tutteli/atrium/specs/integration/MapLikeToContainFormatSpecBase.kt @@ -16,62 +16,64 @@ abstract class MapLikeToContainFormatSpecBase(spec: Root.() -> Unit) : MapLikeTo val sizeDescr = DescriptionCollectionProof.SIZE.string val additionalEntriesDescr = DescriptionMapLikeProof.WARNING_ADDITIONAL_ENTRIES.string - val emptyInOrderOnlyReportOptions : InOrderOnlyReportingOptions.() -> Unit = {} + val emptyInOrderOnlyReportOptions: InOrderOnlyReportingOptions.() -> Unit = {} fun Expect.toContainSize(actual: Int, expected: Int) = toContain.exactly(1) - .regex("\\Q$rootBulletPoint$f$sizeDescr\\E: $actual[^:]+${toEqualDescr}: $expected") + .regex("\\Q$g$f$sizeDescr\\E\\s+: $actual[^:]+$toEqualDescr : $expected") + val toContainInAnyOrderDescr = + DescriptionMapLikeProof.IN_ANY_ORDER.string.format(DescriptionMapLikeProof.TO_CONTAIN.string) - fun Expect.toContainInAnyOrderOnlyDescr() = - toContain.exactly(1).value( - "$rootBulletPoint${ - DescriptionMapLikeProof.IN_ANY_ORDER_ONLY.string - .format(DescriptionMapLikeProof.TO_CONTAIN.string) - }:" - ) + val toContainInAnyOrderOnlyDescr = + DescriptionMapLikeProof.IN_ANY_ORDER_ONLY.string.format(DescriptionMapLikeProof.TO_CONTAIN.string) + + val toContainInOrderOnlyDescr = + DescriptionMapLikeProof.IN_ORDER_ONLY.string.format(DescriptionMapLikeProof.TO_CONTAIN.string) + fun Expect.toContainInAnyOrderOnlyDescr(): Expect { + return toContain.exactly(1).value("$g$toContainInAnyOrderOnlyDescr :") + } + fun Expect.toContainInOrderOnlyDescr() = - toContain.exactly(1).value( - "$rootBulletPoint${ - DescriptionIterableLikeProof.IN_ORDER_ONLY.string - .format(DescriptionIterableLikeProof.TO_CONTAIN.string) - }:" - ) + toContain.exactly(1).value("$g$toContainInOrderOnlyDescr :") fun Expect.entrySuccess(key: String, actual: Any?, expected: String): Expect { return this.toContain.exactly(1).regex( - "$indentRoot\\Q$s$f${entry(key)}: $actual\\E.*$lineSeparator" + - "$indentRoot$indentSuccess$indentF$featureBulletPoint$expected" + "$indentG\\Q$s$f\\E${entry(key)}\\s+: $actual$lineSeparator" + + "$indentG$indentS$indentF$s$expected" ) } fun Expect.entryFailing(key: String?, actual: Any?, expected: String): Expect { return this.toContain.exactly(1).regex( - "\\Q$x$f${entry(key)}: $actual\\E.*$lineSeparator" + - "$indentRoot$indentSuccess$indentF$featureBulletPoint$expected" + //TODO 1.3.0 should be $x and not $g + "$indentG\\Q$g$f\\E${entry(key)}\\s+: $actual$lineSeparator" + + "$indentG$indentX$indentF$x$expected" ) } fun Expect.entryFailingExplaining(key: String?, actual: Any?, expected: String): Expect { return this.toContain.exactly(1).regex( - "\\Q$x$f${entry(key)}: $actual\\E.*$lineSeparator" + - "$indentRoot$indentSuccess$indentF$indentFeature$explanatoryBulletPoint$expected" + //TODO 1.3.0 should be $x and not $g + "$indentG\\Q$g$f\\E${entry(key)}\\s+: $actual$lineSeparator" + + "$indentG$indentX$indentF$explanatoryBulletPoint$expected" ) } fun Expect.entryNonExisting(key: String, expected: String): Expect { return this.toContain.exactly(1).regex( - "\\Q$x$f${entry(key)}: $keyDoesNotExist\\E.*$lineSeparator" + - "$indentRoot$indentSuccess$indentF$indentFeature$explanatoryBulletPoint$expected" + //TODO 1.3.0 should be $x and not $g + "$indentG\\Q$g$f\\E${entry(key)}\\s+: $keyDoesNotExist$lineSeparator" + + "$indentG$indentX$indentF$explanatoryBulletPoint$expected" ) } fun Expect.additionalEntries(vararg pairs: Pair): Expect = and { val additionalEntries = - "\\Q$bb${DescriptionMapLikeProof.WARNING_ADDITIONAL_ENTRIES.string}\\E: $lineSeparator" + "$indentG\\Q$bb${DescriptionMapLikeProof.WARNING_ADDITIONAL_ENTRIES.string}\\E : $lineSeparator" toContain.exactly(1).regex(additionalEntries) pairs.forEach { (key, value) -> toContain.exactly(1) @@ -84,34 +86,30 @@ abstract class MapLikeToContainFormatSpecBase(spec: Root.() -> Unit) : MapLikeTo notToContain.regex("\\Q${DescriptionIterableLikeProof.ELEMENT_WITH_INDEX.string}.*$key=\\E") fun Expect.element( - successFailureBulletPoint: String, + indexBulletPoint: String, + indentIndex: String, + keyBulletPoint: String, + indentKey: String, + keySubBulletPoint: String, + valueBulletPoint: String, + indentValue: String, + valueSubBulletPoint: String, index: Int, actual: Any, expectedKey: String?, expectedValue: String, - explaining: Boolean = false, - explainingValue: Boolean = false, - withBulletPoint: Boolean = true, withKey: Boolean = true, withValue: Boolean = true ): Expect { - val indent = " ".repeat(successFailureBulletPoint.length) - val keyValueBulletPoint = if (explaining) explanatoryBulletPoint else featureBulletPoint - val indentKeyValueBulletPoint = " ".repeat(keyValueBulletPoint.length) - val indentToKeyValue = - "$indentRoot$indent$indentF" + (if (explaining) indentFeature else "") + val indentToKeyValue = "$indentG$indentIndex$indentF" return this.toContain.exactly(1).regex( - "\\Q${if (withBulletPoint) successFailureBulletPoint else ""}$f${ - IterableToContainSpecBase.elementWithIndex( - index - ) - }: $actual\\E.*$lineSeparator" + - (if (withKey) "$indentToKeyValue$keyValueBulletPoint${f}key:.*$lineSeparator" + - "$indentToKeyValue$indentKeyValueBulletPoint$indentF$featureBulletPoint$toEqualDescr: ${if (expectedKey == null) "null" else "\"$expectedKey\""}.*$lineSeparator" - else "") + - (if (withValue) "$indentToKeyValue$keyValueBulletPoint${f}value:.*$lineSeparator" + - "$indentToKeyValue$indentKeyValueBulletPoint$indentF${if (explainingValue) "$indentFeature$explanatoryBulletPoint" else featureBulletPoint}$expectedValue" + "$indentG\\Q$indexBulletPoint$f${IterableToContainSpecBase.elementWithIndex(index)} : $actual\\E.*$lineSeparator" + + (if (withKey) "$indentToKeyValue$keyBulletPoint${f}key\\s+:.*$lineSeparator" + + "$indentToKeyValue$indentKey$indentF$keySubBulletPoint$toEqualDescr : ${if (expectedKey == null) "null" else "\"$expectedKey\""}.*$lineSeparator" + else "") + + (if (withValue) "$indentToKeyValue$valueBulletPoint${f}value\\s+:.*$lineSeparator" + + "$indentToKeyValue$indentValue$indentF$valueSubBulletPoint$expectedValue" else "") ) } diff --git a/misc/atrium-specs/src/commonMain/kotlin/ch/tutteli/atrium/specs/integration/MapLikeToContainSpecBase.kt b/misc/atrium-specs/src/commonMain/kotlin/ch/tutteli/atrium/specs/integration/MapLikeToContainSpecBase.kt index 5e02c3a25e..08cef1afdd 100644 --- a/misc/atrium-specs/src/commonMain/kotlin/ch/tutteli/atrium/specs/integration/MapLikeToContainSpecBase.kt +++ b/misc/atrium-specs/src/commonMain/kotlin/ch/tutteli/atrium/specs/integration/MapLikeToContainSpecBase.kt @@ -8,8 +8,6 @@ import ch.tutteli.atrium.specs.Fun2 import ch.tutteli.atrium.specs.Fun3 import ch.tutteli.atrium.specs.fun2 import ch.tutteli.atrium.specs.fun3 -import ch.tutteli.atrium.specs.lineSeparator -import ch.tutteli.atrium.translations.DescriptionComparableExpectation import org.spekframework.spek2.Spek import org.spekframework.spek2.dsl.Root import kotlin.reflect.KFunction3 @@ -38,6 +36,6 @@ abstract class MapLikeToContainSpecBase(spec: Root.() -> Unit) : Spek(spec) { val emptyMap: Map = mapOf() fun entry(key: String?) = DescriptionMapLikeProof.ENTRY_WITH_KEY.string.format(if(key == null) "null" else "\"$key\"") - fun entry(key: String?, value: Any): String = entry(key) + ": " + value + fun entry(key: String?, value: Any): String = entry(key) + "\\s+: " + value } } diff --git a/misc/atrium-specs/src/commonMain/kotlin/ch/tutteli/atrium/specs/integration/MapToContainInAnyOrderKeyValueExpectationsSpec.kt b/misc/atrium-specs/src/commonMain/kotlin/ch/tutteli/atrium/specs/integration/MapToContainInAnyOrderKeyValueExpectationsSpec.kt index cd7cebe12f..7c8548f400 100644 --- a/misc/atrium-specs/src/commonMain/kotlin/ch/tutteli/atrium/specs/integration/MapToContainInAnyOrderKeyValueExpectationsSpec.kt +++ b/misc/atrium-specs/src/commonMain/kotlin/ch/tutteli/atrium/specs/integration/MapToContainInAnyOrderKeyValueExpectationsSpec.kt @@ -92,11 +92,11 @@ abstract class MapToContainInAnyOrderKeyValueExpectationsSpec( ) }.toThrow { message { - toContain( + toContainRegex( entry("b", 2), - "$toBeLessThanDescr: 2", + "$x$toBeLessThanDescr : 2", entry("c", keyDoesNotExist), - "$toBeLessThanDescr: 1" + "$explanatoryBulletPoint$toBeLessThanDescr : 1" ) notToContain(entry("a")) } @@ -150,11 +150,11 @@ abstract class MapToContainInAnyOrderKeyValueExpectationsSpec( ) }.toThrow { message { - toContain( + toContainRegex( entry("b", 2), - "$toBeLessThanDescr: 2", + "$x$toBeLessThanDescr : 2", entry("c", keyDoesNotExist), - "$toBeLessThanDescr: 1" + "$explanatoryBulletPoint$toBeLessThanDescr : 1" ) notToContain(entry("a")) } diff --git a/misc/atrium-specs/src/commonMain/kotlin/ch/tutteli/atrium/specs/integration/MapToContainInAnyOrderKeyValuePairsExpectationsSpec.kt b/misc/atrium-specs/src/commonMain/kotlin/ch/tutteli/atrium/specs/integration/MapToContainInAnyOrderKeyValuePairsExpectationsSpec.kt index bcefeced2f..4f229b8b59 100644 --- a/misc/atrium-specs/src/commonMain/kotlin/ch/tutteli/atrium/specs/integration/MapToContainInAnyOrderKeyValuePairsExpectationsSpec.kt +++ b/misc/atrium-specs/src/commonMain/kotlin/ch/tutteli/atrium/specs/integration/MapToContainInAnyOrderKeyValuePairsExpectationsSpec.kt @@ -2,7 +2,10 @@ package ch.tutteli.atrium.specs.integration import ch.tutteli.atrium.api.fluent.en_GB.* import ch.tutteli.atrium.api.verbs.internal.expect +import ch.tutteli.atrium.core.polyfills.format +import ch.tutteli.atrium.reporting.reportables.descriptions.DescriptionMapLikeProof import ch.tutteli.atrium.specs.* +import ch.tutteli.atrium.specs.integration.MapLikeToContainFormatSpecBase.Companion.toContainInAnyOrderDescr import org.spekframework.spek2.style.specification.Suite @@ -50,11 +53,12 @@ abstract class MapToContainInAnyOrderKeyValuePairsExpectationsSpec( expect(map).toContainFun("a" to 1, arrayOf("b" to 3, "c" to 4)) }.toThrow { message { - toContain( - entry("b", 2), - "$toEqualDescr: 3", - entry("c", keyDoesNotExist), - "$toEqualDescr: 4" + toContainRegex( + "$g${toContainInAnyOrderDescr} : $lineSeparator" + + "$indentG$g$f${entry("b", 2)}$lineSeparator" + + "$indentGg$indentF$x$toEqualDescr : 3$lineSeparator" + + "$indentG$g$f${entry("c", keyDoesNotExist)}$lineSeparator" + + "$indentGg$indentF$explanatoryBulletPoint$toEqualDescr : 4" ) notToContain(entry("a")) } @@ -91,11 +95,14 @@ abstract class MapToContainInAnyOrderKeyValuePairsExpectationsSpec( expect(nullableMap).toContainNullableFun("a" to null, arrayOf(null to 2, "b" to 3, "c" to 4)) }.toThrow { message { - toContain( - entry("b", 2), - "$toEqualDescr: 3", - entry("c", keyDoesNotExist), - "$toEqualDescr: 4" + toContainRegex( + "$g${toContainInAnyOrderDescr} : $lineSeparator" + + "$indentG$g$f${entry(null, 1)}$lineSeparator" + + "$indentGg$indentF$x$toEqualDescr : 2$lineSeparator" + + "$indentG$g$f${entry("b", 2)}$lineSeparator" + + "$indentGg$indentF$x$toEqualDescr : 3$lineSeparator" + + "$indentG$g$f${entry("c", keyDoesNotExist)}$lineSeparator" + + "$indentGg$indentF$explanatoryBulletPoint$toEqualDescr : 4" ) notToContain(entry("a")) } diff --git a/misc/atrium-specs/src/commonMain/kotlin/ch/tutteli/atrium/specs/integration/MapToContainInAnyOrderOnlyKeyValueExpectationsSpec.kt b/misc/atrium-specs/src/commonMain/kotlin/ch/tutteli/atrium/specs/integration/MapToContainInAnyOrderOnlyKeyValueExpectationsSpec.kt index 0315a95812..c1a74a369b 100644 --- a/misc/atrium-specs/src/commonMain/kotlin/ch/tutteli/atrium/specs/integration/MapToContainInAnyOrderOnlyKeyValueExpectationsSpec.kt +++ b/misc/atrium-specs/src/commonMain/kotlin/ch/tutteli/atrium/specs/integration/MapToContainInAnyOrderOnlyKeyValueExpectationsSpec.kt @@ -79,7 +79,7 @@ abstract class MapToContainInAnyOrderOnlyKeyValueExpectationsSpec( message { toContainInAnyOrderOnlyDescr() toContainSize(0, 1) - entryNonExisting("a", "$toEqualDescr: 1") + entryNonExisting("a", "$toEqualDescr : 1") notToContain(additionalEntriesDescr) } } @@ -97,9 +97,9 @@ abstract class MapToContainInAnyOrderOnlyKeyValueExpectationsSpec( message { toContainInAnyOrderOnlyDescr() toContainSize(0, 3) - entryNonExisting("a", "$toBeLessThanDescr: 1") - entryNonExisting("b", "$toEqualDescr: 3") - entryNonExisting("c", "$toBeLessThanDescr: 4") + entryNonExisting("a", "$toBeLessThanDescr : 1") + entryNonExisting("b", "$toEqualDescr : 3") + entryNonExisting("c", "$toBeLessThanDescr : 4") notToContain(additionalEntriesDescr) } } @@ -135,7 +135,7 @@ abstract class MapToContainInAnyOrderOnlyKeyValueExpectationsSpec( message { toContainInAnyOrderOnlyDescr() toContainSize(2, 1) - entrySuccess("a", 1, "$toBeLessThanDescr: 2") + entrySuccess("a", 1, "$toBeLessThanDescr : 2") additionalEntries("b" to 2) } } @@ -147,8 +147,8 @@ abstract class MapToContainInAnyOrderOnlyKeyValueExpectationsSpec( }.toThrow { message { toContainInAnyOrderOnlyDescr() - entrySuccess("a", 1, "$toBeLessThanDescr: 2") - entryNonExisting("a", "$toEqualDescr: 1") + entrySuccess("a", 1, "$toBeLessThanDescr : 2") + entryNonExisting("a", "$toEqualDescr : 1") additionalEntries("b" to 2) notToContain(sizeDescr) @@ -169,9 +169,9 @@ abstract class MapToContainInAnyOrderOnlyKeyValueExpectationsSpec( message { toContainInAnyOrderOnlyDescr() toContainSize(2, 3) - entrySuccess("a", 1, "$toBeLessThanDescr: 3") - entryFailing("b", 2, "$toBeLessThanDescr: 1") - entryNonExisting("c", "$toEqualDescr: 4") + entrySuccess("a", 1, "$toBeLessThanDescr : 3") + entryFailing("b", 2, "$toBeLessThanDescr : 1") + entryNonExisting("c", "$toEqualDescr : 4") notToContain(additionalEntriesDescr) } @@ -215,7 +215,7 @@ abstract class MapToContainInAnyOrderOnlyKeyValueExpectationsSpec( message { toContainInAnyOrderOnlyDescr() toContainSize(3, 1) - entryFailingExplaining("a", null, "$toEqualDescr: 1") + entryFailingExplaining("a", null, "$toEqualDescr : 1") additionalEntries(null to 1, "b" to 2) } } @@ -235,10 +235,10 @@ abstract class MapToContainInAnyOrderOnlyKeyValueExpectationsSpec( message { toContainInAnyOrderOnlyDescr() toContainSize(3, 4) - entryFailingExplaining("a", null, "$toEqualDescr: 1") - entryNonExisting("c", "$toBeLessThanDescr: 3") - entryFailing(null, "1", "$toEqualDescr: null") - entrySuccess("b", "2", "$toBeLessThanDescr: 3") + entryFailingExplaining("a", null, "$toEqualDescr : 1") + entryNonExisting("c", "$toBeLessThanDescr : 3") + entryFailing(null, "1", "$toEqualDescr : null") + entrySuccess("b", "2", "$toBeLessThanDescr : 3") notToContain(additionalEntriesDescr) } diff --git a/misc/atrium-specs/src/commonMain/kotlin/ch/tutteli/atrium/specs/integration/MapToContainInAnyOrderOnlyKeyValuePairsExpectationsSpec.kt b/misc/atrium-specs/src/commonMain/kotlin/ch/tutteli/atrium/specs/integration/MapToContainInAnyOrderOnlyKeyValuePairsExpectationsSpec.kt index 5ed3f8cffd..42c140b516 100644 --- a/misc/atrium-specs/src/commonMain/kotlin/ch/tutteli/atrium/specs/integration/MapToContainInAnyOrderOnlyKeyValuePairsExpectationsSpec.kt +++ b/misc/atrium-specs/src/commonMain/kotlin/ch/tutteli/atrium/specs/integration/MapToContainInAnyOrderOnlyKeyValuePairsExpectationsSpec.kt @@ -36,7 +36,7 @@ abstract class MapToContainInAnyOrderOnlyKeyValuePairsExpectationsSpec( message { toContainInAnyOrderOnlyDescr() toContainSize(0, 1) - entryNonExisting("a", "$toEqualDescr: 1") + entryNonExisting("a", "$toEqualDescr : 1") } } } @@ -48,9 +48,9 @@ abstract class MapToContainInAnyOrderOnlyKeyValuePairsExpectationsSpec( message { toContainInAnyOrderOnlyDescr() toContainSize(0, 3) - entryNonExisting("a", "$toEqualDescr: 1") - entryNonExisting("b", "$toEqualDescr: 3") - entryNonExisting("c", "$toEqualDescr: 4") + entryNonExisting("a", "$toEqualDescr : 1") + entryNonExisting("b", "$toEqualDescr : 3") + entryNonExisting("c", "$toEqualDescr : 4") } } } @@ -75,7 +75,7 @@ abstract class MapToContainInAnyOrderOnlyKeyValuePairsExpectationsSpec( message { toContainSize(2, 1) toContainInAnyOrderOnlyDescr() - entrySuccess("a", 1, "$toEqualDescr: 1") + entrySuccess("a", 1, "$toEqualDescr : 1") additionalEntries("b" to 2) } } @@ -87,8 +87,8 @@ abstract class MapToContainInAnyOrderOnlyKeyValuePairsExpectationsSpec( }.toThrow { message { toContainInAnyOrderOnlyDescr() - entrySuccess("a", 1, "$toEqualDescr: 1") - entryNonExisting("a", "$toEqualDescr: 1") + entrySuccess("a", 1, "$toEqualDescr : 1") + entryNonExisting("a", "$toEqualDescr : 1") additionalEntries("b" to 2) notToContain(sizeDescr) } @@ -102,9 +102,9 @@ abstract class MapToContainInAnyOrderOnlyKeyValuePairsExpectationsSpec( message { toContainInAnyOrderOnlyDescr() toContainSize(2, 3) - entrySuccess("a", 1, "$toEqualDescr: 1") - entryFailing("b", 2, "$toEqualDescr: 3") - entryNonExisting("c", "$toEqualDescr: 4") + entrySuccess("a", 1, "$toEqualDescr : 1") + entryFailing("b", 2, "$toEqualDescr : 3") + entryNonExisting("c", "$toEqualDescr : 4") } } } @@ -133,10 +133,10 @@ abstract class MapToContainInAnyOrderOnlyKeyValuePairsExpectationsSpec( message { toContainInAnyOrderOnlyDescr() toContainSize(3, 4) - entryFailing("a", null, "$toEqualDescr: 1") - entryNonExisting("c", "$toEqualDescr: 3") - entryFailing(null, "1", "$toEqualDescr: null") - entrySuccess("b", "2", "$toEqualDescr: 2") + entryFailing("a", null, "$toEqualDescr : 1") + entryNonExisting("c", "$toEqualDescr : 3") + entryFailing(null, "1", "$toEqualDescr : null") + entrySuccess("b", "2", "$toEqualDescr : 2") } } } diff --git a/misc/atrium-specs/src/commonMain/kotlin/ch/tutteli/atrium/specs/integration/MapToContainInOrderOnlyKeyValueExpectationsSpec.kt b/misc/atrium-specs/src/commonMain/kotlin/ch/tutteli/atrium/specs/integration/MapToContainInOrderOnlyKeyValueExpectationsSpec.kt index b6158d6387..cf3e70ba98 100644 --- a/misc/atrium-specs/src/commonMain/kotlin/ch/tutteli/atrium/specs/integration/MapToContainInOrderOnlyKeyValueExpectationsSpec.kt +++ b/misc/atrium-specs/src/commonMain/kotlin/ch/tutteli/atrium/specs/integration/MapToContainInOrderOnlyKeyValueExpectationsSpec.kt @@ -6,6 +6,7 @@ import ch.tutteli.atrium.creating.Expect import ch.tutteli.atrium.logic.creating.iterablelike.contains.reporting.InOrderOnlyReportingOptions import ch.tutteli.atrium.specs.* import ch.tutteli.atrium.specs.integration.IterableToContainSpecBase.Companion.nonNullableCases +import ch.tutteli.atrium.specs.s import org.spekframework.spek2.style.specification.Suite abstract class MapToContainInOrderOnlyKeyValueExpectationsSpec( @@ -34,7 +35,8 @@ abstract class MapToContainInOrderOnlyKeyValueExpectationsSpec( include(object : AssertionCreatorSpec>( describePrefix, map, - assertionCreatorSpecTriple(keyWithValueAssertions.name, "$toBeLessThanDescr\\s+: 2", + assertionCreatorSpecTriple( + keyWithValueAssertions.name, "$toBeLessThanDescr\\s+: 2", { keyWithValueAssertions( this, @@ -56,7 +58,8 @@ abstract class MapToContainInOrderOnlyKeyValueExpectationsSpec( include(object : AssertionCreatorSpec>( "$describePrefix[nullable] ", mapOf("a" to 1, "b" to null), - assertionCreatorSpecTriple(keyWithNullableValueAssertions.name, "$toBeLessThanDescr\\s+: 2", + assertionCreatorSpecTriple( + keyWithNullableValueAssertions.name, "$toBeLessThanDescr\\s+: 2", { keyWithNullableValueAssertions( this, @@ -84,26 +87,35 @@ abstract class MapToContainInOrderOnlyKeyValueExpectationsSpec( actual: Any, expectedKey: String, expectedValue: String - ): Expect = element(s, index, actual, expectedKey, expectedValue) + ): Expect = element(s, indentS, s, indentS, s, s, indentS, s, index, actual, expectedKey, expectedValue) fun Expect.elementFailing( index: Int, actual: Any, expectedKey: String?, expectedValue: String, - explainingValue: Boolean = false, - withBulletPoint: Boolean = true, + keyBulletPoint: String = g, + indentKey: String = indentG, + keySubBulletPoint: String = x, + valueBulletPoint: String = g, + indentValue: String = indentG, + valueSubBulletPoint: String = x, withKey: Boolean = true, withValue: Boolean = true ): Expect = element( - x, + g, + indentG, + keyBulletPoint, + indentKey, + keySubBulletPoint, + valueBulletPoint, + indentValue, + valueSubBulletPoint, index, actual, expectedKey, expectedValue, - explainingValue = explainingValue, - withBulletPoint = withBulletPoint, withKey = withKey, withValue = withValue ) @@ -112,30 +124,28 @@ abstract class MapToContainInOrderOnlyKeyValueExpectationsSpec( index: Int, expectedKey: String, expectedValue: String, - withBulletPoint: Boolean = true ): Expect = element( - x, + g, + indentG, + explanatoryBulletPoint, + indentExplanatory, + listBulletPoint, + explanatoryBulletPoint, + indentExplanatory, + listBulletPoint, index, IterableToContainSpecBase.sizeExceeded, expectedKey, expectedValue, - explaining = true, - withBulletPoint = withBulletPoint ) fun Expect.additionalEntries(vararg pairs: Pair): Expect = - and { - val additionalEntries = - "\\Q${bb}${IterableToContainSpecBase.additionalElements}\\E: $lineSeparator" - toContain.exactly(1).regex(additionalEntries) - pairs.forEach { (index, entry) -> - toContain.exactly(1).regex( - additionalEntries + "(.|$lineSeparator)+${listBulletPoint}${ - IterableToContainSpecBase.elementWithIndex(index) + ": " + entry - }" - ) - } - } + toContain.exactly(1).regex( + "$indentG\\Q${bb}${IterableToContainSpecBase.additionalElements}\\E : $lineSeparator" + + pairs.joinToString(lineSeparator) { (index, entry) -> + "$indentG$indentBb$listBulletPoint${IterableToContainSpecBase.elementWithIndex(index)}\\s+: $entry.*" + } + ) nonNullableCases( describePrefix, @@ -157,7 +167,7 @@ abstract class MapToContainInOrderOnlyKeyValueExpectationsSpec( message { toContainInOrderOnlyDescr() toContainSize(0, 1) - elementOutOfBound(0, "a", "$toEqualDescr: 1") + elementOutOfBound(0, "a", "$toEqualDescr : 1") } } } @@ -173,9 +183,9 @@ abstract class MapToContainInOrderOnlyKeyValueExpectationsSpec( message { toContainInOrderOnlyDescr() toContainSize(0, 3) - elementOutOfBound(0, "a", "$toBeLessThanDescr: 1") - elementOutOfBound(1, "b", "$toEqualDescr: 3") - elementOutOfBound(2, "c", "$toBeLessThanDescr: 4") + elementOutOfBound(0, "a", "$toBeLessThanDescr : 1") + elementOutOfBound(1, "b", "$toEqualDescr : 3") + elementOutOfBound(2, "c", "$toBeLessThanDescr : 4") } } } @@ -204,7 +214,7 @@ abstract class MapToContainInOrderOnlyKeyValueExpectationsSpec( expect(map).toContainFun(keyValue("a") { toEqual(1) }) }.toThrow { message { - elementSuccess(0, "a=1", "a", "$toEqualDescr: 1") + elementSuccess(0, "a=1", "a", "$toEqualDescr : 1") additionalEntries(1 to "b=2") toContainSize(2, 1) } @@ -219,8 +229,8 @@ abstract class MapToContainInOrderOnlyKeyValueExpectationsSpec( ) }.toThrow { message { - elementFailing(0, "a=1", "b", "$toEqualDescr: 2") - elementFailing(1, "b=2", "a", "$toEqualDescr: 1") + elementFailing(0, "a=1", "b", "$toEqualDescr : 2") + elementFailing(1, "b=2", "a", "$toEqualDescr : 1") notToContain(additionalEntriesDescr, sizeDescr) } @@ -236,9 +246,17 @@ abstract class MapToContainInOrderOnlyKeyValueExpectationsSpec( ) }.toThrow { message { - elementSuccess(0, "a=1", "a", "$toBeLessThanDescr: 3") - elementFailing(1, "b=2", "b", "$toBeLessThanDescr: 2") - elementOutOfBound(2, "c", "$toBeLessThanDescr: 1") + elementSuccess(0, "a=1", "a", "$toBeLessThanDescr : 3") + elementFailing( + 1, + "b=2", + "b", + "$toBeLessThanDescr : 2", + keyBulletPoint = s, + indentKey = indentS, + keySubBulletPoint = s + ) + elementOutOfBound(2, "c", "$toBeLessThanDescr : 1") notToContain(additionalEntriesDescr) } } @@ -260,7 +278,7 @@ abstract class MapToContainInOrderOnlyKeyValueExpectationsSpec( toContainSize(2, 3) notToContainEntry("a") notToContainEntry("b") - elementOutOfBound(2, "c", "$toEqualDescr: 3", withBulletPoint = false) + elementOutOfBound(2, "c", "$toEqualDescr : 3") } } } @@ -277,7 +295,7 @@ abstract class MapToContainInOrderOnlyKeyValueExpectationsSpec( toContainSize(2, 3) notToContainEntry("a") notToContainEntry("b") - elementOutOfBound(2, "c", "$toEqualDescr: 3", withBulletPoint = false) + elementOutOfBound(2, "c", "$toEqualDescr : 3") } } } @@ -291,8 +309,11 @@ abstract class MapToContainInOrderOnlyKeyValueExpectationsSpec( }.toThrow { message { notToContain(sizeDescr) - elementSuccess(0, "a=1", "a", "$toEqualDescr: 1") - elementFailing(1, "b=2", "b", "$toEqualDescr: 1") + elementSuccess(0, "a=1", "a", "$toEqualDescr : 1") + elementFailing( + 1, "b=2", "b", "$toEqualDescr : 1", + keyBulletPoint = s, indentKey = indentS, keySubBulletPoint = s + ) } } } @@ -313,16 +334,19 @@ abstract class MapToContainInOrderOnlyKeyValueExpectationsSpec( }.toThrow { message { toContainSize(2, 10) - elementSuccess(0, "a=1", "a", "$toEqualDescr: 1") - elementFailing(1, "b=2", "b", "$toEqualDescr: 1") - elementOutOfBound(2, "c", "$toEqualDescr: 3") - elementOutOfBound(3, "d", "$toEqualDescr: 4") - elementOutOfBound(4, "e", "$toEqualDescr: 5") - elementOutOfBound(5, "f", "$toEqualDescr: 6") - elementOutOfBound(6, "g", "$toEqualDescr: 7") - elementOutOfBound(7, "h", "$toEqualDescr: 8") - elementOutOfBound(8, "i", "$toEqualDescr: 9") - elementOutOfBound(9, "j", "$toEqualDescr: 10") + elementSuccess(0, "a=1", "a", "$toEqualDescr : 1") + elementFailing( + 1, "b=2", "b", "$toEqualDescr : 1", + keyBulletPoint = s, indentKey = indentS, keySubBulletPoint = s + ) + elementOutOfBound(2, "c", "$toEqualDescr : 3") + elementOutOfBound(3, "d", "$toEqualDescr : 4") + elementOutOfBound(4, "e", "$toEqualDescr : 5") + elementOutOfBound(5, "f", "$toEqualDescr : 6") + elementOutOfBound(6, "g", "$toEqualDescr : 7") + elementOutOfBound(7, "h", "$toEqualDescr : 8") + elementOutOfBound(8, "i", "$toEqualDescr : 9") + elementOutOfBound(9, "j", "$toEqualDescr : 10") } } } @@ -345,16 +369,16 @@ abstract class MapToContainInOrderOnlyKeyValueExpectationsSpec( message { toContainSize(2, 11) notToContainEntry("a") - elementFailing(1, "b=2", "b", "$toEqualDescr: 1", withBulletPoint = false, withKey = false,) - elementOutOfBound(2, "c", "$toEqualDescr: 3", withBulletPoint = false) - elementOutOfBound(3, "d", "$toEqualDescr: 4", withBulletPoint = false) - elementOutOfBound(4, "e", "$toEqualDescr: 5", withBulletPoint = false) - elementOutOfBound(5, "f", "$toEqualDescr: 6", withBulletPoint = false) - elementOutOfBound(6, "g", "$toEqualDescr: 7", withBulletPoint = false) - elementOutOfBound(7, "h", "$toEqualDescr: 8", withBulletPoint = false) - elementOutOfBound(8, "i", "$toEqualDescr: 9", withBulletPoint = false) - elementOutOfBound(9, "j", "$toEqualDescr: 10", withBulletPoint = false) - elementOutOfBound(10, "k", "$toEqualDescr: 11", withBulletPoint = false) + elementFailing(1, "b=2", "b", "$toEqualDescr : 1", withKey = false) + elementOutOfBound(2, "c", "$toEqualDescr : 3") + elementOutOfBound(3, "d", "$toEqualDescr : 4") + elementOutOfBound(4, "e", "$toEqualDescr : 5") + elementOutOfBound(5, "f", "$toEqualDescr : 6") + elementOutOfBound(6, "g", "$toEqualDescr : 7") + elementOutOfBound(7, "h", "$toEqualDescr : 8") + elementOutOfBound(8, "i", "$toEqualDescr : 9") + elementOutOfBound(9, "j", "$toEqualDescr : 10") + elementOutOfBound(10, "k", "$toEqualDescr : 11") } } } @@ -398,7 +422,7 @@ abstract class MapToContainInOrderOnlyKeyValueExpectationsSpec( expect(nullableMap).toContainFun(keyNullableValue("a", null)) }.toThrow { message { - elementSuccess(0, "a=null", "a", "$toEqualDescr: null") + elementSuccess(0, "a=null", "a", "$toEqualDescr : null") additionalEntries(1 to "null=1", 2 to "b=2") toContainSize(3, 1) } @@ -414,9 +438,16 @@ abstract class MapToContainInOrderOnlyKeyValueExpectationsSpec( ) }.toThrow { message { - elementFailing(0, "a=null", "b", "$toEqualDescr: 2", explainingValue = true) - elementFailing(1, "null=1", "a", "$toEqualDescr: null") - elementFailing(2, "b=2", null, "$toEqualDescr: 1") + elementFailing( + 0, "a=null", "b", "$toEqualDescr : 2", + valueBulletPoint = g, + indentValue = indentG, + //TODO 1.3.0 null and 2 are not aligned, would be nice though, fix it and create a test + // in CreateReportTest as regression + valueSubBulletPoint = explanatoryBulletPoint + ) + elementFailing(1, "null=1", "a", "$toEqualDescr : null") + elementFailing(2, "b=2", null, "$toEqualDescr : 1") notToContain(additionalEntriesDescr, sizeDescr) } @@ -433,9 +464,12 @@ abstract class MapToContainInOrderOnlyKeyValueExpectationsSpec( ) }.toThrow { message { - elementSuccess(0, "a=null", "a", "$toEqualDescr: null") - elementFailing(1, "null=1", "c", "$toBeLessThanDescr: 1") - elementFailing(2, "b=2", "b", "$toBeLessThanDescr: 2") + elementSuccess(0, "a=null", "a", "$toEqualDescr : null") + elementFailing(1, "null=1", "c", "$toBeLessThanDescr : 1") + elementFailing( + 2, "b=2", "b", "$toBeLessThanDescr : 2", + keyBulletPoint = s, indentKey = indentS, keySubBulletPoint = s + ) notToContain(additionalEntriesDescr, sizeDescr) } diff --git a/misc/atrium-specs/src/commonMain/kotlin/ch/tutteli/atrium/specs/integration/MapToContainInOrderOnlyKeyValuePairsExpectationsSpec.kt b/misc/atrium-specs/src/commonMain/kotlin/ch/tutteli/atrium/specs/integration/MapToContainInOrderOnlyKeyValuePairsExpectationsSpec.kt index 99e3254dee..944d90ade3 100644 --- a/misc/atrium-specs/src/commonMain/kotlin/ch/tutteli/atrium/specs/integration/MapToContainInOrderOnlyKeyValuePairsExpectationsSpec.kt +++ b/misc/atrium-specs/src/commonMain/kotlin/ch/tutteli/atrium/specs/integration/MapToContainInOrderOnlyKeyValuePairsExpectationsSpec.kt @@ -4,10 +4,10 @@ import ch.tutteli.atrium.api.fluent.en_GB.* import ch.tutteli.atrium.api.verbs.internal.expect import ch.tutteli.atrium.creating.Expect import ch.tutteli.atrium.logic.creating.iterablelike.contains.reporting.InOrderOnlyReportingOptions +import ch.tutteli.atrium.reporting.reportables.descriptions.DescriptionIterableLikeProof import ch.tutteli.atrium.specs.* import ch.tutteli.atrium.specs.integration.IterableToContainSpecBase.Companion.nonNullableCases import ch.tutteli.atrium.specs.integration.MapLikeToContainFormatSpecBase.Companion.element as elementInFormatSpecBase -import ch.tutteli.atrium.translations.DescriptionIterableLikeExpectation import org.spekframework.spek2.style.specification.Suite abstract class MapToContainInOrderOnlyKeyValuePairsExpectationsSpec( @@ -30,27 +30,35 @@ abstract class MapToContainInOrderOnlyKeyValuePairsExpectationsSpec( describeFunTemplate(describePrefix, pairs.map { it.name }.toTypedArray(), body = body) fun Expect.element( - successFailureBulletPoint: String, + indexBulletPoint: String, + indentIndex: String, + keyBulletPoint: String, + indentKey: String, + keySubBulletPoint: String, + valueBulletPoint: String, + indentValue: String, + valueSubBulletPoint: String, index: Int, actual: Any, expectedKey: String?, expectedValue: Int?, - explaining: Boolean = false, - explainingValue: Boolean = false, - withBulletPoint: Boolean = true, withKey: Boolean = true, withValue: Boolean = true ): Expect = this.elementInFormatSpecBase( - successFailureBulletPoint, - index, - actual, - expectedKey, - "$toEqualDescr: $expectedValue", - explaining, - explainingValue, - withBulletPoint, - withKey, - withValue, + indexBulletPoint = indexBulletPoint, + indentIndex = indentIndex, + keyBulletPoint = keyBulletPoint, + indentKey = indentKey, + keySubBulletPoint = keySubBulletPoint, + valueBulletPoint = valueBulletPoint, + indentValue = indentValue, + valueSubBulletPoint = valueSubBulletPoint, + index = index, + actual = actual, + expectedKey = expectedKey, + expectedValue = "$toEqualDescr : $expectedValue", + withKey = withKey, + withValue = withValue, ) fun Expect.elementSuccess( @@ -58,26 +66,35 @@ abstract class MapToContainInOrderOnlyKeyValuePairsExpectationsSpec( actual: Any, expectedKey: String, expectedValue: Int? - ): Expect = element(s, index, actual, expectedKey, expectedValue) + ): Expect = element(s, indentS, s, indentS, s, s, indentS, s, index, actual, expectedKey, expectedValue) fun Expect.elementFailing( index: Int, actual: Any, expectedKey: String?, expectedValue: Int?, - explainingValue: Boolean = false, - withBulletPoint: Boolean = true, + keyBulletPoint: String = g, + indentKey: String = indentG, + keySubBulletPoint: String = x, + valueBulletPoint: String = g, + indentValue: String = indentG, + valueSubBulletPoint: String = x, withKey: Boolean = true, withValue: Boolean = true ): Expect = element( - x, - index, - actual, - expectedKey, - expectedValue, - explainingValue = explainingValue, - withBulletPoint = withBulletPoint, + indexBulletPoint = g, + indentIndex = indentG, + keyBulletPoint = keyBulletPoint, + indentKey = indentKey, + keySubBulletPoint = keySubBulletPoint, + valueBulletPoint = valueBulletPoint, + indentValue = indentValue, + valueSubBulletPoint = valueSubBulletPoint, + index = index, + actual = actual, + expectedKey = expectedKey, + expectedValue = expectedValue, withKey = withKey, withValue = withValue, ) @@ -86,30 +103,28 @@ abstract class MapToContainInOrderOnlyKeyValuePairsExpectationsSpec( index: Int, expectedKey: String, expectedValue: Int, - withBulletPoint: Boolean = true ): Expect = element( - x, - index, - IterableToContainSpecBase.sizeExceeded, - expectedKey, - expectedValue, - explaining = true, - withBulletPoint = withBulletPoint + indexBulletPoint = g, + indentIndex = indentG, + keyBulletPoint = explanatoryBulletPoint, + indentKey = indentExplanatory, + keySubBulletPoint = listBulletPoint, + valueBulletPoint = explanatoryBulletPoint, + indentValue = indentExplanatory, + valueSubBulletPoint = listBulletPoint, + index = index, + actual = IterableToContainSpecBase.sizeExceeded, + expectedKey = expectedKey, + expectedValue = expectedValue, ) fun Expect.additionalEntries(vararg pairs: Pair): Expect = - and { - val additionalEntries = - "\\Q${bb}${IterableToContainSpecBase.additionalElements}\\E: $lineSeparator" - toContain.exactly(1).regex(additionalEntries) - pairs.forEach { (index, entry) -> - toContain.exactly(1).regex( - additionalEntries + "(.|$lineSeparator)+${listBulletPoint}${ - IterableToContainSpecBase.elementWithIndex(index) + ": " + entry - }" - ) - } - } + toContain.exactly(1).regex( + "$indentG\\Q${bb}${IterableToContainSpecBase.additionalElements}\\E : $lineSeparator" + + pairs.joinToString(lineSeparator) { (index, entry) -> + "$indentG$indentBb$listBulletPoint${IterableToContainSpecBase.elementWithIndex(index)}\\s+: $entry.*" + } + ) nonNullableCases( describePrefix, @@ -192,7 +207,7 @@ abstract class MapToContainInOrderOnlyKeyValuePairsExpectationsSpec( }.toThrow { message { elementSuccess(0, "a=1", "a", 1) - elementFailing(1, "b=2", "b", 1) + elementFailing(1, "b=2", "b", 1, keyBulletPoint = s, indentKey = indentS, keySubBulletPoint = s) elementOutOfBound(2, "c", 4) notToContain(additionalEntriesDescr) } @@ -200,12 +215,13 @@ abstract class MapToContainInOrderOnlyKeyValuePairsExpectationsSpec( } fun Expect.notToContainEntry(key: String): Expect = - notToContain.regex("\\Q${DescriptionIterableLikeExpectation.ELEMENT_WITH_INDEX.getDefault()}.*$key=\\E") + notToContain.regex("\\Q${DescriptionIterableLikeProof.ELEMENT_WITH_INDEX.string}.*$key=\\E") context("report options") { it("shows only failing with report option `showOnlyFailing`") { expect { - expect(map).toContainFun("a" to 1, "b" to 1, "c" to 3, + expect(map).toContainFun( + "a" to 1, "b" to 1, "c" to 3, report = { showOnlyFailing() } ) }.toThrow { @@ -213,7 +229,7 @@ abstract class MapToContainInOrderOnlyKeyValuePairsExpectationsSpec( toContainSize(2, 3) notToContainEntry("a") notToContainEntry("b") - elementOutOfBound(2, "c", 3, withBulletPoint = false) + elementOutOfBound(2, "c", 3) } } } @@ -230,7 +246,7 @@ abstract class MapToContainInOrderOnlyKeyValuePairsExpectationsSpec( toContainSize(2, 3) notToContainEntry("a") notToContainEntry("b") - elementOutOfBound(2, "c", 3, withBulletPoint = false) + elementOutOfBound(2, "c", 3) } } } @@ -245,7 +261,7 @@ abstract class MapToContainInOrderOnlyKeyValuePairsExpectationsSpec( message { notToContain(sizeDescr) elementSuccess(0, "a=1", "a", 1) - elementFailing(1, "b=2", "b", 1) + elementFailing(1, "b=2", "b", 1, keyBulletPoint = s, indentKey = indentS, keySubBulletPoint = s) } } } @@ -267,7 +283,7 @@ abstract class MapToContainInOrderOnlyKeyValuePairsExpectationsSpec( message { toContainSize(2, 10) elementSuccess(0, "a=1", "a", 1) - elementFailing(1, "b=2", "b", 1) + elementFailing(1, "b=2", "b", 1, keyBulletPoint = s, indentKey = indentS, keySubBulletPoint = s) elementOutOfBound(2, "c", 3) elementOutOfBound(3, "d", 4) elementOutOfBound(4, "e", 5) @@ -298,23 +314,16 @@ abstract class MapToContainInOrderOnlyKeyValuePairsExpectationsSpec( message { toContainSize(2, 11) notToContainEntry("a") - elementFailing( - 1, - "b=2", - "b", - 1, - withBulletPoint = false, - withKey = false, - ) - elementOutOfBound(2, "c", 3, withBulletPoint = false) - elementOutOfBound(3, "d", 4, withBulletPoint = false) - elementOutOfBound(4, "e", 5, withBulletPoint = false) - elementOutOfBound(5, "f", 6, withBulletPoint = false) - elementOutOfBound(6, "g", 7, withBulletPoint = false) - elementOutOfBound(7, "h", 8, withBulletPoint = false) - elementOutOfBound(8, "i", 9, withBulletPoint = false) - elementOutOfBound(9, "j", 10, withBulletPoint = false) - elementOutOfBound(10, "k", 11, withBulletPoint = false) + elementFailing(1, "b=2", "b", 1, withKey = false) + elementOutOfBound(2, "c", 3) + elementOutOfBound(3, "d", 4) + elementOutOfBound(4, "e", 5) + elementOutOfBound(5, "f", 6) + elementOutOfBound(6, "g", 7) + elementOutOfBound(7, "h", 8) + elementOutOfBound(8, "i", 9) + elementOutOfBound(9, "j", 10) + elementOutOfBound(10, "k", 11) } } } @@ -373,7 +382,7 @@ abstract class MapToContainInOrderOnlyKeyValuePairsExpectationsSpec( message { elementSuccess(0, "a=null", "a", null) elementFailing(1, "null=1", "c", 3) - elementFailing(2, "b=2", "b", 3) + elementFailing(2, "b=2", "b", 3, keyBulletPoint = s, indentKey = indentS, keySubBulletPoint = s) notToContain(additionalEntriesDescr, sizeDescr) } diff --git a/misc/atrium-specs/src/commonMain/kotlin/ch/tutteli/atrium/specs/integration/ResultExpectationsSpec.kt b/misc/atrium-specs/src/commonMain/kotlin/ch/tutteli/atrium/specs/integration/ResultExpectationsSpec.kt index 3a7021f5e4..0083ba7c38 100644 --- a/misc/atrium-specs/src/commonMain/kotlin/ch/tutteli/atrium/specs/integration/ResultExpectationsSpec.kt +++ b/misc/atrium-specs/src/commonMain/kotlin/ch/tutteli/atrium/specs/integration/ResultExpectationsSpec.kt @@ -1,14 +1,18 @@ package ch.tutteli.atrium.specs.integration +import ch.tutteli.atrium.api.fluent.en_GB.message import ch.tutteli.atrium.api.fluent.en_GB.messageToContain +import ch.tutteli.atrium.api.fluent.en_GB.toContain import ch.tutteli.atrium.api.fluent.en_GB.toEqual +import ch.tutteli.atrium.api.fluent.en_GB.toMatch import ch.tutteli.atrium.api.fluent.en_GB.toThrow import ch.tutteli.atrium.api.verbs.internal.expect import ch.tutteli.atrium.core.polyfills.fullName import ch.tutteli.atrium.creating.Expect +import ch.tutteli.atrium.reporting.reportables.descriptions.DescriptionAnyProof import ch.tutteli.atrium.specs.* import ch.tutteli.atrium.reporting.reportables.descriptions.DescriptionCharSequenceProof -import ch.tutteli.atrium.translations.DescriptionResultExpectation +import ch.tutteli.atrium.reporting.reportables.descriptions.DescriptionResultProof import org.spekframework.spek2.Spek import org.spekframework.spek2.style.specification.Suite @@ -48,7 +52,7 @@ abstract class ResultExpectationsSpec( "$describePrefix[failure] ", Result.failure(IllegalArgumentException("oh no...")), assertionCreatorSpecTriple( toBeAFailure.name, - "${DescriptionCharSequenceProof.VALUE.string}: \"oh no...\"", + "${DescriptionCharSequenceProof.VALUE.string}\\s+: \"oh no...\"", { apply { toBeAFailure.invoke(this) { messageToContain("oh no...") } } }, { apply { toBeAFailure.invoke(this) {} } } ) @@ -62,12 +66,17 @@ abstract class ResultExpectationsSpec( val resultNullSuccess = Result.success(null as Int?) val resultNullableFailure = Result.failure(IllegalArgumentException("oh no nullable...")) - val valueDescr = DescriptionResultExpectation.VALUE.getDefault() - val isNotSuccessDescr = DescriptionResultExpectation.IS_NOT_SUCCESS.getDefault() - val isNotFailureDescr = DescriptionResultExpectation.IS_NOT_FAILURE.getDefault() - val exceptionDescr = DescriptionResultExpectation.EXCEPTION.getDefault() - - describeFun(toBeASuccessFeature, toBeASuccess, toBeASuccessFeatureNullable, toBeASuccessNullable, toBeAFailureFeature, toBeAFailure) { + val isNotSuccessDescr = DescriptionResultProof.IS_NOT_SUCCESS.string + val isNotFailureDescr = DescriptionResultProof.IS_NOT_FAILURE.string + + describeFun( + toBeASuccessFeature, + toBeASuccess, + toBeASuccessFeatureNullable, + toBeASuccessNullable, + toBeAFailureFeature, + toBeAFailure + ) { val successFunctions = uncheckedToNonNullable( unifySignatures(toBeASuccessFeature, toBeASuccess), unifySignatures(toBeASuccessFeatureNullable, toBeASuccessNullable) @@ -82,9 +91,13 @@ abstract class ResultExpectationsSpec( it("$name - can perform sub-assertion which fails, throws AssertionError") { expect { expect(resultSuccess).toBeASuccessFun { toEqual(2) } - }.toThrow { - messageToContain("$valueDescr: 1", "$toEqualDescr: 2") - } + }.toThrow().message.toMatch( + Regex( + "$expectationVerb : .*$lineSeparator" + + "$g$f${DescriptionResultProof.VALUE.string}\\s+: 1$lineSeparator" + + "$indentG$indentF$x$toEqualDescr : 2" + ) + ) } } @@ -93,15 +106,16 @@ abstract class ResultExpectationsSpec( expect { expect(resultSuccess).toBeAFailureFun { messageToContain("oh yes...") } }.toThrow { - messageToContain( - "$exceptionDescr: $isNotFailureDescr", - "$toBeAnInstanceOfDescr: ${IllegalArgumentException::class.simpleName}" - ) - if (hasExtraHint) { - messageToContain( - DescriptionCharSequenceProof.TO_CONTAIN.string, - "${DescriptionCharSequenceProof.VALUE.string}: \"oh yes...\"" + message { + toContainDescr(DescriptionResultProof.EXCEPTION, isNotFailureDescr) + toContainDescr( + DescriptionAnyProof.TO_BE_AN_INSTANCE_OF, + IllegalArgumentException::class.simpleName ) + if (hasExtraHint) { + toContain(DescriptionCharSequenceProof.TO_CONTAIN.string) + toContainDescr(DescriptionCharSequenceProof.VALUE, "\"oh yes...\"") + } } } } @@ -114,8 +128,12 @@ abstract class ResultExpectationsSpec( expect { expect(resultFailure).toBeASuccessFun { toEqual(1) } }.toThrow { - messageToContain("$valueDescr: $isNotSuccessDescr") - if (hasExtraHint) messageToContain("$toEqualDescr: 1") + message { + toContainDescr(DescriptionResultProof.VALUE, isNotSuccessDescr) + if (hasExtraHint) { + toContainToEqualDescr(1) + } + } } } } @@ -128,10 +146,11 @@ abstract class ResultExpectationsSpec( expect { expect(resultFailure).toBeAFailureFun { messageToContain("oh yes...") } }.toThrow { - messageToContain( - "$exceptionDescr: ${IllegalArgumentException::class.fullName}", - DescriptionCharSequenceProof.TO_CONTAIN.string, "${DescriptionCharSequenceProof.VALUE.string}: \"oh yes...\"" - ) + message { + toContainDescr(DescriptionResultProof.EXCEPTION, IllegalArgumentException::class.fullName) + toContain(DescriptionCharSequenceProof.TO_CONTAIN.string) + toContainDescr(DescriptionCharSequenceProof.VALUE, "\"oh yes...\"") + } } } } @@ -150,7 +169,10 @@ abstract class ResultExpectationsSpec( expect { expect(resultNullSuccess).toBeASuccessFun { toEqual(2) } }.toThrow { - messageToContain("$valueDescr: null", "$toEqualDescr: 2") + message { + toContainDescr(DescriptionResultProof.VALUE, "null") + toContainToEqualDescr(2) + } } } } @@ -160,8 +182,10 @@ abstract class ResultExpectationsSpec( expect { expect(resultNullableFailure).toBeASuccessFun { toEqual(1) } }.toThrow { - messageToContain("$valueDescr: $isNotSuccessDescr") - if (hasExtraHint) messageToContain("$toEqualDescr: 1") + message { + toContainDescr(DescriptionResultProof.VALUE, isNotSuccessDescr) + if (hasExtraHint) toContainToEqualDescr(1) + } } } } diff --git a/misc/atrium-specs/src/commonMain/kotlin/ch/tutteli/atrium/specs/integration/ThirdPartyExpectationsSpec.kt b/misc/atrium-specs/src/commonMain/kotlin/ch/tutteli/atrium/specs/integration/ThirdPartyExpectationsSpec.kt index 4651c46a81..d21e8e84c0 100644 --- a/misc/atrium-specs/src/commonMain/kotlin/ch/tutteli/atrium/specs/integration/ThirdPartyExpectationsSpec.kt +++ b/misc/atrium-specs/src/commonMain/kotlin/ch/tutteli/atrium/specs/integration/ThirdPartyExpectationsSpec.kt @@ -2,11 +2,10 @@ package ch.tutteli.atrium.specs.integration import ch.tutteli.atrium.api.fluent.en_GB.* import ch.tutteli.atrium.api.verbs.internal.expect -import ch.tutteli.atrium.assertions.Assertion import ch.tutteli.atrium.creating.ExperimentalComponentFactoryContainer -import ch.tutteli.atrium.creating.build -import ch.tutteli.atrium.reporting.AssertionFormatterFacade -import ch.tutteli.atrium.reporting.Reporter +import ch.tutteli.atrium.reporting.filters.ReportableFilter +import ch.tutteli.atrium.reporting.reportables.Reportable +import ch.tutteli.atrium.reporting.reportables.descriptions.DescriptionThrowableProof import ch.tutteli.atrium.specs.* import ch.tutteli.atrium.specs.integration.IterableToContainSpecBase.Companion.nonNullableCases import org.spekframework.spek2.Spek @@ -44,9 +43,9 @@ abstract class ThirdPartyExpectationsSpec( throw IllegalArgumentException("expect x was y") } } - }.toThrow() { + }.toThrow { message { - toContain("(assertJ) is old enough: true") + toContain("(assertJ) is old enough : true") notToContain("expect x was y") } } @@ -58,27 +57,23 @@ abstract class ThirdPartyExpectationsSpec( context("expectation holds") { it("shows the description and representation of the third party expectation in reporting") { expect { - expect(1).withOptions { - withComponent(Reporter::class) { c -> - //TODO 1.3.0 switch to new reporter - @Suppress("DEPRECATION") val assertionFormatterFacade = c.build() - object : Reporter { - override fun format(assertion: Assertion, sb: StringBuilder): Unit = - assertionFormatterFacade.format(assertion, sb, this::assertionFilter) - - private fun assertionFilter(@Suppress("UNUSED_PARAMETER") assertion: Assertion) = true + expect(1).withOptions { + withComponent(ReportableFilter::class) { _ -> + object : ReportableFilter { + override fun includeInReporting(reportable: Reportable): Boolean = true + } } - } - }.toHoldThirdPartyExpectationFun("(assertJ) is equal to", 10) { subject -> + }.toHoldThirdPartyExpectationFun("(assertJ) is equal to", 10) { subject -> assertThat(subject + 9).toEqual(10) - } //fails, due to customer Reporter we should also see holding third party expectation from above + } //fails, due to custom ReportableFilter we should also see holding third party expectation from above .toEqual(2) }.toThrow { message { - toContain("(assertJ) is equal to: 10") - notToContain( - "I expected subject: 10", - "$toEqualDescr: 10" + toContain("(assertJ) is equal to : 10") + toContainToEqualDescr(2) + notToContain.regex( + "$expectationVerb\\s+: 10", + "$toEqualDescr\\s+: 10" ) } } @@ -94,11 +89,17 @@ abstract class ThirdPartyExpectationsSpec( }.toThrow { message { toContain( - "(assertJ) is equal to: 9", - "I expected subject: 10", - "$toEqualDescr: 9", + "(assertJ) is equal to : 9", + "$i${DescriptionThrowableProof.OCCURRED_EXCEPTION_PROPERTIES.string} AtriumError", + "$expectationVerb : 10", + ) + toContainToEqualDescr(9) + toContainRegex( + Regex( + "stacktrace : $lineSeparator" + + "$indentG$indentI$indentExplanatory$listBulletPoint.*ThirdPartyExpectationsSpec" + ) ) - toContainRegex(Regex("""stacktrace:\s*\n.*ThirdPartyExpectationsSpec""")) } } } diff --git a/misc/atrium-specs/src/commonMain/kotlin/ch/tutteli/atrium/specs/integration/ThrowableExpectationsSpec.kt b/misc/atrium-specs/src/commonMain/kotlin/ch/tutteli/atrium/specs/integration/ThrowableExpectationsSpec.kt index 67986bbcb1..0fd63b317d 100644 --- a/misc/atrium-specs/src/commonMain/kotlin/ch/tutteli/atrium/specs/integration/ThrowableExpectationsSpec.kt +++ b/misc/atrium-specs/src/commonMain/kotlin/ch/tutteli/atrium/specs/integration/ThrowableExpectationsSpec.kt @@ -8,7 +8,6 @@ import ch.tutteli.atrium.creating.Expect import ch.tutteli.atrium.reporting.reportables.descriptions.DescriptionCharSequenceProof import ch.tutteli.atrium.reporting.reportables.descriptions.DescriptionThrowableProof import ch.tutteli.atrium.specs.* -import ch.tutteli.atrium.translations.DescriptionCharSequenceExpectation import org.spekframework.spek2.Spek import org.spekframework.spek2.style.specification.Suite @@ -32,7 +31,7 @@ abstract class ThrowableExpectationsSpec( include(object : AssertionCreatorSpec( describePrefix, RuntimeException("hello"), - message.forAssertionCreatorSpec("$toEqualDescr: hello") { toEqual("hello") } + message.forAssertionCreatorSpec("$toEqualDescr\\s+: hello") { toEqual("hello") } ) {}) fun describeFun(vararg pairs: SpecPair<*>, body: Suite.() -> Unit) = @@ -56,7 +55,7 @@ abstract class ThrowableExpectationsSpec( notToEqualNullButToBeInstanceOfDescr, String::class.fullName ) - if (hasExtraHint) messageToContain("$toEqualDescr: \"hello\"") + if (hasExtraHint) messageToContain("$toEqualDescr : \"hello\"") } } } @@ -69,10 +68,10 @@ abstract class ThrowableExpectationsSpec( messageToContain( notToEqualNullButToBeInstanceOfDescr, String::class.fullName, DescriptionCharSequenceProof.TO_CONTAIN.string, - "$valueDescr: 1", - "$valueDescr: 2.3", - "$valueDescr: 'z'", - "$valueDescr: \"hello\"" + "$valueDescr : 1", + "$valueDescr : 2.3", + "$valueDescr : 'z'", + "$valueDescr : \"hello\"" ) } } @@ -84,7 +83,7 @@ abstract class ThrowableExpectationsSpec( it("$name - throws an AssertionError if the assertion does not hold") { expect { expect(throwable).messageFun { toEqual("hello") } - }.toThrow { messageToContain("$toEqualDescr: \"hello\"") } + }.toThrow { messageToContain("$toEqualDescr : \"hello\"") } } it("$name - does not throw if the assertion holds") { @@ -94,7 +93,7 @@ abstract class ThrowableExpectationsSpec( it("${messageToContain.name} - throws an AssertionError if the assertion does not hold") { expect { expect(throwable).messageContainsFun("nada", arrayOf()) - }.toThrow { messageToContain("$valueDescr: \"nada\"") } + }.toThrow { messageToContain("$valueDescr : \"nada\"") } } it("${messageToContain.name} - throws IllegalArgumentException if empty string is passed") { expect { @@ -109,7 +108,7 @@ abstract class ThrowableExpectationsSpec( it("$name - throws an AssertionError if the assertion does not hold") { expect { expect(throwable).messageFun { toEqual("hello") } - }.toThrow { messageToContain("$toEqualDescr: \"hello\"") } + }.toThrow { messageToContain("$toEqualDescr : \"hello\"") } } it("$name - does not throw if the assertion holds") { @@ -119,7 +118,7 @@ abstract class ThrowableExpectationsSpec( it("${messageToContain.name} - throws an AssertionError if the assertion does not hold") { expect { expect(throwable).messageContainsFun("nada", arrayOf()) - }.toThrow { messageToContain("$valueDescr: \"nada\"") } + }.toThrow { messageToContain("$valueDescr : \"nada\"") } } it("${messageToContain.name} - does not throw if the assertion holds") { expect(throwable).messageContainsFun(" ", arrayOf()) @@ -133,7 +132,7 @@ abstract class ThrowableExpectationsSpec( it("$name - throws an AssertionError if the assertion does not hold") { expect { expect(throwable).messageFun { toEqual("hello") } - }.toThrow { messageToContain("$toEqualDescr: \"hello\"") } + }.toThrow { messageToContain("$toEqualDescr : \"hello\"") } } it("$name - does not throw if the assertion holds") { @@ -144,7 +143,7 @@ abstract class ThrowableExpectationsSpec( it("${messageToContain.name} - throws an AssertionError if the assertion does not hold") { expect { expect(throwable).messageContainsFun("nada", arrayOf()) - }.toThrow { messageToContain("$valueDescr: \"nada\"") } + }.toThrow { messageToContain("$valueDescr : \"nada\"") } } it("${messageToContain.name} - does not throw if the assertion holds") { expect(throwable).messageContainsFun(1, arrayOf(2.3, 'z', "hello")) @@ -177,8 +176,8 @@ abstract class ThrowableExpectationsSpec( expect(throwable).causeFun { messageToContain("WRONG message") } }.toThrow { messageToContain( - DescriptionThrowableProof.OCCURRED_EXCEPTION_CAUSE.string + ": java.lang.IllegalArgumentException", - "$valueDescr: \"WRONG message\"" + DescriptionThrowableProof.OCCURRED_EXCEPTION_CAUSE.string + " : java.lang.IllegalArgumentException", + "$valueDescr : \"WRONG message\"" ) } } diff --git a/misc/atrium-specs/src/commonMain/kotlin/ch/tutteli/atrium/specs/reporting/TextSummaryAssertionGroupFormatterSpec.kt b/misc/atrium-specs/src/commonMain/kotlin/ch/tutteli/atrium/specs/reporting/TextSummaryAssertionGroupFormatterSpec.kt index 66ee405f45..84960b70b5 100644 --- a/misc/atrium-specs/src/commonMain/kotlin/ch/tutteli/atrium/specs/reporting/TextSummaryAssertionGroupFormatterSpec.kt +++ b/misc/atrium-specs/src/commonMain/kotlin/ch/tutteli/atrium/specs/reporting/TextSummaryAssertionGroupFormatterSpec.kt @@ -214,7 +214,7 @@ abstract class TextSummaryAssertionGroupFormatterSpec( + "$failingBulletPoint ${DummyTranslatables.EXPECT.getDefault()}: 22$lineSeparator" + "$indentFailingBulletPoint$successBulletPoint ${DummyTranslatables.EXPECT.getDefault()}: 1$lineSeparator" + "$indentFailingBulletPoint$failingBulletPoint ${DummyTranslatables.EXPECT_THROWN.getDefault()}: 2$lineSeparator" - + "$successBulletPoint ${DummyTranslatables.EXPECT_THROWN.getDefault()}: (Text)$lineSeparator" + + "$successBulletPoint ${DummyTranslatables.EXPECT_THROWN.getDefault()}: Text()$lineSeparator" + "$indentSuccessBulletPoint$successBulletPoint ${DummyTranslatables.EXPECT.getDefault()}: 30$lineSeparator" + "$indentSuccessBulletPoint$successBulletPoint ${DummyTranslatables.EXPECT.getDefault()}: 31" ) diff --git a/misc/atrium-specs/src/commonMain/kotlin/ch/tutteli/atrium/specs/testUtils.kt b/misc/atrium-specs/src/commonMain/kotlin/ch/tutteli/atrium/specs/testUtils.kt index ce80f749f9..3302db3d30 100644 --- a/misc/atrium-specs/src/commonMain/kotlin/ch/tutteli/atrium/specs/testUtils.kt +++ b/misc/atrium-specs/src/commonMain/kotlin/ch/tutteli/atrium/specs/testUtils.kt @@ -5,11 +5,7 @@ package ch.tutteli.atrium.specs import ch.tutteli.atrium.creating.Expect import ch.tutteli.atrium.logic.utils.expectLambda import ch.tutteli.atrium.reporting.reportables.descriptions.DescriptionAnyProof -import ch.tutteli.atrium.reporting.reportables.descriptions.DescriptionBasic import ch.tutteli.atrium.reporting.reportables.descriptions.DescriptionComparableProof -import ch.tutteli.atrium.translations.DescriptionAnyExpectation -import ch.tutteli.atrium.translations.DescriptionAnyExpectation.NOT_TO_EQUAL_NULL_TO_BE_AN_INSTANCE_OF -import ch.tutteli.atrium.translations.DescriptionComparableExpectation import kotlin.jvm.JvmName import kotlin.reflect.* @@ -287,12 +283,13 @@ inline fun fun5(f: KFunction6, A1, A2, A3, A4, fun notImplemented(): T = throw NotImplementedError() val toEqualDescr = DescriptionAnyProof.TO_EQUAL.string -val toBeDescr = DescriptionBasic.TO_BE.string -val notToBeDescr = DescriptionBasic.NOT_TO_BE.string val toBeAnInstanceOfDescr = DescriptionAnyProof.TO_BE_AN_INSTANCE_OF.string val toBeLessThanDescr = DescriptionComparableProof.TO_BE_LESS_THAN.string val toBeGreaterThanDescr = DescriptionComparableProof.TO_BE_GREATER_THAN.string -val notToEqualNullButToBeInstanceOfDescr = NOT_TO_EQUAL_NULL_TO_BE_AN_INSTANCE_OF.string + +//TODO 1.3.0 replace +@Suppress("DEPRECATION") +val notToEqualNullButToBeInstanceOfDescr = ch.tutteli.atrium.translations.DescriptionAnyExpectation.NOT_TO_EQUAL_NULL_TO_BE_AN_INSTANCE_OF.string expect val lineSeparator: String val expectationVerb = "I expected subject" diff --git a/misc/atrium-specs/src/commonMain/kotlin/ch/tutteli/atrium/specs/verbs/VerbSpec.kt b/misc/atrium-specs/src/commonMain/kotlin/ch/tutteli/atrium/specs/verbs/VerbSpec.kt index 899ac50442..aad067551a 100644 --- a/misc/atrium-specs/src/commonMain/kotlin/ch/tutteli/atrium/specs/verbs/VerbSpec.kt +++ b/misc/atrium-specs/src/commonMain/kotlin/ch/tutteli/atrium/specs/verbs/VerbSpec.kt @@ -7,12 +7,13 @@ import ch.tutteli.atrium.creating.Expect import ch.tutteli.atrium.creating.ExpectGrouping import ch.tutteli.atrium.logic.changeSubject import ch.tutteli.atrium.logic.creating.RootExpectBuilder -import ch.tutteli.atrium.reporting.reportables.descriptions.DescriptionAnyProof import ch.tutteli.atrium.reporting.reportables.ErrorMessages.* +import ch.tutteli.atrium.reporting.reportables.descriptions.DescriptionAnyProof +import ch.tutteli.atrium.reporting.reportables.descriptions.DescriptionComparableProof import ch.tutteli.atrium.specs.* -import ch.tutteli.atrium.translations.DescriptionComparableExpectation -import ch.tutteli.atrium.translations.DescriptionComparableExpectation.TO_BE_GREATER_THAN -import ch.tutteli.atrium.translations.DescriptionComparableExpectation.TO_BE_LESS_THAN +import ch.tutteli.atrium.specs.integration.toContainToBeGreaterDescr +import ch.tutteli.atrium.specs.integration.toContainToBeLessThanDescr +import ch.tutteli.atrium.specs.integration.toContainToEqualDescr import org.spekframework.spek2.Spek import org.spekframework.spek2.style.specification.Suite @@ -60,7 +61,7 @@ abstract class VerbSpec( assertionVerb(1) { toEqual(1) }.toBeLessThan(1) }.toThrow { message { - toContain("${TO_BE_LESS_THAN.getDefault()}: 1") + toContainToBeLessThanDescr(1) notToContain(toEqualDescr) } } @@ -73,11 +74,9 @@ abstract class VerbSpec( assertionVerb(1) { toEqual(1) }.and { toBeLessThan(0); toEqual(1); toBeGreaterThan(2) } }.toThrow { message { - toContain( - ": 1", - "${TO_BE_LESS_THAN.getDefault()}: 0", - "${TO_BE_GREATER_THAN.getDefault()}: 2" - ) + toContain(": 1") + toContainToBeLessThanDescr(0) + toContainToBeGreaterDescr(2) notToContain(toEqualDescr) } } @@ -95,8 +94,8 @@ abstract class VerbSpec( }.toThrow { message { toContain(": 1") - toContain("${TO_BE_LESS_THAN.getDefault()}: 0") - toContain("${TO_BE_GREATER_THAN.getDefault()}: 2") + toContainToBeLessThanDescr(0) + toContainToBeGreaterDescr(2) } } } @@ -114,10 +113,13 @@ abstract class VerbSpec( assert { assertionVerb(null).notToEqualNull { toEqual(1) } }.toThrow { - messageToContain( - notToEqualNullButToBeInstanceOfDescr, - "Int", "$toEqualDescr: 1" - ) + message { + toContain( + ": null", + "$notToEqualNullButToBeInstanceOfDescr : Int", + "$indentX$explanatoryBulletPoint$toEqualDescr : 1" + ) + } } } } @@ -141,7 +143,7 @@ abstract class VerbSpec( assert { assertionVerb { throw IllegalArgumentException() - }.toThrow {} + }.toThrow() }.toThrow { messageToContain( DescriptionAnyProof.TO_BE_AN_INSTANCE_OF.string, @@ -163,11 +165,11 @@ abstract class VerbSpec( }.toThrow { message { toContain( - "group description:", - AT_LEAST_ONE_EXPECTATION_DEFINED.string + ": false", + "group description :", + AT_LEAST_ONE_EXPECTATION_DEFINED.string + " : false", FORGOT_DO_DEFINE_EXPECTATION.string, - DEFAULT_HINT_AT_LEAST_ONE_EXPECTATION_DEFINED.string ) + notToContain(DEFAULT_HINT_AT_LEAST_ONE_EXPECTATION_DEFINED.string) } } @@ -190,7 +192,7 @@ abstract class VerbSpec( "another without" ) toContain.exactly(2).values( - AT_LEAST_ONE_EXPECTATION_DEFINED.string + ": false", + AT_LEAST_ONE_EXPECTATION_DEFINED.string + " : false", FORGOT_DO_DEFINE_EXPECTATION.string, DEFAULT_HINT_AT_LEAST_ONE_EXPECTATION_DEFINED.string ) @@ -233,7 +235,7 @@ abstract class VerbSpec( } }.toThrow { message { - toContain("${TO_BE_LESS_THAN.getDefault()}: 1") + toContainToBeLessThanDescr(1) notToContain(toEqualDescr) } } @@ -255,23 +257,21 @@ abstract class VerbSpec( } }.toThrow { message { - toContain( - ": 2", - "$toEqualDescr: 3", - "# verifying Xy", - ": 4", - "${TO_BE_LESS_THAN.getDefault()}: 0", - ": 5", - "$toEqualDescr: 6", - - ": 8", - "$toEqualDescr: 9", - ) - notToContain( + toContain(": 2") + toContainToEqualDescr(3) + //TODO 1.3.0 should contain the grouping icon + toContain("verifying Xy : ") + toContain(": 4") + toContainToBeLessThanDescr(0) + toContain(": 5") + toContainToEqualDescr(6) + toContain(": 8") + toContainToEqualDescr(9) + notToContain.regex( ": 1", - "$toEqualDescr: 1", + "$toEqualDescr\\s+: 1", ": 7", - "${TO_BE_GREATER_THAN.getDefault()}: 1", + "${DescriptionComparableProof.TO_BE_GREATER_THAN.string}\\s+: 1", ) } } @@ -287,14 +287,15 @@ private fun Suite.testNonNullableSubject(assertionVerb: (Int) -> Expect) { it("does not throw an exception in case the assertion holds") { assertionVerb(1).toEqual(1) } - it("throws an AssertionError as soon as one assertion fails") { + it("throws an AssertionError as soon as one expectation fails") { assert { assertionVerb(1).toBeLessThanOrEqualTo(10).and.toBeLessThanOrEqualTo(0).and.toBeGreaterThanOrEqualTo(2) }.toThrow { - message { + message{ toContain(": 1") - toContain("${DescriptionComparableExpectation.TO_BE_LESS_THAN_OR_EQUAL_TO.getDefault()}: 0") - notToContain("${DescriptionComparableExpectation.TO_BE_GREATER_THAN_OR_EQUAL_TO.getDefault()}: 2") + toContainRegex(DescriptionComparableProof.TO_BE_LESS_THAN_OR_EQUAL_TO.string+"\\s+: 0") + notToContain.regex(DescriptionComparableProof.TO_BE_GREATER_THAN_OR_EQUAL_TO.string+"\\s+: 2") + } } } diff --git a/misc/atrium-specs/src/jvmMain/kotlin/ch/tutteli/atrium/specs/integration/BigDecimalExpectationsSpec.kt b/misc/atrium-specs/src/jvmMain/kotlin/ch/tutteli/atrium/specs/integration/BigDecimalExpectationsSpec.kt index a145360c06..6e8427eb83 100644 --- a/misc/atrium-specs/src/jvmMain/kotlin/ch/tutteli/atrium/specs/integration/BigDecimalExpectationsSpec.kt +++ b/misc/atrium-specs/src/jvmMain/kotlin/ch/tutteli/atrium/specs/integration/BigDecimalExpectationsSpec.kt @@ -7,7 +7,6 @@ import ch.tutteli.atrium.creating.PleaseUseReplacementException import ch.tutteli.atrium.reporting.reportables.descriptions.DescriptionAnyProof import ch.tutteli.atrium.reporting.reportables.descriptions.DescriptionBigDecimalProof import ch.tutteli.atrium.specs.* -import ch.tutteli.atrium.translations.DescriptionBigDecimalAssertion import org.spekframework.spek2.Spek import org.spekframework.spek2.style.specification.Suite import java.math.BigDecimal @@ -107,7 +106,7 @@ abstract class BigDecimalExpectationsSpec( //TODO 1.3.0 check this most likely changed and hence is not found (i.e. false positive) val failureHintNotNumerically = String.format( - DescriptionBigDecimalAssertion.FAILURE_IS_EQUAL_INCLUDING_SCALE_BUT_NUMERICALLY_EQUAL.getDefault(), + DescriptionBigDecimalProof.FAILURE_IS_EQUAL_INCLUDING_SCALE_BUT_NUMERICALLY_EQUAL.string, notToEqualNumerically.name ) context("subject is 10 and expected is 10") { @@ -162,7 +161,7 @@ abstract class BigDecimalExpectationsSpec( } val failureHintNumerically = String.format( - DescriptionBigDecimalAssertion.FAILURE_IS_EQUAL_INCLUDING_SCALE_BUT_NUMERICALLY_EQUAL.getDefault(), + DescriptionBigDecimalProof.FAILURE_IS_EQUAL_INCLUDING_SCALE_BUT_NUMERICALLY_EQUAL.string, toEqualNumerically.name ) listOf( diff --git a/misc/atrium-specs/src/jvmMain/kotlin/ch/tutteli/atrium/specs/integration/ChronoLocalDateTimeAsStringExpectationsSpec.kt b/misc/atrium-specs/src/jvmMain/kotlin/ch/tutteli/atrium/specs/integration/ChronoLocalDateTimeAsStringExpectationsSpec.kt index a3b4bd313c..2beb894663 100644 --- a/misc/atrium-specs/src/jvmMain/kotlin/ch/tutteli/atrium/specs/integration/ChronoLocalDateTimeAsStringExpectationsSpec.kt +++ b/misc/atrium-specs/src/jvmMain/kotlin/ch/tutteli/atrium/specs/integration/ChronoLocalDateTimeAsStringExpectationsSpec.kt @@ -5,13 +5,11 @@ import ch.tutteli.atrium.api.fluent.en_GB.messageToContain import ch.tutteli.atrium.api.fluent.en_GB.toThrow import ch.tutteli.atrium.api.verbs.internal.expect import ch.tutteli.atrium.creating.Expect -import ch.tutteli.atrium.reporting.reportables.descriptions.DescriptionDateTimeLikeProof import ch.tutteli.atrium.reporting.reportables.descriptions.DescriptionDateTimeLikeProof.* import ch.tutteli.atrium.specs.Fun1 import ch.tutteli.atrium.specs.fun1 import ch.tutteli.atrium.specs.lambda import ch.tutteli.atrium.specs.name -import ch.tutteli.atrium.translations.DescriptionDateTimeLikeExpectation import org.spekframework.spek2.Spek import org.spekframework.spek2.style.specification.describe import java.time.Duration diff --git a/misc/atrium-specs/src/jvmMain/kotlin/ch/tutteli/atrium/specs/integration/ChronoLocalDateTimeExpectationsSpec.kt b/misc/atrium-specs/src/jvmMain/kotlin/ch/tutteli/atrium/specs/integration/ChronoLocalDateTimeExpectationsSpec.kt index cb6f9bef0f..6c31aadd26 100644 --- a/misc/atrium-specs/src/jvmMain/kotlin/ch/tutteli/atrium/specs/integration/ChronoLocalDateTimeExpectationsSpec.kt +++ b/misc/atrium-specs/src/jvmMain/kotlin/ch/tutteli/atrium/specs/integration/ChronoLocalDateTimeExpectationsSpec.kt @@ -1,13 +1,10 @@ package ch.tutteli.atrium.specs.integration import ch.tutteli.atrium.api.fluent.en_GB.message -import ch.tutteli.atrium.api.fluent.en_GB.messageToContain import ch.tutteli.atrium.api.fluent.en_GB.toThrow import ch.tutteli.atrium.api.verbs.internal.expect -import ch.tutteli.atrium.reporting.reportables.descriptions.DescriptionDateTimeLikeProof import ch.tutteli.atrium.reporting.reportables.descriptions.DescriptionDateTimeLikeProof.* import ch.tutteli.atrium.specs.* -import ch.tutteli.atrium.translations.DescriptionDateTimeLikeExpectation import org.spekframework.spek2.Spek import org.spekframework.spek2.style.specification.describe import java.time.LocalDateTime diff --git a/misc/atrium-specs/src/jvmMain/kotlin/ch/tutteli/atrium/specs/integration/ChronoZonedDateTimeExpectationsSpec.kt b/misc/atrium-specs/src/jvmMain/kotlin/ch/tutteli/atrium/specs/integration/ChronoZonedDateTimeExpectationsSpec.kt index ab77f854a2..2e687ea3fa 100644 --- a/misc/atrium-specs/src/jvmMain/kotlin/ch/tutteli/atrium/specs/integration/ChronoZonedDateTimeExpectationsSpec.kt +++ b/misc/atrium-specs/src/jvmMain/kotlin/ch/tutteli/atrium/specs/integration/ChronoZonedDateTimeExpectationsSpec.kt @@ -1,14 +1,10 @@ package ch.tutteli.atrium.specs.integration import ch.tutteli.atrium.api.fluent.en_GB.message -import ch.tutteli.atrium.api.fluent.en_GB.messageToContain import ch.tutteli.atrium.api.fluent.en_GB.toThrow import ch.tutteli.atrium.api.verbs.internal.expect -import ch.tutteli.atrium.reporting.reportables.descriptions.DescriptionAnyProof -import ch.tutteli.atrium.reporting.reportables.descriptions.DescriptionDateTimeLikeProof import ch.tutteli.atrium.reporting.reportables.descriptions.DescriptionDateTimeLikeProof.* import ch.tutteli.atrium.specs.* -import ch.tutteli.atrium.translations.DescriptionDateTimeLikeExpectation import org.spekframework.spek2.Spek import org.spekframework.spek2.style.specification.describe import java.time.ZoneOffset diff --git a/misc/atrium-specs/src/jvmMain/kotlin/ch/tutteli/atrium/specs/integration/Fun0ExpectationsJvmSpec.kt b/misc/atrium-specs/src/jvmMain/kotlin/ch/tutteli/atrium/specs/integration/Fun0ExpectationsJvmSpec.kt index 0e05ebc3db..8c05a74142 100644 --- a/misc/atrium-specs/src/jvmMain/kotlin/ch/tutteli/atrium/specs/integration/Fun0ExpectationsJvmSpec.kt +++ b/misc/atrium-specs/src/jvmMain/kotlin/ch/tutteli/atrium/specs/integration/Fun0ExpectationsJvmSpec.kt @@ -1,12 +1,14 @@ package ch.tutteli.atrium.specs.integration -import ch.tutteli.atrium.api.fluent.en_GB.* +import ch.tutteli.atrium.api.fluent.en_GB.message +import ch.tutteli.atrium.api.fluent.en_GB.toContainRegex +import ch.tutteli.atrium.api.fluent.en_GB.toEqual +import ch.tutteli.atrium.api.fluent.en_GB.toThrow import ch.tutteli.atrium.api.verbs.internal.expect import ch.tutteli.atrium.core.polyfills.fullName import ch.tutteli.atrium.creating.Expect import ch.tutteli.atrium.reporting.reportables.descriptions.DescriptionThrowableProof import ch.tutteli.atrium.specs.* -import ch.tutteli.atrium.translations.DescriptionThrowableExpectation import org.spekframework.spek2.Spek import org.spekframework.spek2.style.specification.Suite import java.io.IOException diff --git a/misc/atrium-specs/src/jvmMain/kotlin/ch/tutteli/atrium/specs/integration/LocalDateExpectationsSpec.kt b/misc/atrium-specs/src/jvmMain/kotlin/ch/tutteli/atrium/specs/integration/LocalDateExpectationsSpec.kt index d7470d2901..796d7eaf5d 100644 --- a/misc/atrium-specs/src/jvmMain/kotlin/ch/tutteli/atrium/specs/integration/LocalDateExpectationsSpec.kt +++ b/misc/atrium-specs/src/jvmMain/kotlin/ch/tutteli/atrium/specs/integration/LocalDateExpectationsSpec.kt @@ -5,13 +5,11 @@ import ch.tutteli.atrium.api.verbs.internal.expect import ch.tutteli.atrium.creating.Expect import ch.tutteli.atrium.reporting.reportables.descriptions.DescriptionDateTimeLikeProof import ch.tutteli.atrium.specs.* -import ch.tutteli.atrium.translations.DescriptionDateTimeLikeExpectation import org.spekframework.spek2.Spek import org.spekframework.spek2.style.specification.Suite import java.time.DayOfWeek import java.time.LocalDate import java.time.Month -import java.time.Year abstract class LocalDateExpectationsSpec( yearFeature: Feature0, diff --git a/misc/atrium-specs/src/jvmMain/kotlin/ch/tutteli/atrium/specs/integration/LocalDateTimeExpectationsSpec.kt b/misc/atrium-specs/src/jvmMain/kotlin/ch/tutteli/atrium/specs/integration/LocalDateTimeExpectationsSpec.kt index 51b252531c..7b700d44c8 100644 --- a/misc/atrium-specs/src/jvmMain/kotlin/ch/tutteli/atrium/specs/integration/LocalDateTimeExpectationsSpec.kt +++ b/misc/atrium-specs/src/jvmMain/kotlin/ch/tutteli/atrium/specs/integration/LocalDateTimeExpectationsSpec.kt @@ -5,7 +5,6 @@ import ch.tutteli.atrium.api.verbs.internal.expect import ch.tutteli.atrium.creating.Expect import ch.tutteli.atrium.reporting.reportables.descriptions.DescriptionDateTimeLikeProof import ch.tutteli.atrium.specs.* -import ch.tutteli.atrium.translations.DescriptionDateTimeLikeExpectation import org.spekframework.spek2.Spek import org.spekframework.spek2.style.specification.Suite import java.time.DayOfWeek diff --git a/misc/atrium-specs/src/jvmMain/kotlin/ch/tutteli/atrium/specs/integration/PathExpectationsSpec.kt b/misc/atrium-specs/src/jvmMain/kotlin/ch/tutteli/atrium/specs/integration/PathExpectationsSpec.kt index 5424b995f6..1667fe20c4 100644 --- a/misc/atrium-specs/src/jvmMain/kotlin/ch/tutteli/atrium/specs/integration/PathExpectationsSpec.kt +++ b/misc/atrium-specs/src/jvmMain/kotlin/ch/tutteli/atrium/specs/integration/PathExpectationsSpec.kt @@ -2,8 +2,13 @@ package ch.tutteli.atrium.specs.integration import ch.tutteli.atrium.api.fluent.en_GB.* import ch.tutteli.atrium.api.verbs.internal.expect +import ch.tutteli.atrium.assertions.AssertionGroup import ch.tutteli.atrium.creating.Expect +import ch.tutteli.atrium.creating.proofs.ProofGroup +import ch.tutteli.atrium.reporting.AtriumError import ch.tutteli.atrium.reporting.reportables.Description +import ch.tutteli.atrium.reporting.reportables.Reportable +import ch.tutteli.atrium.reporting.reportables.ReportableGroup import ch.tutteli.atrium.reporting.reportables.descriptions.DescriptionBasic import ch.tutteli.atrium.reporting.reportables.descriptions.DescriptionPathProof.* import ch.tutteli.atrium.specs.* @@ -133,6 +138,10 @@ abstract class PathExpectationsSpec( } } + // we need to use File.canonicalPath as the special symlink /var -> /private/var is not resolved via + // toRealPath on MacOs + fun Path.canonicalPathAsString() = toFile().canonicalPath + fun Suite.itPrintsParentAccessDeniedDetails( forceNoLinks: Skip = No, block: (Path) -> Unit @@ -148,11 +157,11 @@ abstract class PathExpectationsSpec( val start = tempFolder.newDirectory("startDir") val doesNotExist = maybeLink.create(start.resolve("i").resolve("dont").resolve("exist")) - start.whileWithPermissions(OWNER_READ, OWNER_WRITE, GROUP_READ) { + start.withTmpPermissions(OWNER_READ, OWNER_WRITE, GROUP_READ) { expect { block(doesNotExist) }.toThrow().message { - toContainDescr(FAILURE_DUE_TO_PARENT, start) + toContainDescr(FAILURE_DUE_TO_PARENT, start.canonicalPathAsString()) toContain( FAILURE_DUE_TO_ACCESS_DENIED.string, String.format(HINT_ACTUAL_POSIX_PERMISSIONS.string, "u=rw g=r o="), @@ -164,6 +173,7 @@ abstract class PathExpectationsSpec( } } + fun throwingPath(): Path { val baseFile = tempFolder.tmpDir.resolve("throwing") @@ -202,7 +212,7 @@ abstract class PathExpectationsSpec( val start = tempFolder.newDirectory("startDir").toRealPath() val doesNotExist = maybeLink.create(start.resolve("i").resolve("dont").resolve("exist")) val existingParentHintMessage = - String.format(HINT_CLOSEST_EXISTING_PARENT_DIRECTORY.string, start) + String.format(HINT_CLOSEST_EXISTING_PARENT_DIRECTORY.string, start.canonicalPathAsString()) expect { block(doesNotExist) }.toThrow().message { @@ -215,14 +225,36 @@ abstract class PathExpectationsSpec( val start = tempFolder.newFile("startFile") val doesNotExist = maybeLink.create(start.resolve("i").resolve("dont").resolve("exist")) val parentErrorMessage = String.format(FAILURE_DUE_TO_PARENT.string, start) - val parentErrorDescription = - String.format( - FAILURE_DUE_TO_WRONG_FILE_TYPE.string, - A_FILE.string, - A_DIRECTORY.string - ) + val parentErrorDescription = String.format( + FAILURE_DUE_TO_WRONG_FILE_TYPE.string, A_FILE.string, A_DIRECTORY.string + ) expect { - block(doesNotExist) + try { + block(doesNotExist) + } catch (e: AtriumError) { + fun printProof(r: Reportable, level: Int) { + when (r) { + is AssertionGroup -> { + println(" ".repeat(level) + "$level." + r::class.simpleName + " type=${r.type}, description=${r.description}, representation=${r.representation}, holds=${r.holds()} children:") + r.children.forEach { + printProof(it, level + 1) + } + } + + is ReportableGroup -> { + println(" ".repeat(level) + "$level." + r::class.simpleName + " children:") + r.children.forEach { + printProof(it, level + 1) + } + } + + else -> println(" ".repeat(level) + "$level." + r::class.simpleName + r) + } + } + println("forceNoLinks: $forceNoLinks maybeLink: $maybeLink") + printProof(e.causingProof, 0) + throw e + } }.toThrow().message { toContain(parentErrorMessage, parentErrorDescription) containsExplanationFor(maybeLink) @@ -349,7 +381,6 @@ abstract class PathExpectationsSpec( "/some/other" to false, "/some/path/other" to false ).forEach { (path, toStartWithHolds) -> - val pathWithoutEndingSlash = if (path.endsWith("/")) path.substring(0, path.length - 2) else path context("compare against $path") { if (toStartWithHolds) { it("${toStartWith.name} - does not throw") { @@ -360,7 +391,7 @@ abstract class PathExpectationsSpec( expect(Paths.get(subject)).notToStartWithFun(Paths.get(path)) }.toThrow { message { - toContainDescr(STARTS_NOT_WITH, pathWithoutEndingSlash) + toContainDescr(STARTS_NOT_WITH, Paths.get(path).toString()) } } } @@ -370,7 +401,7 @@ abstract class PathExpectationsSpec( expect(Paths.get(subject)).toStartWithFun(Paths.get(path)) }.toThrow { message { - toContainDescr(STARTS_WITH, pathWithoutEndingSlash) + toContainDescr(STARTS_WITH, Paths.get(path).toString()) } } } @@ -404,7 +435,6 @@ abstract class PathExpectationsSpec( "other/test" to false, "other/for/test" to false ).forEach { (path, toEndWithHolds) -> - val pathWithoutEndingSlash = if (path.endsWith("/")) path.substring(0, path.length - 2) else path context("compare against $path") { if (toEndWithHolds) { it("${toEndWith.name} - does not throw") { @@ -415,7 +445,7 @@ abstract class PathExpectationsSpec( expect(Paths.get(subject)).notToEndWithFun(Paths.get(path)) }.toThrow { message { - toContainDescr(ENDS_NOT_WITH, pathWithoutEndingSlash) + toContainDescr(ENDS_NOT_WITH, Paths.get(path).toString()) } } } @@ -425,7 +455,7 @@ abstract class PathExpectationsSpec( expect(Paths.get(subject)).toEndWithFun(Paths.get(path)) }.toThrow { message { - toContainDescr(ENDS_WITH, pathWithoutEndingSlash) + toContainDescr(ENDS_WITH, Paths.get(path).toString()) } } } @@ -477,7 +507,7 @@ abstract class PathExpectationsSpec( it("throws an AssertionError for a file") withAndWithoutSymlink { maybeLink -> val file = maybeLink.create(tempFolder.newFile("not-readable")) - file.whileWithPermissions(OWNER_WRITE, OWNER_EXECUTE, GROUP_EXECUTE) { + file.withTmpPermissions(OWNER_WRITE, OWNER_EXECUTE, GROUP_EXECUTE) { expect { expect(file).toBeReadableFun() }.toThrow().message { @@ -494,7 +524,7 @@ abstract class PathExpectationsSpec( it("throws an AssertionError for a directory") withAndWithoutSymlink { maybeLink -> val folder = maybeLink.create(tempFolder.newDirectory("not-readable")) - folder.whileWithPermissions(OWNER_WRITE, OWNER_EXECUTE, GROUP_EXECUTE) { + folder.withTmpPermissions(OWNER_WRITE, OWNER_EXECUTE, GROUP_EXECUTE) { expect { expect(folder).toBeReadableFun() }.toThrow().message { @@ -586,7 +616,7 @@ abstract class PathExpectationsSpec( it("throws an AssertionError for a file") withAndWithoutSymlink { maybeLink -> val file = maybeLink.create(tempFolder.newFile("readable")) - file.whileWithPermissions(OWNER_READ, OWNER_WRITE, OWNER_EXECUTE, OTHERS_EXECUTE) { + file.withTmpPermissions(OWNER_READ, OWNER_WRITE, OWNER_EXECUTE, OTHERS_EXECUTE) { expect { expect(file).notToBeReadableFun() }.toThrow().message { @@ -598,7 +628,7 @@ abstract class PathExpectationsSpec( it("throws an AssertionError for a directory") withAndWithoutSymlink { maybeLink -> val folder = maybeLink.create(tempFolder.newDirectory("readable")) - folder.whileWithPermissions(OWNER_READ, OWNER_WRITE, OWNER_EXECUTE, OTHERS_EXECUTE) { + folder.withTmpPermissions(OWNER_READ, OWNER_WRITE, OWNER_EXECUTE, OTHERS_EXECUTE) { expect { expect(folder).notToBeReadableFun() }.toThrow().message { @@ -611,14 +641,14 @@ abstract class PathExpectationsSpec( context("POSIX: not readable", skip = ifPosixNotSupported) { it("does not throw for a file") withAndWithoutSymlink { maybeLink -> val file = maybeLink.create(tempFolder.newFile("not-readable")) - file.whileWithPermissions(OWNER_WRITE, OWNER_EXECUTE, OTHERS_EXECUTE) { + file.withTmpPermissions(OWNER_WRITE, OWNER_EXECUTE, OTHERS_EXECUTE) { expect(file).notToBeReadableFun() } } it("does not throw for a directory") withAndWithoutSymlink { maybeLink -> val folder = maybeLink.create(tempFolder.newDirectory("not-readable")) - folder.whileWithPermissions(OWNER_WRITE, OWNER_EXECUTE, OTHERS_EXECUTE) { + folder.withTmpPermissions(OWNER_WRITE, OWNER_EXECUTE, OTHERS_EXECUTE) { expect(folder).notToBeReadableFun() } } @@ -702,7 +732,7 @@ abstract class PathExpectationsSpec( it("throws an AssertionError for a file") withAndWithoutSymlink { maybeLink -> val file = maybeLink.create(tempFolder.newFile("not-writable")) - file.whileWithPermissions(OWNER_READ, OWNER_EXECUTE, OTHERS_EXECUTE) { + file.withTmpPermissions(OWNER_READ, OWNER_EXECUTE, OTHERS_EXECUTE) { expect { expect(file).toBeWritableFun() }.toThrow().message { @@ -719,7 +749,7 @@ abstract class PathExpectationsSpec( it("throws an AssertionError for a directory") withAndWithoutSymlink { maybeLink -> val folder = maybeLink.create(tempFolder.newDirectory("not-writable")) - folder.whileWithPermissions(OWNER_READ, OWNER_EXECUTE, OTHERS_EXECUTE) { + folder.withTmpPermissions(OWNER_READ, OWNER_EXECUTE, OTHERS_EXECUTE) { expect { expect(folder).toBeWritableFun() }.toThrow().message { @@ -809,7 +839,7 @@ abstract class PathExpectationsSpec( it("throws an AssertionError for a file") withAndWithoutSymlink { maybeLink -> val file = maybeLink.create(tempFolder.newFile("writable")) - file.whileWithPermissions(OWNER_READ, OWNER_WRITE, OWNER_EXECUTE, OTHERS_EXECUTE) { + file.withTmpPermissions(OWNER_READ, OWNER_WRITE, OWNER_EXECUTE, OTHERS_EXECUTE) { expect { expect(file).notToBeWritableFun() }.toThrow().message { @@ -821,7 +851,7 @@ abstract class PathExpectationsSpec( it("throws an AssertionError for a directory") withAndWithoutSymlink { maybeLink -> val folder = maybeLink.create(tempFolder.newDirectory("writable")) - folder.whileWithPermissions(OWNER_READ, OWNER_WRITE, OWNER_EXECUTE, OTHERS_EXECUTE) { + folder.withTmpPermissions(OWNER_READ, OWNER_WRITE, OWNER_EXECUTE, OTHERS_EXECUTE) { expect { expect(folder).notToBeWritableFun() }.toThrow().message { @@ -834,14 +864,14 @@ abstract class PathExpectationsSpec( context("POSIX: not writable", skip = ifPosixNotSupported) { it("does not throw for a file") withAndWithoutSymlink { maybeLink -> val file = maybeLink.create(tempFolder.newFile("not-writable")) - file.whileWithPermissions(OWNER_READ, OWNER_EXECUTE, OTHERS_EXECUTE) { + file.withTmpPermissions(OWNER_READ, OWNER_EXECUTE, OTHERS_EXECUTE) { expect(file).notToBeWritable() } } it("does not throw for a directory") withAndWithoutSymlink { maybeLink -> val folder = maybeLink.create(tempFolder.newDirectory("not-writable")) - folder.whileWithPermissions(OWNER_READ, OWNER_EXECUTE, OTHERS_EXECUTE) { + folder.withTmpPermissions(OWNER_READ, OWNER_EXECUTE, OTHERS_EXECUTE) { expect(folder).notToBeWritable() } } @@ -911,14 +941,14 @@ abstract class PathExpectationsSpec( context("POSIX: executable", skip = ifPosixNotSupported) { it("does not throw for file") withAndWithoutSymlink { maybeLink -> val file = maybeLink.create(tempFolder.newFile("executable")) - file.whileWithPermissions(OWNER_READ, OWNER_WRITE, OWNER_EXECUTE) { + file.withTmpPermissions(OWNER_READ, OWNER_WRITE, OWNER_EXECUTE) { expect(file).toBeExecutableFun() } } it("does not throw for directory") withAndWithoutSymlink { maybeLink -> val folder = maybeLink.create(tempFolder.newDirectory("executable")) - folder.whileWithPermissions(OWNER_READ, OWNER_WRITE, OWNER_EXECUTE) { + folder.withTmpPermissions(OWNER_READ, OWNER_WRITE, OWNER_EXECUTE) { expect(folder).toBeExecutableFun() } } @@ -945,7 +975,7 @@ abstract class PathExpectationsSpec( it("throws an AssertionError for a file") withAndWithoutSymlink { maybeLink -> val file = maybeLink.create(tempFolder.newFile("not-executable")) - file.whileWithPermissions(OWNER_WRITE, OWNER_READ, GROUP_READ) { + file.withTmpPermissions(OWNER_WRITE, OWNER_READ, GROUP_READ) { expect { expect(file).toBeExecutableFun() }.toThrow().message { @@ -962,7 +992,7 @@ abstract class PathExpectationsSpec( it("throws an AssertionError for a directory") withAndWithoutSymlink { maybeLink -> val folder = maybeLink.create(tempFolder.newDirectory("not-executable")) - folder.whileWithPermissions(OWNER_WRITE, OWNER_READ, GROUP_READ) { + folder.withTmpPermissions(OWNER_WRITE, OWNER_READ, GROUP_READ) { expect { expect(folder).toBeExecutableFun() }.toThrow().message { @@ -1054,7 +1084,7 @@ abstract class PathExpectationsSpec( it("throws an AssertionError for a file") withAndWithoutSymlink { maybeLink -> val file = maybeLink.create(tempFolder.newFile("executable")) - file.whileWithPermissions(OWNER_READ, OWNER_WRITE, OWNER_EXECUTE, OTHERS_EXECUTE) { + file.withTmpPermissions(OWNER_READ, OWNER_WRITE, OWNER_EXECUTE, OTHERS_EXECUTE) { expect { expect(file).notToBeExecutableFun() }.toThrow().message { @@ -1066,7 +1096,7 @@ abstract class PathExpectationsSpec( it("throws an AssertionError for a directory") withAndWithoutSymlink { maybeLink -> val folder = maybeLink.create(tempFolder.newDirectory("executable")) - folder.whileWithPermissions(OWNER_READ, OWNER_WRITE, OWNER_EXECUTE, OTHERS_EXECUTE) { + folder.withTmpPermissions(OWNER_READ, OWNER_WRITE, OWNER_EXECUTE, OTHERS_EXECUTE) { expect { expect(folder).notToBeExecutableFun() }.toThrow().message { @@ -1079,14 +1109,14 @@ abstract class PathExpectationsSpec( context("POSIX: not executable", skip = ifPosixNotSupported) { it("does not throw for a file") withAndWithoutSymlink { maybeLink -> val file = maybeLink.create(tempFolder.newFile("not-executable")) - file.whileWithPermissions(OWNER_READ, OTHERS_EXECUTE) { + file.withTmpPermissions(OWNER_READ, OTHERS_EXECUTE) { expect(file).notToBeExecutable() } } it("does not throw for a directory") withAndWithoutSymlink { maybeLink -> val folder = maybeLink.create(tempFolder.newDirectory("not-executable")) - folder.whileWithPermissions(OWNER_READ, OTHERS_EXECUTE) { + folder.withTmpPermissions(OWNER_READ, OTHERS_EXECUTE) { expect(folder).notToBeExecutable() } } @@ -1474,7 +1504,12 @@ abstract class PathExpectationsSpec( }.toThrow().message { toContain("file1") toContainDescr(DescriptionBasic.TO, EXIST.string, numOfMatches = 2) - toContain.exactly(2).value(String.format(HINT_CLOSEST_EXISTING_PARENT_DIRECTORY.string, tempFolder.tmpDir.resolve("startDir"))) + toContain.exactly(2).value( + String.format( + HINT_CLOSEST_EXISTING_PARENT_DIRECTORY.string, + tempFolder.tmpDir.resolve("startDir").canonicalPathAsString() + ) + ) containsExplanationFor(maybeLink) notToContain("file2") toContain("file3") @@ -1937,13 +1972,13 @@ private fun aclEntry(type: AclEntryType, principal: UserPrincipal, vararg permis /** * Sets the provided [permissionsToUse] on `this` path, executes the [block], and restores the permissions afterwards. */ -private inline fun Path.whileWithPermissions(vararg permissionsToUse: PosixFilePermission, block: () -> Unit) = - whileWithPermissions(setOf(*permissionsToUse), block = block) +private inline fun Path.withTmpPermissions(vararg permissionsToUse: PosixFilePermission, block: () -> Unit) = + withTmpPermissions(setOf(*permissionsToUse), block = block) /** * Sets the provided [permissionsToUse] on `this` path, executes the [block], and restores the permissions afterwards. */ -private inline fun Path.whileWithPermissions( +private inline fun Path.withTmpPermissions( permissionsToUse: Set, block: () -> Unit ) { @@ -2009,7 +2044,7 @@ class SymlinkTestBuilder( internal fun expectedPosixOwnerAndGroupHintFor(path: Path): String { val posixAttributes = path.readAttributes() return String.format( - HINT_OWNER_AND_GROUP.getDefault(), + HINT_OWNER_AND_GROUP.string, posixAttributes.owner().name, posixAttributes.group().name ) diff --git a/misc/atrium-specs/src/jvmMain/kotlin/ch/tutteli/atrium/specs/integration/ZonedDateTimeExpectationsSpec.kt b/misc/atrium-specs/src/jvmMain/kotlin/ch/tutteli/atrium/specs/integration/ZonedDateTimeExpectationsSpec.kt index c2fca62e4d..f9e83d8844 100644 --- a/misc/atrium-specs/src/jvmMain/kotlin/ch/tutteli/atrium/specs/integration/ZonedDateTimeExpectationsSpec.kt +++ b/misc/atrium-specs/src/jvmMain/kotlin/ch/tutteli/atrium/specs/integration/ZonedDateTimeExpectationsSpec.kt @@ -3,10 +3,8 @@ package ch.tutteli.atrium.specs.integration import ch.tutteli.atrium.api.fluent.en_GB.* import ch.tutteli.atrium.api.verbs.internal.expect import ch.tutteli.atrium.creating.Expect -import ch.tutteli.atrium.reporting.reportables.descriptions.DescriptionDateTimeLikeProof import ch.tutteli.atrium.reporting.reportables.descriptions.DescriptionDateTimeLikeProof.* import ch.tutteli.atrium.specs.* -import ch.tutteli.atrium.translations.DescriptionDateTimeLikeExpectation import org.spekframework.spek2.Spek import org.spekframework.spek2.style.specification.Suite import java.time.DayOfWeek diff --git a/misc/atrium-verbs/src/commonMain/kotlin/ch/tutteli/atrium/api.verbs/expect.kt b/misc/atrium-verbs/src/commonMain/kotlin/ch/tutteli/atrium/api.verbs/expect.kt index c0c9d8218e..0adefca899 100644 --- a/misc/atrium-verbs/src/commonMain/kotlin/ch/tutteli/atrium/api.verbs/expect.kt +++ b/misc/atrium-verbs/src/commonMain/kotlin/ch/tutteli/atrium/api.verbs/expect.kt @@ -2,18 +2,19 @@ package ch.tutteli.atrium.api.verbs import ch.tutteli.atrium._core import ch.tutteli.atrium._coreAppend -import ch.tutteli.atrium.api.verbs.factory.DefaultExpectationVerbs import ch.tutteli.atrium.api.verbs.ExpectationVerb.EXPECT +import ch.tutteli.atrium.api.verbs.factory.DefaultExpectationVerbs import ch.tutteli.atrium.core.ExperimentalNewExpectTypes import ch.tutteli.atrium.creating.* -import ch.tutteli.atrium.creating.toExpectGrouping -import ch.tutteli.atrium.logic.* +import ch.tutteli.atrium.logic._logic import ch.tutteli.atrium.logic.creating.RootExpectBuilder +import ch.tutteli.atrium.logic.grouping +import ch.tutteli.atrium.logic.manualFeature +import ch.tutteli.atrium.logic.toAssertionCreator import ch.tutteli.atrium.reporting.Text import ch.tutteli.atrium.testfactories.TestFactory import ch.tutteli.atrium.testfactories.TestFactoryBuilder import ch.tutteli.atrium.testfactories.testFactoryTemplate - import ch.tutteli.atrium.api.verbs.expect as atriumVerb /** diff --git a/translations/atrium-translations-en_GB/src/commonMain/kotlin/ch/tutteli/atrium/translations/DescriptionMapLikeExpectation.kt b/translations/atrium-translations-en_GB/src/commonMain/kotlin/ch/tutteli/atrium/translations/DescriptionMapLikeExpectation.kt index b2425f9f28..5322094136 100644 --- a/translations/atrium-translations-en_GB/src/commonMain/kotlin/ch/tutteli/atrium/translations/DescriptionMapLikeExpectation.kt +++ b/translations/atrium-translations-en_GB/src/commonMain/kotlin/ch/tutteli/atrium/translations/DescriptionMapLikeExpectation.kt @@ -9,34 +9,78 @@ import ch.tutteli.atrium.reporting.translating.StringBasedTranslatable /** * Contains the [DescriptiveAssertion.description]s of the assertion functions which are applicable to [Map]. */ +@Deprecated( + "Switch to DescriptionMapLikeProof from core, will be removed with 2.0.0 at the latest", + ReplaceWith("ch.tutteli.atrium.reporting.reportables.descriptions.DescriptionMapLikeProof") +) enum class DescriptionMapLikeExpectation(override val value: String) : StringBasedTranslatable { + @Deprecated( + "will be removed with 2.0.0 at the latest", + ReplaceWith("ch.tutteli.atrium.reporting.reportables.descriptions.DescriptionMapLikeProof.TO_CONTAIN") + ) /** @since 0.18.0 */ TO_CONTAIN("to contain"), + @Deprecated( + "will be removed with 2.0.0 at the latest", + ReplaceWith("ch.tutteli.atrium.reporting.reportables.descriptions.DescriptionMapLikeProof.TO_CONTAIN_KEY") + ) /** @since 0.18.0 */ TO_CONTAIN_KEY("to contain key"), + @Deprecated( + "will be removed with 2.0.0 at the latest", + ReplaceWith("ch.tutteli.atrium.reporting.reportables.descriptions.DescriptionMapLikeProof.NOT_TO_CONTAIN_KEY") + ) /** @since 0.18.0 */ NOT_TO_CONTAIN_KEY("not to contain key"), + @Deprecated( + "will be removed with 2.0.0 at the latest", + ReplaceWith("ch.tutteli.atrium.reporting.reportables.descriptions.DescriptionMapLikeProof.ENTRY_WITH_KEY") + ) /** @since 0.18.0 */ ENTRY_WITH_KEY("entry %s"), + @Deprecated( + "will be removed with 2.0.0 at the latest", + ReplaceWith("ch.tutteli.atrium.reporting.reportables.descriptions.DescriptionMapLikeProof.IN_ANY_ORDER") + ) /** @since 0.18.0 */ IN_ANY_ORDER("%s, in any order"), + @Deprecated( + "will be removed with 2.0.0 at the latest", + ReplaceWith("ch.tutteli.atrium.reporting.reportables.descriptions.DescriptionMapLikeProof.IN_ANY_ORDER_ONLY") + ) /** @since 0.18.0 */ IN_ANY_ORDER_ONLY("%s only, in any order"), + @Deprecated( + "will be removed with 2.0.0 at the latest", + ReplaceWith("ch.tutteli.atrium.reporting.reportables.descriptions.DescriptionMapLikeProof.IN_ORDER") + ) /** @since 0.18.0 */ IN_ORDER("%, in order"), + @Deprecated( + "will be removed with 2.0.0 at the latest", + ReplaceWith("ch.tutteli.atrium.reporting.reportables.descriptions.DescriptionMapLikeProof.IN_ORDER_ONLY") + ) /** @since 0.18.0 */ IN_ORDER_ONLY("%s only, in order"), + @Deprecated( + "will be removed with 2.0.0 at the latest", + ReplaceWith("ch.tutteli.atrium.reporting.reportables.descriptions.DescriptionMapLikeProof.KEY_DOES_NOT_EXIST") + ) /** @since 0.18.0 */ KEY_DOES_NOT_EXIST("❗❗ key does not exist"), + @Deprecated( + "will be removed with 2.0.0 at the latest", + ReplaceWith("ch.tutteli.atrium.reporting.reportables.descriptions.DescriptionMapLikeProof.WARNING_ADDITIONAL_ENTRIES") + ) /** @since 0.18.0 */ WARNING_ADDITIONAL_ENTRIES("additional entries detected"), }