Skip to content

Commit

Permalink
Merge pull request #211 from samsonjs/fix/ByteArray-assertion-order
Browse files Browse the repository at this point in the history
Fix order of ByteArray assertion params
  • Loading branch information
MarkusAmshove committed Oct 8, 2022
2 parents 7a0d8f1 + eafe5cf commit 4b2d5f1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion AUTHORS.md
Expand Up @@ -43,4 +43,5 @@
37. Maxim Ivanov: [@drcolombo](https://github.com/drcolombo) ([Contributions](https://github.com/MarkusAmshove/Kluent/commits?author=drcolombo))
38. Piotr Bakalarski: [@piotrb5e3](https://github.com/piotrb5e3) ([Contributions](https://github.com/MarkusAmshove/Kluent/commits?author=piotrb5e3))
39. Priyank Gupta: [@priyaaank](https://github.com/priyaaank) ([Contributions](https://github.com/MarkusAmshove/Kluent/commits?author=priyaaank))
40. Anders Ullnæss: [@andersu](https://github.com/andersu) ([Contributions](https://github.com/MarkusAmshove/Kluent/commits?author=andersu))
40. Sami Samhuri: [@samsonjs](https://github.com/samsonjs) ([Contributions](https://github.com/MarkusAmshove/Kluent/commits?author=samsonjs))
41. Anders Ullnæss: [@andersu](https://github.com/andersu) ([Contributions](https://github.com/MarkusAmshove/Kluent/commits?author=andersu))
4 changes: 2 additions & 2 deletions common/src/main/kotlin/org/amshove/kluent/Collections.kt
Expand Up @@ -294,13 +294,13 @@ infix fun BooleanArray.shouldMatchAllWith(predicate: (Boolean) -> Boolean) =
infix fun ByteArray.shouldEqual(expected: ByteArray) = shouldBeEqualTo(expected)

infix fun ByteArray.shouldBeEqualTo(expected: ByteArray) =
apply { assertArrayEquals(this.toTypedArray(), expected.toTypedArray()) }
apply { assertArrayEquals(expected.toTypedArray(), this.toTypedArray()) }

@Deprecated("Use `shouldNotBeEqualTo`", ReplaceWith("this.shouldNotBeEqualTo(expected)"))
infix fun ByteArray.shouldNotEqual(expected: ByteArray) = shouldNotBeEqualTo(expected)

infix fun ByteArray.shouldNotBeEqualTo(expected: ByteArray) =
apply { assertArrayNotEquals(this.toTypedArray(), expected.toTypedArray()) }
apply { assertArrayNotEquals(expected.toTypedArray(), this.toTypedArray()) }

fun ByteArray.shouldHaveSingleItem() = toList().shouldHaveSingleItem()

Expand Down

0 comments on commit 4b2d5f1

Please sign in to comment.