This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-08-28
Channels
- # aleph (1)
- # announcements (16)
- # bangalore-clj (1)
- # beginners (78)
- # cider (109)
- # clara (3)
- # cljdoc (6)
- # cljsjs (3)
- # clojure (209)
- # clojure-dev (11)
- # clojure-europe (1)
- # clojure-france (9)
- # clojure-italy (13)
- # clojure-nl (3)
- # clojure-spain (2)
- # clojure-spec (19)
- # clojure-uk (50)
- # clojurescript (41)
- # clojutre (2)
- # core-async (45)
- # cursive (2)
- # datomic (14)
- # emacs (6)
- # figwheel-main (1)
- # fulcro (101)
- # graalvm (1)
- # graphql (3)
- # jobs-discuss (3)
- # kaocha (12)
- # leiningen (8)
- # music (4)
- # off-topic (47)
- # parinfer (8)
- # pathom (17)
- # pedestal (53)
- # re-frame (47)
- # reagent (22)
- # reitit (4)
- # shadow-cljs (49)
- # tools-deps (87)
huh? brain fart apparently. this works:
cljs.user=> (clojure.string/replace "/////blah/blah/blaz///" #"\/+" "/")
"/blah/blah/blaz/"
cljs.user=>
when it's in my source file and compiled by figwheel-main I get the following js error:
Uncaught SyntaxError: missing ) after argument list
I noticed that alpha2 supports s/def ing symbols instead of keywords and got really curious about it…then realized that the first version supports the same thing
Really curious about the use case for that though
that's how function specs are registered (s/fdef)
lol duh
thanks
can someone throw at me with an example of a spec for a string that has to be of specic length (within range) and should only allow letters. The catch though: it should not fail generation with Couldn't satisfy such-that predicate
message.
I swear, I used to have those, somehow I’m feeling stupid and can’t make them anymore.
you could use test.chuck's support for making generators from a regex
ah test.chuck. Yeah it has a few nice gems there. But I feel I’m missing something fairly small
my best effort for now is to use with-gen
with gen/such-that
with max-tries
jacked-up to a huge number. But it seems to be slow and still not guaranteed to not to fail to satisfy
@ag Another "vote" for test.chuck here since you can use a (string) regex such as #"[a-zA-Z]{1,32}"
for example, for pure alpha strings up to 32 chars in length and test.chuck provides a generator that works out of the box. We use it to generate email addresses and a bunch of other stuff.