summaryrefslogtreecommitdiff
path: root/json/tests/test/com/intellij/json/JsonRenameTest.java
blob: 76b5eea0043f81135e0ef2efa7ea41b1cf3bbe4e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
package com.intellij.json;

/**
 * @author Mikhail Golubev
 */
public class JsonRenameTest extends JsonTestCase {

  private void doTest(final String newName) {
    myFixture.configureByFile("rename/" + getTestName(false) + ".json");
    myFixture.renameElementAtCaret(newName);
    myFixture.checkResultByFile("rename/" + getTestName(false) + "_after.json");
  }

  public void testPropertyNameRequiresEscaping() {
    doTest("\"/\\\b\f\n\r\t\0\u001B'");
  }

  // Moved from JavaScript

  public void testDuplicateProperties() {
    doTest("aaa2");
  }

  public void testDuplicatePropertiesQuotedName() {
    doTest("\"aaa2\"");
  }

}