Fork me on GitHub
#rewrite-clj
<
2020-08-15
>
lread00:08:26

thanks! I’ll update docs!

sogaiu01:08:41

@lee cool 🙂 btw, have you considered (or are you already) doing any round-trip testing (src string -> nodes -> src string) for rewrite-clj*? i applied this idea to a large sample of clojure code recently to help improve a few implementations that handled clojure source. it helped to find some weaknesses / errors as well as appropriately increase my confidence in some of the related (modified) code. i realized that this idea can be seen as related to property-based testing -- the property here being "round-trippability". it's true i didn't generate the source code samples for my recent roundt-trip testing so possibly it's not quite as cool as what test.check does. an additional point of interest for me was that this suggested that a library's ability to retain whitespace and comments is also useful because round-trip testing can be easier. (i suppose if there is a way to normalize the input source and output, one can do "round-trip" testing even without retaining whitespace and comments.)

lread03:08:37

Yes, the idea had occurred to me, @sogaiu. There are some round-trip tests already on small hand-coded forms but I was thinking of drawing from a sample of valid Clojure code from the wild. How did you define your sample?