Fork me on GitHub

i've started using test.check and hypothesis (python testing library) to write some property-based tests. in both cases i'm using python's tree-sitter bindings to access tree-sitter functionality. for test.check / clojure, i've succeeded in doing this via libpython-clj. here's how a generator in test.check is looking for radix numbers: in hypothesis, something comparable might look like: for using hypothesis, here's how putting the bits together can look: one reason to consider hypothesis is that apparently it doesn't have "the bind problem" that test.check has:


note that the generator portions should be usable for other grammars too -- e.g. parcera.


a little bit more for how things look with test.check:


was wondering if there were some approach that would allow avoiding the writing of generators manually and came across this: since parcera used to use instaparse, i took the latest version of that grammar i could find and updated it (not quite the latest, but fwiw: to try with instacheck. unfortunately, instacheck appears to not quite be at the point of handling the instaparse grammar -- i think because of this: (cool project though -- there's even a strangeloop talk by the author that touches a bit on its use for a specific purpose) for the moment it seems the manual writing of generators is what i think i'll pursue.