Giter Club home page Giter Club logo

Comments (7)

jlink avatar jlink commented on July 20, 2024

withChars with varargs is easy. I'll do that.

Could you define which chars you would consider to belong to whitespace() and punctuation()?

BTW, are you aware that you can easily define your own annotations so that you might not need manual code at all in an example like yours above? Here's the section from the user guide:
http://jqwik.net/user-guide.html#self-made-annotations

from jqwik.

annam002 avatar annam002 commented on July 20, 2024

Cool, looking forward to the varargs functionality. :)
Defining the chars for whitespace could be tricky, since the question is wether to include newlines or not. Other than that I would check which characters are whitespace in Java and use them. For punctuation, I would suggest the usual characters occuring in written language.
Yes, I am aware that I can write my own annotations, but I think that the suggested methods might be beneficial for other users of jqwik.

from jqwik.

jlink avatar jlink commented on July 20, 2024

Implemented withChars(char... chars) in 4c36f1c

Change is available from maven ('https://oss.sonatype.org/content/repositories/snapshots') in version 0.8.15-SNAPSHOT

from jqwik.

jlink avatar jlink commented on July 20, 2024

Implemented StringArbitrary.whitespace() in d96b0a5

Change is available from maven ('https://oss.sonatype.org/content/repositories/snapshots') in version 0.8.15-SNAPSHOT

from jqwik.

jlink avatar jlink commented on July 20, 2024

Punctuation is a different beast since there is no standard way in Java to determine what a punctuation character is (comparable to Character.isWhitespace(char).

Using all unicode chars allowed according to https://en.wikipedia.org/wiki/General_Punctuation would probably generate characters most people wouldn't expect. Writing your own convenience method like

StringArbitrary punctuation(StringArbitrary arbitrary) {
    return arbitrary.withChars('.', ',', ':', ';', '?', '!');
}

seems not too much of a hassle.

Therefore, if you don't bring up a strong argument for implementing it despite the general specification problem, I will close this issue as fixed.

from jqwik.

annam002 avatar annam002 commented on July 20, 2024

Ok. Thanks for the quick reaction!

from jqwik.

jlink avatar jlink commented on July 20, 2024

Fixed. Will be publicly available in release 0.8.15

from jqwik.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.