You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@jacks-sam1010 Latta, you are is almost there! This is how the method should look:
@Override
public Phi lambda() {
final byte[] array = new Dataized(this.take(Attr.RHO)).take();
final int start = Expect.at(this, "start")
.that(phi -> new Dataized(phi).asNumber())
.otherwise("must be a number")
.must(number -> number % 1 == 0)
.that(Double::intValue)
.otherwise("must be an integer")
.must(integer -> integer >= 0)
.otherwise("must be a positive integer")
.must(integer -> integer < array.length)
.otherwise(String.format("must be lt %d", array.length))
.it();
final int length = Expect.at(this, "len")
.that(phi -> new Dataized(phi).asNumber())
.otherwise("must be a number")
.must(number -> number % 1 == 0)
.that(Double::intValue)
.otherwise("must be an integer")
.must(integer -> integer >= 0)
.otherwise("must be a positive integer")
.must(integer -> start + integer <= array.length)
.otherwise(String.format("must be lte %d minus %d", array.length, start))
.it();
return new Data.ToPhi(
Arrays.copyOfRange(
array,
start, start + length
)
);
}
However, with these changes 12 tests fail. Let's fix them.
I see this:
However, we have all the proper checks there. Why don't they detect incorrect input?
The text was updated successfully, but these errors were encountered: