public void UnescapeString() { string str = "\a\big\fool\named\ryo\thanks\vladimyr\\\""; string escapedStr = "\"\\a\\big\\fool\\named\\ryo\\thanks\\vladimyr\\\\\\\"\""; Assert.That(CStringEscapeHelper.Unescape(escapedStr), Is.EqualTo(str)); }
public void UnescapeCpp11StringLiterals() { string str = "foo"; Assert.That(CStringEscapeHelper.Unescape("L\"" + str + "\""), Is.EqualTo(str)); Assert.That(CStringEscapeHelper.Unescape("u\"" + str + "\""), Is.EqualTo(str)); Assert.That(CStringEscapeHelper.Unescape("u8\"" + str + "\""), Is.EqualTo(str)); Assert.That(CStringEscapeHelper.Unescape("U\"" + str + "\""), Is.EqualTo(str)); }
public void UnescapeStringWithTextAndOnlyOneQuote() { Assert.That(CStringEscapeHelper.Unescape("\"str\\n"), Is.Null); Assert.That(CStringEscapeHelper.Unescape("str\\n\""), Is.Null); }
public void UnescapeStringWithOnlyOneQuote() { Assert.That(CStringEscapeHelper.Unescape("\""), Is.Null); }
public void UnescapeStringWithMissingQuotes() { Assert.That(CStringEscapeHelper.Unescape("str\\n"), Is.Null); }
public void UnescapeEmptyString() { Assert.That(CStringEscapeHelper.Unescape(""), Is.Null); }
public void UnescapeNullString() { Assert.That(CStringEscapeHelper.Unescape(null), Is.Null); }
public void UnescapeStringWithBadEscapeSequence() { Assert.That(CStringEscapeHelper.Unescape("\"\\g\""), Is.EqualTo("\\g")); }
public void UnescapeBackslashAtEnd() { Assert.That(CStringEscapeHelper.Unescape("\"str\\\""), Is.EqualTo("str\\")); }