<commit_before>package org.jetbrains.plugins.ideavim.action;

import org.jetbrains.plugins.ideavim.VimTestCase;

import static com.maddyhome.idea.vim.helper.StringHelper.parseKeys;


/**
 * @author abrookins
 */
public class ShiftRightLinesActionTest extends VimTestCase {
  // VIM-407
  public void testShiftShiftsOneCharacterSingleLine() {
    myFixture.configureByText("a.txt", "<caret>w\n");
    typeText(parseKeys(">>"));
    myFixture.checkResult("    w\n");
  }

  // VIM-407
  public void testShiftShiftsOneCharacterMultiLine() {
    myFixture.configureByText("a.txt", "Hello\n<caret>w\nWorld");
    typeText(parseKeys(">>"));
    myFixture.checkResult("Hello\n    w\nWorld");
  }

  public void testShiftShiftsMultipleCharactersOneLine() {
    myFixture.configureByText("a.txt", "<caret>Hello, world!\n");
    typeText(parseKeys(">>"));
    myFixture.checkResult("    Hello, world!\n");
  }

  public void testShiftShiftsMultipleCharactersMultipleLines() {
    myFixture.configureByText("a.txt", "<caret>Hello,\nworld!\n");
    typeText(parseKeys("j>>"));
    myFixture.checkResult("Hello,\n    world!\n");
  }

  public void testShiftsSingleLineSelection() {
    myFixture.configureByText("a.txt", "<caret>Hello,\nworld!\n");
    typeText(parseKeys("jv$>>"));
    myFixture.checkResult("Hello,\n    world!\n");
  }

  public void testShiftsMultiLineSelection() {
    myFixture.configureByText("a.txt", "<caret>Hello,\nworld!\n");
    typeText(parseKeys("vj$>>"));
    myFixture.checkResult("    Hello,\n    world!\n");
  }

  public void testShiftsMultiLineSelectionSkipsNewline() {
    myFixture.configureByText("a.txt", "<caret>Hello,\nworld!\n\n");
    typeText(parseKeys("vG$>>"));
    myFixture.checkResult("    Hello,\n    world!\n\n");
  }

  public void testShiftsMultiLineSelectionSkipsNewlineWhenCursorNotInFirstColumn() {
    myFixture.configureByText("a.txt", "<caret>Hello,\n\nworld!\n");
    typeText(parseKeys("lVG>"));
    myFixture.checkResult("    Hello,\n\n    world!\n");
  }

  public void testShiftsMultiLineSelectionAddsTrailingWhitespaceIfTherePreviouslyWas() {
    myFixture.configureByText("a.txt", "<caret>Hello,\n    \nworld!\n");
    typeText(parseKeys("lVG>"));
    myFixture.checkResult("    Hello,\n        \n    world!\n");
  }

  // VIM-705 repeating a multiline indent would only affect last line
  public void testShiftsMultiLineSelectionRepeat() {
    myFixture.configureByText("a.txt", "<caret>a\nb\n");
    typeText(parseKeys("Vj>."));
    myFixture.checkResult("        a\n        b\n");
  }

  public void testShiftsDontCrashKeyHandler() {
    myFixture.configureByText("a.txt", "\n");
    typeText(parseKeys("<I<>", "<I<>"));
  }
}<commit_msg>Add testcase for '>' in visual block mode<commit_after>package org.jetbrains.plugins.ideavim.action;

import org.jetbrains.plugins.ideavim.VimTestCase;

import static com.maddyhome.idea.vim.helper.StringHelper.parseKeys;


/**
 * @author abrookins
 */
public class ShiftRightLinesActionTest extends VimTestCase {
  // VIM-407
  public void testShiftShiftsOneCharacterSingleLine() {
    myFixture.configureByText("a.txt", "<caret>w\n");
    typeText(parseKeys(">>"));
    myFixture.checkResult("    w\n");
  }

  // VIM-407
  public void testShiftShiftsOneCharacterMultiLine() {
    myFixture.configureByText("a.txt", "Hello\n<caret>w\nWorld");
    typeText(parseKeys(">>"));
    myFixture.checkResult("Hello\n    w\nWorld");
  }

  public void testShiftShiftsMultipleCharactersOneLine() {
    myFixture.configureByText("a.txt", "<caret>Hello, world!\n");
    typeText(parseKeys(">>"));
    myFixture.checkResult("    Hello, world!\n");
  }

  public void testShiftShiftsMultipleCharactersMultipleLines() {
    myFixture.configureByText("a.txt", "<caret>Hello,\nworld!\n");
    typeText(parseKeys("j>>"));
    myFixture.checkResult("Hello,\n    world!\n");
  }

  public void testShiftsSingleLineSelection() {
    myFixture.configureByText("a.txt", "<caret>Hello,\nworld!\n");
    typeText(parseKeys("jv$>>"));
    myFixture.checkResult("Hello,\n    world!\n");
  }

  public void testShiftsMultiLineSelection() {
    myFixture.configureByText("a.txt", "<caret>Hello,\nworld!\n");
    typeText(parseKeys("vj$>>"));
    myFixture.checkResult("    Hello,\n    world!\n");
  }

  public void testShiftsMultiLineSelectionSkipsNewline() {
    myFixture.configureByText("a.txt", "<caret>Hello,\nworld!\n\n");
    typeText(parseKeys("vG$>>"));
    myFixture.checkResult("    Hello,\n    world!\n\n");
  }

  public void testShiftsMultiLineSelectionSkipsNewlineWhenCursorNotInFirstColumn() {
    myFixture.configureByText("a.txt", "<caret>Hello,\n\nworld!\n");
    typeText(parseKeys("lVG>"));
    myFixture.checkResult("    Hello,\n\n    world!\n");
  }

  public void testShiftsMultiLineSelectionAddsTrailingWhitespaceIfTherePreviouslyWas() {
    myFixture.configureByText("a.txt", "<caret>Hello,\n    \nworld!\n");
    typeText(parseKeys("lVG>"));
    myFixture.checkResult("    Hello,\n        \n    world!\n");
  }

  // VIM-705 repeating a multiline indent would only affect last line
  public void testShiftsMultiLineSelectionRepeat() {
    myFixture.configureByText("a.txt", "<caret>a\nb\n");
    typeText(parseKeys("Vj>."));
    myFixture.checkResult("        a\n        b\n");
  }

  public void testShiftsDontCrashKeyHandler() {
    myFixture.configureByText("a.txt", "\n");
    typeText(parseKeys("<I<>", "<I<>"));
  }

  public void testShiftsVisualBlockMode() {
    myFixture.configureByText("a.txt", "foo<caret>foo\nfoobar\nfoobaz\n");
    typeText(parseKeys("<C-V>jjl>"));
    myFixture.checkResult("foo    foo\nfoo    bar\nfoo    baz\n");
  }
}
{'fraction_non_alphanumeric': 0.16681423764830883, 'fraction_numerical': 0.0031875332034708697, 'mean_word_length': 4.258845437616388, 'pattern_counts': {'":': 0, '<': 33, '<?xml version=': 0, '>': 65, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3958294', 'n_tokens_mistral': 1970, 'n_tokens_neox': 1923, 'n_words': 260}