GithubHelp home page GithubHelp logo

Tests for Collage module about core HOT 2 CLOSED

elm avatar elm commented on May 18, 2024
Tests for Collage module

from core.

Comments (2)

TheSeamau5 avatar TheSeamau5 commented on May 18, 2024

I was wondering, and this is a bit out there as an idea, but, Collage reminds me a lot of Processing.

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)

from core.

evancz avatar evancz commented on May 18, 2024

Sorry this did not get attention til now! The Graphics.* modules now live in evancz/elm-graphics so I am trying to get stuff migrated over there.

Not sure if this makes sense. I expect to be focusing on <canvas> for professional users and "friendly graphics" for learning as separate use cases. Progress will be made when those start happening.

from core.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.