Skip to content

Commit ba43e4d

Browse files
committed
Added test for color appearing in import statement.
1 parent d25f796 commit ba43e4d

File tree

3 files changed

+44
-0
lines changed

3 files changed

+44
-0
lines changed

java/test/processing/mode/java/ParserTests.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -385,4 +385,9 @@ public void testSmoothWithParamStatic() {
385385
expectGood("smoothparamstatic");
386386
}
387387

388+
@Test
389+
public void testColorInImport() {
390+
expectGood("colorimport");
391+
}
392+
388393
}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
import processing.core.*;
2+
import processing.data.*;
3+
import processing.event.*;
4+
import processing.opengl.*;
5+
6+
import java.util.HashMap;
7+
import java.util.ArrayList;
8+
import java.io.File;
9+
import java.io.BufferedReader;
10+
import java.io.PrintWriter;
11+
import java.io.InputStream;
12+
import java.io.OutputStream;
13+
import java.io.IOException;
14+
15+
import test.color;
16+
17+
public class colorimport extends PApplet {
18+
19+
public void setup() {
20+
boolean test = true;
21+
int c1 = color(255, 255, 255);
22+
int c2 = test ? 0xFFA011CD : 0xC0C0C0C0;
23+
noLoop();
24+
}
25+
26+
static public void main(String[] passedArgs) {
27+
String[] appletArgs = new String[] { "color" };
28+
if (passedArgs != null) {
29+
PApplet.main(concat(appletArgs, passedArgs));
30+
} else {
31+
PApplet.main(appletArgs);
32+
}
33+
}
34+
}

java/test/resources/colorimport.pde

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import test.color;
2+
3+
boolean test = true;
4+
color c1 = color(255, 255, 255);
5+
color c2 = test ? #A011CD : #C0C0C0C0;

0 commit comments

Comments
 (0)