This is an automated email from the ASF dual-hosted git repository.
ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-lang.git
The following commit(s) were added to refs/heads/master by this push:
new 4ef1e3db9 Add BooleanUtilsTest tests.
4ef1e3db9 is described below
commit 4ef1e3db996eeee823440678f7a9d76885083955
Author: Gary Gregory <[email protected]>
AuthorDate: Wed May 4 10:40:10 2022 -0400
Add BooleanUtilsTest tests.
Add testXor_primitive_validInput_1items().
Add testXor_object_validInput_1items().
---
.../org/apache/commons/lang3/BooleanUtilsTest.java | 28 +++++++++++++++++++++-
1 file changed, 27 insertions(+), 1 deletion(-)
diff --git a/src/test/java/org/apache/commons/lang3/BooleanUtilsTest.java
b/src/test/java/org/apache/commons/lang3/BooleanUtilsTest.java
index e4b29c82e..a9d8310c4 100644
--- a/src/test/java/org/apache/commons/lang3/BooleanUtilsTest.java
+++ b/src/test/java/org/apache/commons/lang3/BooleanUtilsTest.java
@@ -807,7 +807,6 @@ public class BooleanUtilsTest {
assertTrue(
BooleanUtils.or(new boolean[] { false, true, true }),
"False result for (false, true, true)");
-
}
@Test
@@ -824,6 +823,20 @@ public class BooleanUtilsTest {
public void testXor_object_nullInput() {
assertThrows(NullPointerException.class, () ->
BooleanUtils.xor((Boolean[]) null));
}
+
+ @Test
+ public void testXor_object_validInput_1items() {
+ assertEquals(
+ true,
+ BooleanUtils.xor(new Boolean[] { Boolean.TRUE
}).booleanValue(),
+ "true");
+
+ assertEquals(
+ false,
+ BooleanUtils.xor(new Boolean[] { Boolean.FALSE
}).booleanValue(),
+ "false");
+ }
+
@Test
public void testXor_object_validInput_2items() {
assertEquals(
@@ -943,6 +956,19 @@ public class BooleanUtilsTest {
assertThrows(NullPointerException.class, () ->
BooleanUtils.xor((boolean[]) null));
}
+ @Test
+ public void testXor_primitive_validInput_1items() {
+ assertEquals(
+ true,
+ BooleanUtils.xor(new boolean[] { true }),
+ "true");
+
+ assertEquals(
+ false,
+ BooleanUtils.xor(new boolean[] { false }),
+ "false");
+ }
+
@Test
public void testXor_primitive_validInput_2items() {
assertEquals(