Skip to content

Commit

Permalink
Use different strings in test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
Bastien Diederichs committed Mar 7, 2023
1 parent 4b8eb2c commit a70a5f9
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,24 +34,24 @@ void testRequireNonNull() {
if ("foo" == null) {
throw new NullPointerException();
}
if (null == "foo") {
if (null == "bar") {
throw new NullPointerException();
}
checkNotNull("foo");
checkArgument("foo" != null);
checkArgument(null != "foo");
checkNotNull("baz");
checkArgument("qux" != null);
checkArgument(null != "quux");
}

void testRequireNonNullWithMessage() {
if ("foo" == null) {
throw new NullPointerException("The string is null");
}
if (null == "foo") {
if (null == "bar") {
throw new NullPointerException("The string is null");
}
checkNotNull("foo", "The string is null");
checkArgument("foo" != null, "The string is null");
checkArgument(null != "foo", "The string is null");
checkNotNull("baz", "The string is null");
checkArgument("qux" != null, "The string is null");
checkArgument(null != "quux", "The string is null");
}

void testCheckPositionIndex() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,18 +30,18 @@ void testCheckElementIndexWithMessage() {

void testRequireNonNull() {
requireNonNull("foo");
requireNonNull("foo");
requireNonNull("foo");
requireNonNull("foo");
requireNonNull("foo");
requireNonNull("bar");
requireNonNull("baz");
requireNonNull("qux");
requireNonNull("quux");
}

void testRequireNonNullWithMessage() {
requireNonNull("foo", "The string is null");
requireNonNull("foo", "The string is null");
requireNonNull("foo", "The string is null");
requireNonNull("foo", "The string is null");
requireNonNull("foo", "The string is null");
requireNonNull("bar", "The string is null");
requireNonNull("baz", "The string is null");
requireNonNull("qux", "The string is null");
requireNonNull("quux", "The string is null");
}

void testCheckPositionIndex() {
Expand Down

0 comments on commit a70a5f9

Please sign in to comment.