test-check

frankitox 2017-08-14T15:21:23.050189Z

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.

frankitox 2017-08-14T15:22:40.098219Z

com.gfredericks.test.chuck.generators/string-from-regex can only be used in the JVM scope, right?

2017-08-14T15:23:43.137957Z

@franquito yes -- you'll see a pull request for a clojurescript port; I can't remember if it's usable or not

2017-08-14T15:23:51.143166Z

if you end up trying it out, do leave feedback on that PR about how it goes

2017-08-14T15:24:06.152818Z

I've been meaning to review that PR for months now 😭

frankitox 2017-08-14T15:25:15.196748Z

Oh, nice!

frankitox 2017-08-14T15:26:19.238225Z

Well, then I'll give it a try and see what happens, I just need a simple regexp

frankitox 2017-08-14T15:27:09.269925Z

Haha I see! Yeah, It must be a huge pain to maintain some open source project

❤️ 1
frankitox 2017-08-14T15:27:18.274857Z

Apart from It's size

frankitox 2017-08-14T15:27:32.284255Z

Its*

lucasbradstreet 2017-08-14T18:47:29.326233Z

@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 🙂

2017-08-14T18:48:38.366385Z

@lucasbradstreet you prevented shrinking because it would spend a long time without getting very far?

lucasbradstreet 2017-08-14T18:50:25.428642Z

Yeah, because testing my invariants was on the order of seconds, so I tried some more aggressive heuristics to reduce the search space.

lucasbradstreet 2017-08-14T18:50:41.438365Z

Maybe not a very typical example that you want to allow for though 😛

2017-08-14T18:53:39.540443Z

I've been in that situation before, I don't want to disregard it

2017-08-14T18:54:23.566319Z

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

2017-08-14T18:54:40.576340Z

but I suppose you could disable the default shrinking first, which you're already doing

lucasbradstreet 2017-08-14T18:54:46.579949Z

Ahhh. I missed that aspect of the word “fallback”

2017-08-14T18:55:09.593505Z

@lucasbradstreet also FYI with a mild amount of assuming-implementation-details, you can do this already

2017-08-14T18:56:17.632986Z

so if you want to try it out that would be informative for me

lucasbradstreet 2017-08-14T18:58:34.714635Z

Can you point me to where I should look?

2017-08-14T18:58:50.723418Z

@lucasbradstreet are you familiar with the idea of a shrink tree?

lucasbradstreet 2017-08-14T18:58:59.728966Z

At a high level yes.

2017-08-14T19:00:20.778044Z

the simpler thing is writing replace-shrink, that takes [g f] where f is a function from x to [x]

lucasbradstreet 2017-08-14T19:00:27.782724Z

Can’t say I’ve looked into exactly how rose trees work though.

2017-08-14T19:00:55.799379Z

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

2017-08-14T19:01:06.806039Z

and it's lazy because it's huge

lucasbradstreet 2017-08-14T19:01:08.806937Z

OK

2017-08-14T19:01:39.826330Z

so writing replace-shrink just involves figuring out the exact functions to call, and the algorithm that transforms x and f into a lazy tree

lucasbradstreet 2017-08-14T19:02:37.860319Z

OK, with you up to here.

2017-08-14T19:02:55.870860Z

I'll spit something out real quick that will probably work

lucasbradstreet 2017-08-14T19:04:33.927036Z

Cool. I can set aside some time later today to give it some testing

2017-08-14T19:04:57.940742Z

⇑ just off the top of my head, I didn't run it or compile it or parse it or anything

lucasbradstreet 2017-08-14T19:05:09.947035Z

Sure thing :)

2017-08-14T19:05:21.953807Z

but that should at least point you to the right functions, which would be the hard part otherwise

2017-08-14T19:05:46.967914Z

feel free to ping me if you try it and can't get it to work

lucasbradstreet 2017-08-14T19:06:06.978867Z

Will do. Thanks!

👍 1