wow, lvh, this surely is a spree you sent me on
write a test he said. it's going to be fun he said XD
tbh, this code is a bit, um, side effect heavy all over the place
i'm not sure you are going to like my test code much... it's not pretty
haha
OK
sorry π
I mean, Iβll let you get away with it if youβd like to call it quits β itβll be a lot easier to test that code if we get to have dependencies β at least the code around it will have more facilities for testing
@fossifoo: Iβd expect it to be not terribly hard with with-out-str
though?
or are there side effects Iβm forgetting about
most of the stuff is wrapped in a with-out-writer macro that you can't with-redef-fn in a test
so yeah, i had to split my code in two parts. so far, so fine
then you need forms to test with and i thought i'd use the content of the sample.clj
then you need to read that back in as testdata and the functions in source.clj almost do what you want, but not quite
and after all that i discovered that the gather-stats form reads all the source files again during reporting
which is probably not what we want in the long run either, because it effectively prohibits output plugins
i guess i always overengineer a bit too π
the reason we reread the source files is i believe because it was the simplest way to get the formatting right
but hey, what's free time good for, if you aren't properly yakshaving
yeah, now that i look at it, i think it's more of an "interface" abstraction thing
if the whole gather-stats would be in it's own package or such, reports would be "out" only
and running/coverage "in"
but conceptionally i guess that "gather-stats" belongs more to the reporting phase
so mainly, i was a bit confused π
oh ye that doesn't really belong in report.clj i guess.
i forgot that was a thing π
i would propose splitting "coverage.clj" anyway
because it's hard to deal with from the boot task for example
having to construct string parameters and such XD
no argument there, it's not nice
but, yeah, first things first
or at least exctract the body of -main so that parsing options is separate from actually acting on them π
yes
i've got the testing in. resubmitting PR
also submitted a PR for the boot task, even though it's still a bit rough. would be nice if people comment especially if anybody has more than 3 days of boot experience π