-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draw a grid and test it #4
base: master
Are you sure you want to change the base?
Conversation
Complete function to draw a square grid. Adds several helper functions for taking an initial element and shifting it a certain amount a certain number of times. Co-authored-by: Preben Ingvaldsen <[email protected]>
The grid drawing function involves enough code that it should be its own file. We attempted writing clojurescript tests first, but we can make the grid file compile for just clojure if we pass in window height and width to the function, which we should be doing anyways. But, since setting up the clojurescript tests wasn't quite trivial, this commit exists as a proof of concept showing how to do it if the grid namespace was cljs. I'll be removing the cljs versions after this commit since we don't actually want them, but we may want something like this in the future. The "testing" part of the boot invocation is like a "with-profile test" in lein, although I'm a fan of just constructing a custom task to do that, I have no reason to run the test tasks without adding the test/ directory to source paths. I do wonder if there is a way to get the test runner to ignore src/ files, since they won't contain tests, but I assume removing src/ from source-paths will break things. It's not a big deal right now though, just results in extra output. Co-authored by: lindboe <none>
@PastelMobileSuit would be helpful to have another set of eyes to make sure I didn't mess anything up in the rebasing. This is still a bit unpolished but I thought it'd be good to get it into master since it's been sitting for a bit. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Everything looks good! I just noticed one thing that was missed, but aside from that
README.md
Outdated
To run the clojure tests, run `boot testing test`. (The "testing" part adds the | ||
test/ directory to the source paths.) | ||
|
||
To run clojurescript tests, run `boot testing test-cljs`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like this was missed when the cljs testing stuff was removed
Removing the cljs testing examples because they're not actually needed code, I just left them in the commit history for future reference.
This PR covers adding functions to create line elements to pass to the render function such that a grid is drawn. It also adds tests for those grid functions.