Skip to content

Commit

Permalink
- F getInputs
Browse files Browse the repository at this point in the history
Co-Authored-By: lexler <23501754+lexler@users.noreply.github.com>
  • Loading branch information
isidore and lexler committed Feb 20, 2024
1 parent 44da217 commit 5049452
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package org.approvaltests;

import org.approvaltests.core.Options;
import org.junit.jupiter.api.Test;
import org.lambda.query.Queryable;

public class Parse1InputTest
{
Expand All @@ -23,5 +25,8 @@ void testWithTypesTransformersAndBoth()
ParseInput.from(expected).withTypes(Integer.class).verifyAll(Integer::toBinaryString);
ParseInput.from(expected).transformTo(Integer::parseInt).verifyAll(Integer::toBinaryString);
ParseInput.from(expected).withTypes(String.class).transformTo(Integer::parseInt).verifyAll(Integer::toBinaryString);
// the hard way
Queryable<Integer> inputs = ParseInput.from(expected).withTypes(Integer.class).getInputs();
Approvals.verifyAll(inputs, i -> i + " -> " + Integer.toBinaryString(i), new Options().inline(expected));
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package org.approvaltests;

import org.lambda.functions.Function1;
import org.lambda.query.Queryable;

public class ParseInputWith1Parameters<OUT>
{
Expand All @@ -24,4 +25,8 @@ public void verifyAll(Function1<OUT, Object> transform)
{
ParseInput.from(expected, transformer).verifyAll(transform);
}

public Queryable<OUT> getInputs() {
return ParseInput.from(expected, transformer).parse().select(t -> t.getSecond());
}
}

0 comments on commit 5049452

Please sign in to comment.