Skip to content

Commit acb5ac4

Browse files
authored
Merge pull request #7350 from processing/more-shape-tests
Add more shape visual tests
2 parents 68ae795 + 5b5008e commit acb5ac4

File tree

17 files changed

+76
-0
lines changed

17 files changed

+76
-0
lines changed

test/unit/visual/cases/shapes.js

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,58 @@ visualSuite('Shape drawing', function() {
168168
screenshot();
169169
});
170170

171+
visualTest('Drawing with points', function(p5, screenshot) {
172+
setup(p5);
173+
p5.strokeWeight(5);
174+
p5.beginShape(p5.POINTS);
175+
p5.vertex(10, 10);
176+
p5.vertex(15, 40);
177+
p5.vertex(40, 35);
178+
p5.vertex(25, 15);
179+
p5.vertex(15, 25);
180+
p5.endShape();
181+
screenshot();
182+
});
183+
184+
visualTest('Drawing with lines', function(p5, screenshot) {
185+
setup(p5);
186+
p5.beginShape(p5.LINES);
187+
p5.vertex(10, 10);
188+
p5.vertex(15, 40);
189+
p5.vertex(40, 35);
190+
p5.vertex(25, 15);
191+
p5.endShape();
192+
screenshot();
193+
});
194+
195+
visualTest('Drawing with triangles', function(p5, screenshot) {
196+
setup(p5);
197+
p5.beginShape(p5.TRIANGLES);
198+
p5.vertex(10, 10);
199+
p5.vertex(15, 40);
200+
p5.vertex(40, 35);
201+
p5.vertex(25, 15);
202+
p5.vertex(15, 25);
203+
p5.vertex(10, 10);
204+
p5.endShape();
205+
screenshot();
206+
});
207+
208+
visualTest('Drawing with quads', function(p5, screenshot) {
209+
setup(p5);
210+
p5.beginShape(p5.QUADS);
211+
p5.vertex(10, 10);
212+
p5.vertex(15, 10);
213+
p5.vertex(15, 15);
214+
p5.vertex(10, 15);
215+
p5.vertex(25, 25);
216+
p5.vertex(30, 25);
217+
p5.vertex(30, 30);
218+
p5.vertex(25, 30);
219+
p5.endShape();
220+
screenshot();
221+
});
222+
171223
if (mode === 'WebGL') {
172224
visualTest('3D vertex coordinates', function(p5, screenshot) {
173225
setup(p5);
Loading
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"numScreenshots": 1
3+
}
Loading
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"numScreenshots": 1
3+
}
Loading
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"numScreenshots": 1
3+
}
Loading
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"numScreenshots": 1
3+
}
Loading
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"numScreenshots": 1
3+
}
Loading
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"numScreenshots": 1
3+
}
Loading
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"numScreenshots": 1
3+
}
Loading
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"numScreenshots": 1
3+
}

0 commit comments

Comments
 (0)