use of com.goide.psi.GoStringLiteral in project go-lang-idea-plugin by go-lang-plugin-org.
the class GoStringLiteralEscaperTest method testDecodeLongUnicodeCharString.
public void testDecodeLongUnicodeCharString() {
PlatformTestUtil.withEncoding(CharsetToolkit.UTF8, () -> {
GoStringLiteral expr = createStringFromText("\\U00008a9e");
assertNotNull(expr);
String a = decodeRange(expr, TextRange.create(1, 11));
assertEquals("語", a);
});
}
use of com.goide.psi.GoStringLiteral in project go-lang-idea-plugin by go-lang-plugin-org.
the class GoStringLiteralEscaperTest method testEscaperDecodeString.
public void testEscaperDecodeString() {
GoStringLiteral expr = createStringFromText("\\nfoo");
assertNotNull(expr);
assertEquals("fo", decodeRange(expr, TextRange.create(3, 5)));
assertEquals("\n", decodeRange(expr, TextRange.create(1, 3)));
}
use of com.goide.psi.GoStringLiteral in project go-lang-idea-plugin by go-lang-plugin-org.
the class GoStringLiteralEscaperTest method testDecodeOctalCharString.
public void testDecodeOctalCharString() {
GoStringLiteral expr = createStringFromText("\\011");
assertNotNull(expr);
String a = decodeRange(expr, TextRange.create(1, 5));
assertEquals("\t", a);
}
use of com.goide.psi.GoStringLiteral in project go-lang-idea-plugin by go-lang-plugin-org.
the class GoStringLiteralEscaperTest method testEscaperDecodeRawString.
public void testEscaperDecodeRawString() {
GoStringLiteral expr = createRawStringFromText("\nfoo");
assertNotNull(expr);
assertEquals("fo", decodeRange(expr, TextRange.create(2, 4)));
assertEquals("\n", decodeRange(expr, TextRange.create(1, 2)));
}
use of com.goide.psi.GoStringLiteral in project go-lang-idea-plugin by go-lang-plugin-org.
the class GoStringLiteralEscaperTest method testDecodeEscapedVerticalTabString.
public void testDecodeEscapedVerticalTabString() {
GoStringLiteral expr = createStringFromText("\\v");
assertNotNull(expr);
String a = decodeRange(expr, TextRange.create(1, 3));
assertEquals("\013", a);
}
Aggregations