Skip to content
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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Draw a grid and test it #4

wants to merge 3 commits into from

Conversation

lindboe
Copy link
Owner

@lindboe lindboe commented Jul 13, 2018

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.

lindboe and others added 2 commits July 13, 2018 14:42
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>
@lindboe
Copy link
Owner Author

lindboe commented Jul 13, 2018

@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.

Copy link
Collaborator

@PastelMobileSuit PastelMobileSuit left a 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 :shipit:

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`.
Copy link
Collaborator

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants