Files
Alexey Kudravtsev e9ba43b999 cleanup: notnull
GitOrigin-RevId: b9f0a6733f75532e5a854d17ac7dbcf087319dd2
2024-01-30 20:17:42 +00:00

37 lines
1.6 KiB
Java

// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.codeInsight.highlighting;
import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.testFramework.FileBasedTestCaseHelper;
import com.intellij.testFramework.LightPlatformCodeInsightTestCase;
import com.intellij.testFramework.TestDataPath;
import com.intellij.testFramework.UsefulTestCase;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.junit.Test;
import org.junit.runner.RunWith;
@RunWith(com.intellij.testFramework.Parameterized.class)
@TestDataPath("/testData/../../../platform/lang-impl/testData/editor/braceHighlighterBlock/")
public class BraceHighlightingHandlerBlockCaretTest extends LightPlatformCodeInsightTestCase implements FileBasedTestCaseHelper {
@Test
public void testAction() {
configureByFile(myFileSuffix);
Editor editor = getEditor();
editor.getSettings().setBlockCursor(true);
String result = BraceHighlightingHandlerTest.getEditorTextWithHighlightedBraces(getEditor(), getFile());
UsefulTestCase.assertSameLinesWithFile(getAnswerFilePath(), result);
}
@Nullable
@Override
public String getFileSuffix(@NotNull String fileName) {
return StringUtil.endsWith(fileName, ".txt") ? null : fileName;
}
@Override
public @Nullable String getBaseName(@NotNull String fileAfterSuffix) {
return StringUtil.endsWith(fileAfterSuffix, ".txt") ? fileAfterSuffix.substring(0, fileAfterSuffix.length() - 4) : null;
}
}