Package com.google.common.escape.testing
Class EscaperAsserts
- java.lang.Object
-
- com.google.common.escape.testing.EscaperAsserts
-
@Beta @GwtCompatible public final class EscaperAsserts extends java.lang.Object
Extra assert methods for testing Escaper implementations.- Since:
- 15.0
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
assertBasic(Escaper escaper)
Asserts that an escaper behaves correctly with respect to null inputs.static void
assertEscaping(CharEscaper escaper, java.lang.String expected, char c)
Asserts that an escaper escapes the given character into the expected string.static void
assertEscaping(UnicodeEscaper escaper, java.lang.String expected, int cp)
Asserts that a Unicode escaper escapes the given code point into the expected string.static void
assertUnescaped(CharEscaper escaper, char c)
Asserts that an escaper does not escape the given character.static void
assertUnescaped(UnicodeEscaper escaper, int cp)
Asserts that a Unicode escaper does not escape the given character.static void
assertUnicodeEscaping(UnicodeEscaper escaper, java.lang.String expected, char hi, char lo)
Asserts that a Unicode escaper escapes the given hi/lo surrogate pair into the expected string.
-
-
-
Method Detail
-
assertBasic
public static void assertBasic(Escaper escaper) throws java.io.IOException
Asserts that an escaper behaves correctly with respect to null inputs.- Parameters:
escaper
- the non-null escaper to test- Throws:
java.io.IOException
-
assertEscaping
public static void assertEscaping(CharEscaper escaper, java.lang.String expected, char c)
Asserts that an escaper escapes the given character into the expected string.- Parameters:
escaper
- the non-null escaper to testexpected
- the expected output stringc
- the character to escape
-
assertUnescaped
public static void assertUnescaped(CharEscaper escaper, char c)
Asserts that an escaper does not escape the given character.- Parameters:
escaper
- the non-null escaper to testc
- the character to test
-
assertEscaping
public static void assertEscaping(UnicodeEscaper escaper, java.lang.String expected, int cp)
Asserts that a Unicode escaper escapes the given code point into the expected string.- Parameters:
escaper
- the non-null escaper to testexpected
- the expected output stringcp
- the Unicode code point to escape
-
assertUnescaped
public static void assertUnescaped(UnicodeEscaper escaper, int cp)
Asserts that a Unicode escaper does not escape the given character.- Parameters:
escaper
- the non-null escaper to testcp
- the Unicode code point to test
-
assertUnicodeEscaping
public static void assertUnicodeEscaping(UnicodeEscaper escaper, java.lang.String expected, char hi, char lo)
Asserts that a Unicode escaper escapes the given hi/lo surrogate pair into the expected string.- Parameters:
escaper
- the non-null escaper to testexpected
- the expected output stringhi
- the high surrogate pair characterlo
- the low surrogate pair character
-
-