This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
- # aws (1)
- # beginners (52)
- # boot (1)
- # cider (9)
- # clara (4)
- # cljs-dev (40)
- # cljsrn (2)
- # clojure (166)
- # clojure-dusseldorf (1)
- # clojure-italy (38)
- # clojure-spec (13)
- # clojure-uk (32)
- # clojurescript (337)
- # cursive (11)
- # data-science (47)
- # datomic (11)
- # emacs (3)
- # events (1)
- # fulcro (57)
- # hoplon (16)
- # jobs-discuss (1)
- # juxt (11)
- # keechma (21)
- # mount (2)
- # off-topic (44)
- # onyx (9)
- # re-frame (33)
- # reagent (1)
- # ring-swagger (3)
- # specter (2)
- # test-check (37)
- # vim (30)
Hi Frederick! Loved the lib, there's a couple of functions that I've invented too for my project lol, but I think you took a much more clean approach.
com.gfredericks.test.chuck.generators/string-from-regex can only be used in the JVM scope, right?
@franquito yes -- you'll see a pull request for a clojurescript port; I can't remember if it's usable or not
if you end up trying it out, do leave feedback on that PR about how it goes
I've been meaning to review that PR for months now 😭
@gfredericks did the fallback shrinking strategy end up going anywhere? I’ve actually used gen/return to prevent shrinking, and then shrunk manually myself in the past, so this is pretty interesting 🙂
@lucasbradstreet you prevented shrinking because it would spend a long time without getting very far?
Yeah, because testing my invariants was on the order of seconds, so I tried some more aggressive heuristics to reduce the search space.
Maybe not a very typical example that you want to allow for though 😛
I've been in that situation before, I don't want to disregard it
my initial thought is that a fallback shrink would never speed up shrinking since it would only try it after it's tried everything else
but I suppose you could disable the default shrinking first, which you're already doing
Ahhh. I missed that aspect of the word “fallback”
@lucasbradstreet also FYI with a mild amount of assuming-implementation-details, you can do this already
so if you want to try it out that would be informative for me
Can you point me to where I should look?
@lucasbradstreet are you familiar with the idea of a shrink tree?
At a high level yes.
the simpler thing is writing
replace-shrink, that takes
[g f] where
f is a function from
Can’t say I’ve looked into exactly how rose trees work though.
it's just a tree of values; the root is the generated value, and the child of any node are the shrinks from that point
and it's lazy because it's huge
replace-shrink just involves figuring out the exact functions to call, and the algorithm that transforms
f into a lazy tree
OK, with you up to here.
I'll spit something out real quick that will probably work
Cool. I can set aside some time later today to give it some testing
⇑ just off the top of my head, I didn't run it or compile it or parse it or anything
Sure thing :)
but that should at least point you to the right functions, which would be the hard part otherwise
feel free to ping me if you try it and can't get it to work
Will do. Thanks!