Skip to content

Commit

Permalink
Support mixed boxed and unboxed primitives in assertEquals()
Browse files Browse the repository at this point in the history
Prior to this commit, the following resulting in a compiler error due to
ambiguity.

    assertEquals(42, Integer.valueOf("42"));

The same holds true for all primitive types other than `boolean`.

This commit addresses this shortcoming by introducing assertEquals()
variants that support mixed boxed and unboxed primitive values.

Issue: #1638
  • Loading branch information
sbrannen committed Oct 20, 2018
1 parent 45a8c8f commit 0ec5a7b
Show file tree
Hide file tree
Showing 3 changed files with 501 additions and 33 deletions.
Expand Up @@ -54,6 +54,9 @@ repository on GitHub.

==== New Features and Improvements

* New `Assertions.assertEquals()` variants that accept mixed boxed and unboxed primitive
values, allowing statements such as `assertEquals(42, Integer.valueOf("42"))` to
compile.
* New `Assertions.assertNotEquals()` variants that accept the following primitive data
types: `char`, `byte`, `short`, `int`, `long`, `float`, and `double`.
* Implicit conversion from hexadecimal and octal string representations to integral types
Expand Down

0 comments on commit 0ec5a7b

Please sign in to comment.