From a2c92cd79e00ac9b75b3025c5fa74df2f4c81c46 Mon Sep 17 00:00:00 2001 From: jvdb Date: Thu, 23 Feb 2023 16:56:00 +0100 Subject: [PATCH] #360: Fixed some failing tests due to changed signature of the Until constructur. Co-Authored-By: Marja van Aken --- core/src/main/java/io/parsingdata/metal/token/Until.java | 3 ++- core/src/test/java/io/parsingdata/metal/ArgumentsTest.java | 4 ++-- core/src/test/java/io/parsingdata/metal/AutoEqualityTest.java | 2 ++ 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/core/src/main/java/io/parsingdata/metal/token/Until.java b/core/src/main/java/io/parsingdata/metal/token/Until.java index ec643b5a..1294bf0c 100644 --- a/core/src/main/java/io/parsingdata/metal/token/Until.java +++ b/core/src/main/java/io/parsingdata/metal/token/Until.java @@ -146,7 +146,8 @@ public boolean equals(final Object obj) { && Objects.equals(initialSize, ((Until)obj).initialSize) && Objects.equals(stepSize, ((Until)obj).stepSize) && Objects.equals(maxSize, ((Until)obj).maxSize) - && Objects.equals(terminator, ((Until)obj).terminator); + && Objects.equals(terminator, ((Until)obj).terminator) + && Objects.equals(includeTerminator, ((Until)obj).includeTerminator); } @Override diff --git a/core/src/test/java/io/parsingdata/metal/ArgumentsTest.java b/core/src/test/java/io/parsingdata/metal/ArgumentsTest.java index 412d116e..2efd9eb0 100644 --- a/core/src/test/java/io/parsingdata/metal/ArgumentsTest.java +++ b/core/src/test/java/io/parsingdata/metal/ArgumentsTest.java @@ -153,8 +153,8 @@ public static Collection arguments() { { TokenRef.class, new Object[] { null, VALID_NAME, null } }, { TokenRef.class, new Object[] { null, null, null } }, { TokenRef.class, new Object[] { VALID_NAME, EMPTY_NAME, null } }, - { Until.class, new Object[] { null, VALID_VE, VALID_VE, VALID_VE, VALID_T, null }}, - { Until.class, new Object[] { VALID_NAME, VALID_VE, VALID_VE, VALID_VE, null, null }} + { Until.class, new Object[] { null, VALID_VE, VALID_VE, VALID_VE, VALID_T, true, null }}, + { Until.class, new Object[] { VALID_NAME, VALID_VE, VALID_VE, VALID_VE, null, false, null }} }); } diff --git a/core/src/test/java/io/parsingdata/metal/AutoEqualityTest.java b/core/src/test/java/io/parsingdata/metal/AutoEqualityTest.java index f5f974c6..6061490f 100644 --- a/core/src/test/java/io/parsingdata/metal/AutoEqualityTest.java +++ b/core/src/test/java/io/parsingdata/metal/AutoEqualityTest.java @@ -166,6 +166,7 @@ public class AutoEqualityTest { private static final List> BIG_INTEGERS = Arrays.asList(() -> ONE, () -> BigInteger.valueOf(3)); private static final List> PARSE_STATES = Arrays.asList(() -> createFromByteStream(DUMMY_STREAM), () -> createFromByteStream(DUMMY_STREAM, ONE), () -> new ParseState(GRAPH_WITH_REFERENCE, DUMMY_BYTE_STREAM_SOURCE, TEN, new ImmutableList<>(), new ImmutableList<>())); private static final List> IMMUTABLE_LISTS = Arrays.asList(ImmutableList::new, () -> ImmutableList.create("TEST"), () -> ImmutableList.create(1), () -> ImmutableList.create(1).add(2)); + private static final List> BOOLEANS = Arrays.asList(() -> true, () -> false); private static final Map>> mapping = buildMap(); private static Map>> buildMap() { @@ -190,6 +191,7 @@ private static Map>> buildMap() { result.put(BigInteger.class, BIG_INTEGERS); result.put(ParseState.class, PARSE_STATES); result.put(ImmutableList.class, IMMUTABLE_LISTS); + result.put(boolean.class, BOOLEANS); return result; }