-
Notifications
You must be signed in to change notification settings - Fork 361
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
Tests for Collage module #162
Comments
I was wondering, and this is a bit out there as an idea, but, For example, these two should be equivalent: Elm: move (200,200) <|
filled red <|
circle 20 Processingjs: noStroke();
fill(255,0,0);
ellipse(200,200,20,20); In theory we could have unit tests (or properties) where we fabricate equivalent calls and send them to two different canvases (of equal dimensions of course). We then compare the pixels. If we assume that processing is super stable and not buggy (which it probably is after all the time it's been around), then any inconsistencies we get must come from the collage API (assuming the tests are correct). Since this is visual, we can always see the output of the two as an image (and optionally a diff of the two outputs) and see if the output from the tests make sense. (I think in processing the origin is at the top-left and +y is down, so obviously we would have to correct for that) |
Sorry this did not get attention til now! The Not sure if this makes sense. I expect to be focusing on |
I was pondering how to add tests for
Collage
, and came up with the idea of using node-canvas to render a data-url and comparing it to a known url.This would add another test dependency to core, but would add some comfort in making changes to the Native modules.
Perhaps in future it could be combined with a tool to compare the expected DOM output using js-dom or similar and become a general purpose regression testing tool for Elm.
Is this desirable or should we avoid adding extra dependencies to Core?
The text was updated successfully, but these errors were encountered: