mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-08-26 08:45:34 +07:00
take absolute value of a remainder, not a remainder of an absolute value
`Math.abs(INT_MIN) == INT_MIN` as a result, `Math.abs(x) % 10` might return negative value.
This commit is contained in:
+5
@@ -15,6 +15,7 @@
|
||||
*/
|
||||
package com.intellij.codeInsight.daemon;
|
||||
|
||||
import com.intellij.openapi.util.UserDataHolderBase;
|
||||
import com.intellij.testFramework.fixtures.LightCodeInsightFixtureTestCase;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
@@ -76,6 +77,10 @@ public class LightRainbowHighlightingTest extends LightCodeInsightFixtureTestCas
|
||||
"}", true, true);
|
||||
}
|
||||
|
||||
public void testBadStringHashValue() {
|
||||
int color = UsedColors.getOrAddColorIndex(new UserDataHolderBase(), "JHZaWC", 5);
|
||||
assertEquals(3, color);
|
||||
}
|
||||
|
||||
void checkRainbow(@NotNull String code, boolean isRainbowOn, boolean withColor) throws Exception {
|
||||
myFixture.testRainbow(
|
||||
|
||||
Reference in New Issue
Block a user