This repository has been archived by the owner on Jan 3, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 64
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into range-assertions
- Loading branch information
Showing
41 changed files
with
1,063 additions
and
189 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
261 changes: 235 additions & 26 deletions
261
common/src/main/kotlin/org/amshove/kluent/Collections.kt
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 4 additions & 1 deletion
5
common/src/main/kotlin/org/amshove/kluent/internal/Assertions.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 8 additions & 8 deletions
16
common/src/test/kotlin/org/amshove/kluent/basic/ShouldEqualShould.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,45 +1,45 @@ | ||
package org.amshove.kluent.basic | ||
|
||
import org.amshove.kluent.Person | ||
import org.amshove.kluent.shouldEqual | ||
import org.amshove.kluent.shouldBeEqualTo | ||
import kotlin.test.Test | ||
import kotlin.test.assertFails | ||
|
||
class ShouldEqualShould { | ||
@Test | ||
fun passWhenComparingEqualStrings() { | ||
"hello world" shouldEqual "hello world" | ||
"hello world" shouldBeEqualTo "hello world" | ||
} | ||
|
||
@Test | ||
fun returnTheTestedInstance() { | ||
val hello = "hello world" | ||
val returnedInstance = hello shouldEqual "hello world" | ||
hello shouldEqual returnedInstance | ||
val returnedInstance = hello shouldBeEqualTo "hello world" | ||
hello shouldBeEqualTo returnedInstance | ||
} | ||
|
||
@Test | ||
fun failWhenComparingUnequalStrings() { | ||
assertFails { "hello world!" shouldEqual "hello" } | ||
assertFails { "hello world!" shouldBeEqualTo "hello" } | ||
} | ||
|
||
@Test | ||
fun failWhenComparingDifferentTypes() { | ||
assertFails { "hello world" shouldEqual 5 } | ||
assertFails { "hello world" shouldBeEqualTo 5 } | ||
} | ||
|
||
@Test | ||
fun passWhenCheckingTwoDataObjectsWithSameValues() { | ||
val firstObject = Person("Jon", "Doe") | ||
val secondObject = Person("Jon", "Doe") | ||
firstObject shouldEqual secondObject | ||
firstObject shouldBeEqualTo secondObject | ||
} | ||
|
||
@Test | ||
fun failWhenCheckingTwoDataObjectsWithDifferentValues() { | ||
val jane = Person("Jane", "Doe") | ||
val jon = Person("Jon", "Doe") | ||
assertFails { jane shouldEqual jon } | ||
assertFails { jane shouldBeEqualTo jon } | ||
} | ||
|
||
} |
18 changes: 9 additions & 9 deletions
18
common/src/test/kotlin/org/amshove/kluent/basic/ShouldNotEqualShould.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,47 +1,47 @@ | ||
package org.amshove.kluent.basic | ||
|
||
import org.amshove.kluent.Person | ||
import org.amshove.kluent.shouldEqual | ||
import org.amshove.kluent.shouldNotEqual | ||
import org.amshove.kluent.shouldBeEqualTo | ||
import org.amshove.kluent.shouldNotBeEqualTo | ||
import kotlin.test.Test | ||
import kotlin.test.assertFails | ||
|
||
class ShouldNotEqualShould { | ||
@Test | ||
fun passWhenCheckingEqualityOfDifferentStrings() { | ||
"hello world!" shouldNotEqual "hello" | ||
"hello world!" shouldNotBeEqualTo "hello" | ||
} | ||
|
||
@Test | ||
fun failWhenCheckingEqualityOfEqualStrings() { | ||
assertFails { "hello world!" shouldNotEqual "hello world!" } | ||
assertFails { "hello world!" shouldNotBeEqualTo "hello world!" } | ||
} | ||
|
||
@Test | ||
fun passWhenCheckingDifferentTypes() { | ||
"hello world" shouldNotEqual 5 | ||
"hello world" shouldNotBeEqualTo 5 | ||
} | ||
|
||
@Test | ||
fun passWhenCheckingUnequalDataObjects() { | ||
val jane = Person("Jane", "Doe") | ||
val jon = Person("Jon", "Doe") | ||
jane shouldNotEqual jon | ||
jane shouldNotBeEqualTo jon | ||
} | ||
|
||
@Test | ||
fun failWhenCheckingEqualDataObjects() { | ||
val jane1 = Person("Jane", "Doe") | ||
val jane2 = Person("Jane", "Doe") | ||
assertFails { jane1 shouldNotEqual jane2 } | ||
assertFails { jane1 shouldNotBeEqualTo jane2 } | ||
} | ||
|
||
@Test | ||
fun returnTheTestedInstance() { | ||
val jane = Person("Jane", "Doe") | ||
val jon = Person("Jon", "Doe") | ||
val instance = jane shouldNotEqual jon | ||
instance shouldEqual jane | ||
val instance = jane shouldNotBeEqualTo jon | ||
instance shouldBeEqualTo jane | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.