Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix verifier in contain exactly in any order draft (#59) #3976

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/stale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ daysUntilClose: 7
exemptLabels:
- pinned 📌
- security
- blocked 🚫
# Label to use when marking an issue as stale
staleLabel: stale
# Comment to post when marking an issue as stale. Set to `false` to disable
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/release_base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,14 @@ jobs:
- publishKotlinMultiplatformPublicationToDeployRepository
- publishJvmPublicationToDeployRepository
- publishJsPublicationToDeployRepository
- publishWasmJsPublicationToDeployRepository
- publishKotestBomPublicationToDeployRepository
- publishLinuxX64PublicationToDeployRepository
- publishLinuxArm64PublicationToDeployRepository
- publishAndroidNativeX86PublicationToDeployRepository
- publishAndroidNativeX64PublicationToDeployRepository
- publishAndroidNativeArm32PublicationToDeployRepository
- publishAndroidNativeArm64PublicationToDeployRepository
steps:
- name: Checkout the repo
uses: actions/checkout@v4
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/release_watchos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ jobs:
- "publishWatchosArm64PublicationToDeployRepository"
- "publishWatchosX64PublicationToDeployRepository"
- "publishWatchosSimulatorArm64PublicationToDeployRepository"
- "publishWatchosDeviceArm64PublicationToDeployRepository"
steps:
- name: Checkout the repo
uses: actions/checkout@v4
Expand Down
128 changes: 128 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
# Contributor Covenant Code of Conduct

## Our Pledge

We as members, contributors, and leaders pledge to make participation in our
community a harassment-free experience for everyone, regardless of age, body
size, visible or invisible disability, ethnicity, sex characteristics, gender
identity and expression, level of experience, education, socio-economic status,
nationality, personal appearance, race, religion, or sexual identity
and orientation.

We pledge to act and interact in ways that contribute to an open, welcoming,
diverse, inclusive, and healthy community.

## Our Standards

Examples of behavior that contributes to a positive environment for our
community include:

* Demonstrating empathy and kindness toward other people
* Being respectful of differing opinions, viewpoints, and experiences
* Giving and gracefully accepting constructive feedback
* Accepting responsibility and apologizing to those affected by our mistakes,
and learning from the experience
* Focusing on what is best not just for us as individuals, but for the
overall community

Examples of unacceptable behavior include:

* The use of sexualized language or imagery, and sexual attention or
advances of any kind
* Trolling, insulting or derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or email
address, without their explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting

## Enforcement Responsibilities

Community leaders are responsible for clarifying and enforcing our standards of
acceptable behavior and will take appropriate and fair corrective action in
response to any behavior that they deem inappropriate, threatening, offensive,
or harmful.

Community leaders have the right and responsibility to remove, edit, or reject
comments, commits, code, wiki edits, issues, and other contributions that are
not aligned to this Code of Conduct, and will communicate reasons for moderation
decisions when appropriate.

## Scope

This Code of Conduct applies within all community spaces, and also applies when
an individual is officially representing the community in public spaces.
Examples of representing our community include using an official e-mail address,
posting via an official social media account, or acting as an appointed
representative at an online or offline event.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported to the community leaders responsible for enforcement at
sam@sksamuel.com.
All complaints will be reviewed and investigated promptly and fairly.

All community leaders are obligated to respect the privacy and security of the
reporter of any incident.

## Enforcement Guidelines

Community leaders will follow these Community Impact Guidelines in determining
the consequences for any action they deem in violation of this Code of Conduct:

### 1. Correction

**Community Impact**: Use of inappropriate language or other behavior deemed
unprofessional or unwelcome in the community.

**Consequence**: A private, written warning from community leaders, providing
clarity around the nature of the violation and an explanation of why the
behavior was inappropriate. A public apology may be requested.

### 2. Warning

**Community Impact**: A violation through a single incident or series
of actions.

**Consequence**: A warning with consequences for continued behavior. No
interaction with the people involved, including unsolicited interaction with
those enforcing the Code of Conduct, for a specified period of time. This
includes avoiding interactions in community spaces as well as external channels
like social media. Violating these terms may lead to a temporary or
permanent ban.

### 3. Temporary Ban

**Community Impact**: A serious violation of community standards, including
sustained inappropriate behavior.

**Consequence**: A temporary ban from any sort of interaction or public
communication with the community for a specified period of time. No public or
private interaction with the people involved, including unsolicited interaction
with those enforcing the Code of Conduct, is allowed during this period.
Violating these terms may lead to a permanent ban.

### 4. Permanent Ban

**Community Impact**: Demonstrating a pattern of violation of community
standards, including sustained inappropriate behavior, harassment of an
individual, or aggression toward or disparagement of classes of individuals.

**Consequence**: A permanent ban from any sort of public interaction within
the community.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage],
version 2.0, available at
https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.

Community Impact Guidelines were inspired by [Mozilla's code of conduct
enforcement ladder](https://github.com/mozilla/diversity).

[homepage]: https://www.contributor-covenant.org

For answers to common questions about this code of conduct, see the FAQ at
https://www.contributor-covenant.org/faq. Translations are available at
https://www.contributor-covenant.org/translations.
2 changes: 1 addition & 1 deletion buildSrc/src/main/kotlin/Ci.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ object Ci {

// this is the version used for building snapshots
// .buildnumber-snapshot will be appended
private const val snapshotBase = "5.9.0"
private const val snapshotBase = "5.10.0"

private val githubBuildNumber = System.getenv("GITHUB_RUN_NUMBER")

Expand Down
2 changes: 1 addition & 1 deletion documentation/docs/assertions/collections.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Also, see [inspectors](inspectors.md) which are useful ways to test multiple ele
| `collection.shouldContainDuplicates()` | Asserts that the collection contains at least one duplicate element. |
| `collection.shouldContainExactly()` | Assert that a collection contains exactly the given values and nothing else, in order. |
| `collection.shouldContainExactlyInAnyOrder()` | Assert that a collection contains exactly the given values and nothing else, in _any_ order. |
| `collection.shouldContainAllInAnyOrder()` | Assert that a collection contains all the given values and nothing else, in _any_ order. |
| `collection.shouldContainAllInAnyOrder()` | Assert that a collection contains all the given values, in _any_ order. |
| `collection.shouldContainNoNulls()` | Asserts that the collection contains no null elements, or is empty. |
| `collection.shouldContainNull()` | Asserts that the collection contains at least one null element. |
| `collection.shouldContainOnlyNulls()` | Asserts that the collection contains only null elements, or is empty. |
Expand Down
40 changes: 20 additions & 20 deletions documentation/docs/assertions/core.md
Original file line number Diff line number Diff line change
Expand Up @@ -187,26 +187,26 @@ Matchers provided by the `kotest-assertions-core` module.
| `file.shouldBeSymbolicLink()` | Asserts that the file is a symbolic link. |
| `file.shouldHaveParent(name)` | Assert that the file has a parent with the given name |

| Dates ||
|-----------------------------------------------|--------------------------------------------------------- Asserts that the date has the same year as the given date. -----------------|
| `date.shouldHaveSameYearAs(otherDate)` | Asserts that the date has the same year as the given date. |
| `date.shouldHaveSameMonthAs(otherDate)` | Asserts that the date has the same month as the given date. |
| `date.shouldHaveSameDayAs(otherDate)` | Asserts that the date has the same day of the month as the given date. |
| `date.shouldBeBefore(otherDate)` | Asserts that the date is before the given date. |
| `date.shouldBeAfter(otherDate)` | Asserts that the date is after the given date. |
| `date.shouldBeWithin(period, otherDate)` | Asserts that the date is within the period of the given date. |
| `date.shouldBeWithin(duration, otherDate)` | Asserts that the date is within the duration of the given date. |
| `date.shouldBeBetween(firstDate, secondDate)` | Asserts that the date is between firstdate and seconddate. |
| `date.shouldHaveYear(year)` | Asserts that the date have correct year. |
| `date.shouldHaveMonth(month)` | Asserts that the date have correct month. |
| `date.shouldHaveDayOfYear(day)` | Asserts that the date have correct day of year. |
| `date.shouldHaveDayOfMonth(day)` | Asserts that the date have correct day of month. |
| `date.shouldHaveDayOfWeek(day)` | Asserts that the date have correct day of week. |
| `date.shouldHaveHour(hour)` | Asserts that the date have correct hour. |
| `date.shouldHaveMinute(Minute)` | Asserts that the date have correct minute. |
| `date.shouldHaveSecond(second)` | Asserts that the date have correct second. |
| `date.shouldHaveNano(nao)` | Asserts that the date have correct nano second. |
| `date.shouldBe(value plusOrMinus(tolerance))` | Asserts that the date is equal to the given value within a tolerance range of duration. |
| Dates | |
|-----------------------------------------------|-----------------------------------------------------------------------------------------|
| `date.shouldHaveSameYearAs(otherDate)` | Asserts that the date has the same year as the given date. |
| `date.shouldHaveSameMonthAs(otherDate)` | Asserts that the date has the same month as the given date. |
| `date.shouldHaveSameDayAs(otherDate)` | Asserts that the date has the same day of the month as the given date. |
| `date.shouldBeBefore(otherDate)` | Asserts that the date is before the given date. |
| `date.shouldBeAfter(otherDate)` | Asserts that the date is after the given date. |
| `date.shouldBeWithin(period, otherDate)` | Asserts that the date is within the period of the given date. |
| `date.shouldBeWithin(duration, otherDate)` | Asserts that the date is within the duration of the given date. |
| `date.shouldBeBetween(firstDate, secondDate)` | Asserts that the date is between firstdate and seconddate. |
| `date.shouldHaveYear(year)` | Asserts that the date have correct year. |
| `date.shouldHaveMonth(month)` | Asserts that the date have correct month. |
| `date.shouldHaveDayOfYear(day)` | Asserts that the date have correct day of year. |
| `date.shouldHaveDayOfMonth(day)` | Asserts that the date have correct day of month. |
| `date.shouldHaveDayOfWeek(day)` | Asserts that the date have correct day of week. |
| `date.shouldHaveHour(hour)` | Asserts that the date have correct hour. |
| `date.shouldHaveMinute(Minute)` | Asserts that the date have correct minute. |
| `date.shouldHaveSecond(second)` | Asserts that the date have correct second. |
| `date.shouldHaveNano(nao)` | Asserts that the date have correct nano second. |
| `date.shouldBe(value plusOrMinus(tolerance))` | Asserts that the date is equal to the given value within a tolerance range of duration. |

| ZonedDateTime ||
|----------------------------------------------------------------------| ---- |
Expand Down
1 change: 1 addition & 0 deletions documentation/docs/blogs.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ sidebar_label: Blogs and Articles


These blogs and articles can be useful in addition to the official docs to show how people are using Kotest in the wild.
* [Match Temporal Types With Tolerance (2024)](https://github.com/AlexCue987/talking-the-talk/blob/main/kotest/TEMPORAL-INTERVALS.md)
* [Data-Driven Testing with Kotest (2023)](https://www.baeldung.com/kotlin/kotest-data-driven-testing)
* [JUnit 5 vs Kotest. Part 2: Parameterise ‘Em All](https://test-architect.dev/junit-5-vs-kotest-part-2-parameterisation/)
* [JUnit 5 vs Kotest. Part 1: Is it the new way we test?](https://test-architect.dev/junit-5-vs-kotest-part-1/)
Expand Down
1 change: 1 addition & 0 deletions documentation/docs/extensions/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ maintained and hosted by third parties.
| [H2 Database Extension](https://github.com/LeoColman/kotest-extensions-h2) | H2 Database integration with Kotest |
| [Http4k](https://www.http4k.org/guide/reference/kotest/) | Functional toolkit for Kotlin HTTP applications |
| [Kotless](https://github.com/LeoColman/kotest-kotless) | Utilties for kotless and kotest |
| [KotlinFaker](https://serpro69.github.io/kotlin-faker/extensions/kotest-property-extension/) | Kotlin-faker data generation extensions for Kotest Property Testing |
| [KotlinFixture](https://github.com/appmattus/kotlinfixture/blob/main/fixture-kotest/README.adoc) | generate well-defined, but essentially random, input |
| [LogCapture](https://github.com/jsalinaspolo/logcapture) | LogCapture is a testing library for asserting logging messages |
| [Micronaut](https://github.com/micronaut-projects/micronaut-test) | JVM-based, full-stack framework for building modular, easily testable microservice |
Expand Down
14 changes: 9 additions & 5 deletions documentation/docs/extensions/system.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,15 @@ With *System Environment Extension* you can simulate how the System Environment
Kotest provides some extension functions that provides a System Environment in a specific scope:

```kotlin
withEnvironment("FooKey", "BarValue") {
System.getenv("FooKey") shouldBe "BarValue" // System environment overridden!
test("foo") {
withEnvironment("FooKey", "BarValue") {
System.getenv("FooKey") shouldBe "BarValue" // System environment overridden!
}
}
```

:::info
To use `withEnvironment` with JDK17 you need to add `--add-opens=java.base/java.util=ALL-UNNAMED` to the arguments for the JVM that runs the tests.
To use `withEnvironment` with JDK17+ you need to add `--add-opens=java.base/java.util=ALL-UNNAMED` to the arguments for the JVM that runs the tests.

If you run tests with gradle, you can add the following to your `build.gradle.kts`:

Expand All @@ -52,8 +54,10 @@ tasks.withType<Test>().configureEach {
You can also use multiple values in this extension, through a map or list of pairs.

```kotlin
withEnvironment(mapOf("FooKey" to "BarValue", "BarKey" to "FooValue")) {
// Use FooKey and BarKey
test("foo") {
withEnvironment(mapOf("FooKey" to "BarValue", "BarKey" to "FooValue")) {
// Use FooKey and BarKey
}
}
```

Expand Down
4 changes: 2 additions & 2 deletions documentation/docs/extensions/test_containers.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ class QueryDatastoreTest : FunSpec({

:::tip
This extension also supports the `ContainerLifecycleMode` flag to control when the container is started and stopped.
See #lifecycle
See [Lifecycle](#lifecycle)
:::

#### Initializing the Database Container
Expand Down Expand Up @@ -169,7 +169,7 @@ as a general container.

:::tip
This extension also supports the `ContainerLifecycleMode` flag to control when the container is started and stopped.
See #lifecycle
See [Lifecycle](#lifecycle)
:::


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ class QueryDatastoreTest : FunSpec({

:::tip
This extension also supports the `LifecycleMode` flag to control when the container is started and stopped.
See #lifecycle
See [Lifecycle](#lifecycle)
:::

#### Initializing the Database Container
Expand Down Expand Up @@ -169,7 +169,7 @@ as a general container.

:::tip
This extension also supports the `LifecycleMode` flag to control when the container is started and stopped.
See #lifecycle
See [Lifecycle](#lifecycle)
:::


Expand Down