Skip to content

Commit

Permalink
color unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
jrobinso committed Feb 1, 2021
1 parent d7fe3c8 commit 8349b09
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/test/java/org/broad/igv/ui/color/ColorUtilitiesTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import java.awt.*;

import static junit.framework.Assert.assertEquals;
import static junit.framework.Assert.assertNotNull;

/**
* @author jrobinso
Expand All @@ -41,11 +42,16 @@ public class ColorUtilitiesTest {

@Test
public void testStringToColor() throws Exception {

// Test parsing strings with quotes (common problem with Excel exports)
String quotedString = "\"0,0,255,\"";
Color b = ColorUtilities.stringToColor(quotedString);
assertEquals(Color.blue, b);
}

@Test
public void testHexColorString() throws Exception {
Color grey = new Color(170,170, 170);
Color c = ColorUtilities.stringToColor("#AAAAAA");
assertEquals(grey, c);
}
}

0 comments on commit 8349b09

Please sign in to comment.