
smallcheck.generators.StringGen Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of java-smallcheck Show documentation
Show all versions of java-smallcheck Show documentation
An implementation of SmallCheck for Java as a JUnit extension.
The newest version!
package smallcheck.generators;
import java.util.stream.Stream;
/**
*
*/
public class StringGen extends SeriesGen {
private ArrayGen arrayGen = new ArrayGen<>(Character.class, new CharGen());
@Override
public Stream generate(int depth) {
return arrayGen.generate(depth).map(ar -> {
char[] chars = new char[ar.length];
for (int i = 0; i < chars.length; i++) {
chars[i] = ar[i];
}
return new String(chars);
});
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy