mirror of
https://github.com/ralsina/tartrazine.git
synced 2025-06-18 14:13:07 -03:00
Implement getting color code for languages
Signed-off-by: Lauris Bukšis-Haberkorns <lauris@nix.lv>
This commit is contained in:
@ -217,4 +217,13 @@ public class Enry {
|
||||
return toJavaBool(nativeLib.IsVendor(toGoString(path)));
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a color code for given language.
|
||||
*
|
||||
* @param language of the file
|
||||
* @return color code
|
||||
*/
|
||||
public static synchronized String getColor(String language) {
|
||||
return toJavaString(nativeLib.GetColor(toGoString(language)));
|
||||
}
|
||||
}
|
||||
|
@ -161,6 +161,14 @@ public class EnryTest {
|
||||
assertFalse(Enry.isImage("nope.go"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void getColor() {
|
||||
assertEquals(
|
||||
"#00ADD8",
|
||||
Enry.getColor("Go")
|
||||
);
|
||||
}
|
||||
|
||||
void assertGuess(String language, boolean safe, Guess guess) {
|
||||
assertEquals(language, guess.language);
|
||||
assertEquals(safe, guess.safe);
|
||||
|
Reference in New Issue
Block a user