Skip to content

Commit

Permalink
Merge pull request #7350 from processing/more-shape-tests
Browse files Browse the repository at this point in the history
Add more shape visual tests
  • Loading branch information
davepagurek authored Nov 2, 2024
2 parents 68ae795 + 5b5008e commit acb5ac4
Show file tree
Hide file tree
Showing 17 changed files with 76 additions and 0 deletions.
52 changes: 52 additions & 0 deletions test/unit/visual/cases/shapes.js
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,58 @@ visualSuite('Shape drawing', function() {
screenshot();
});

visualTest('Drawing with points', function(p5, screenshot) {
setup(p5);
p5.strokeWeight(5);
p5.beginShape(p5.POINTS);
p5.vertex(10, 10);
p5.vertex(15, 40);
p5.vertex(40, 35);
p5.vertex(25, 15);
p5.vertex(15, 25);
p5.endShape();
screenshot();
});

visualTest('Drawing with lines', function(p5, screenshot) {
setup(p5);
p5.beginShape(p5.LINES);
p5.vertex(10, 10);
p5.vertex(15, 40);
p5.vertex(40, 35);
p5.vertex(25, 15);
p5.endShape();
screenshot();
});

visualTest('Drawing with triangles', function(p5, screenshot) {
setup(p5);
p5.beginShape(p5.TRIANGLES);
p5.vertex(10, 10);
p5.vertex(15, 40);
p5.vertex(40, 35);
p5.vertex(25, 15);
p5.vertex(15, 25);
p5.vertex(10, 10);
p5.endShape();
screenshot();
});

visualTest('Drawing with quads', function(p5, screenshot) {
setup(p5);
p5.beginShape(p5.QUADS);
p5.vertex(10, 10);
p5.vertex(15, 10);
p5.vertex(15, 15);
p5.vertex(10, 15);
p5.vertex(25, 25);
p5.vertex(30, 25);
p5.vertex(30, 30);
p5.vertex(25, 30);
p5.endShape();
screenshot();
});

if (mode === 'WebGL') {
visualTest('3D vertex coordinates', function(p5, screenshot) {
setup(p5);
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"numScreenshots": 1
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"numScreenshots": 1
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"numScreenshots": 1
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"numScreenshots": 1
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"numScreenshots": 1
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"numScreenshots": 1
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"numScreenshots": 1
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"numScreenshots": 1
}

0 comments on commit acb5ac4

Please sign in to comment.