Add tests
cc @ross-spencer, @nouney
How do we test an interactive system like this one? Any thoughts?
A lot of the interactivity is provided by https://github.com/hasit/bolter/blob/master/bolter.go#L133 UpdateLoc() and so, my introductions, the queries are built like so:
GET Prime Bucket >> Secondary Bucket >> Tertiary Bucket
REF: https://github.com/kval-access-language/kval-language-specification/blob/master/README.md
Once a query string has been created, we just call:
kval.Query(...)
To handle the navigation in one go. https://github.com/hasit/bolter/blob/master/bolter.go#L166
So, a test centered around that function is important - I can already see a few ways I should have cleaned it up, but yeah, keeping track of the state as we input invalid values, and use it to navigate jumping to and from buckets would be good.
I'm a bit short of time to write something for it now but I can have a look if this hasn't been taken up in a few weeks.
@ross-spencer
Understood. Another way would be to explicitly write everything to STDOUT and read from there in tests.
I agree that we can clean up the code and gradually bring back some of the old functionalities, i.e. machine friendly output, non-interactive mode. But that is a whole different conversation. I might start an issue with a detailed roadmap of where we could take this going forward.
Also, I will be able to spare either Saturday or Sunday of this week to organize the code following Ben Johnson's Standard Package Layout.