| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
There was a problem hiding this comment.
Moving forward please create an issue first as per our guidelines.
This code is a good start for creating a test suite for PGraphics thank you!
Sorry, something went wrong.
| public class ShapeTests { | ||
|
|
||
| @Test | ||
| public void testCanvasWidthAfterSetSize() { | ||
| // Create a PGraphics object and set its size | ||
| PGraphics pg = new PGraphics(); |
There was a problem hiding this comment.
This is testing PGraphics please update the class name, and place this in the core/test/processing/core folder
Sorry, something went wrong.
| // Assert that the canvas height is 150 | ||
| assertEquals(150, pg.height); | ||
| } | ||
| } No newline at end of file |
There was a problem hiding this comment.
this test of the pg height can be done in the other test function that tests width.
Sorry, something went wrong.
| pg.beginDraw(); | ||
| pg.rect(10, 10, 100, 50); // draw a rectangle | ||
| pg.endDraw(); | ||
|
|
There was a problem hiding this comment.
this is not necessary since you are testing setSize
Sorry, something went wrong.
|
Hi @catilac ! I've addressed all the review feedback:
Also created an issue as per contributing guidelines: #1488 Please take a look! |
Sorry, something went wrong.
|
Amazing, thank you! It looks good. I'll merge after running build! 🎊 |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Added ShapeTests.java under core/test/processing to verify canvas width and height initialization.
This ensures Processing’s PGraphics behaves as expected when setSize() is called.
Closes #1488