mirror of
https://github.com/revanced/Apktool.git
synced 2025-04-30 06:04:25 +02:00
clean up tab intendation (#3707)
This commit is contained in:
parent
111a95f369
commit
03a7c67082
@ -31,26 +31,26 @@ public class StringBlockWithSurrogatePairInUtf8Test {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void decodeTwoOctets() {
|
public void decodeTwoOctets() {
|
||||||
final String actual0 = new StringBlock(new byte[] { (byte) 0xC2, (byte) 0x80}, true).decodeString(0, 2);
|
final String actual0 = new StringBlock(new byte[] {(byte) 0xC2, (byte) 0x80}, true).decodeString(0, 2);
|
||||||
assertEquals("Incorrect decoding", "\u0080", actual0);
|
assertEquals("Incorrect decoding", "\u0080", actual0);
|
||||||
|
|
||||||
final String actual1 = new StringBlock(new byte[] { (byte) 0xDF, (byte) 0xBF}, true).decodeString(0, 2);
|
final String actual1 = new StringBlock(new byte[] {(byte) 0xDF, (byte) 0xBF}, true).decodeString(0, 2);
|
||||||
assertEquals("Incorrect decoding", "\u07FF", actual1);
|
assertEquals("Incorrect decoding", "\u07FF", actual1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void decodeThreeOctets() {
|
public void decodeThreeOctets() {
|
||||||
final String actual0 = new StringBlock(new byte[] { (byte) 0xE0, (byte) 0xA0, (byte) 0x80}, true).decodeString(0, 3);
|
final String actual0 = new StringBlock(new byte[] {(byte) 0xE0, (byte) 0xA0, (byte) 0x80}, true).decodeString(0, 3);
|
||||||
assertEquals("Incorrect decoding", "\u0800", actual0);
|
assertEquals("Incorrect decoding", "\u0800", actual0);
|
||||||
|
|
||||||
final String actual1 = new StringBlock(new byte[] { (byte) 0xEF, (byte) 0xBF, (byte) 0xBF}, true).decodeString(0, 3);
|
final String actual1 = new StringBlock(new byte[] {(byte) 0xEF, (byte) 0xBF, (byte) 0xBF}, true).decodeString(0, 3);
|
||||||
assertEquals("Incorrect decoding", "\uFFFF", actual1);
|
assertEquals("Incorrect decoding", "\uFFFF", actual1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void decodeSurrogatePair_when_givesAsThreeOctetsFromInvalidRangeOfUtf8() {
|
public void decodeSurrogatePair_when_givesAsThreeOctetsFromInvalidRangeOfUtf8() {
|
||||||
// See: https://github.com/iBotPeaches/Apktool/issues/2299
|
// See: https://github.com/iBotPeaches/Apktool/issues/2299
|
||||||
final String actual = new StringBlock(new byte[] { (byte) 0xED, (byte) 0xA0, (byte) 0xBD, (byte) 0xED, (byte) 0xB4, (byte) 0x86}, true).decodeString(0, 6);
|
final String actual = new StringBlock(new byte[] {(byte) 0xED, (byte) 0xA0, (byte) 0xBD, (byte) 0xED, (byte) 0xB4, (byte) 0x86}, true).decodeString(0, 6);
|
||||||
assertEquals("Incorrect decoding", "\uD83D\uDD06", actual);
|
assertEquals("Incorrect decoding", "\uD83D\uDD06", actual);
|
||||||
|
|
||||||
// See: https://github.com/iBotPeaches/Apktool/issues/2546
|
// See: https://github.com/iBotPeaches/Apktool/issues/2546
|
||||||
@ -74,7 +74,7 @@ public class StringBlockWithSurrogatePairInUtf8Test {
|
|||||||
// \u10FFFF is encoded in UTF-8 as "0xDBFF 0xDFFF" (4-byte encoding),
|
// \u10FFFF is encoded in UTF-8 as "0xDBFF 0xDFFF" (4-byte encoding),
|
||||||
// but when used in Android resources which are encoded in UTF-8, 3-byte encoding is used,
|
// but when used in Android resources which are encoded in UTF-8, 3-byte encoding is used,
|
||||||
// so each of these is encoded as 3-bytes
|
// so each of these is encoded as 3-bytes
|
||||||
final String actual = new StringBlock(new byte[] { (byte) 0xED, (byte) 0xAF, (byte) 0xBF, (byte) 0xED, (byte) 0xBF, (byte) 0xBF}, true).decodeString(0, 6);
|
final String actual = new StringBlock(new byte[] {(byte) 0xED, (byte) 0xAF, (byte) 0xBF, (byte) 0xED, (byte) 0xBF, (byte) 0xBF}, true).decodeString(0, 6);
|
||||||
assertEquals("Incorrect decoding", "\uDBFF\uDFFF", actual);
|
assertEquals("Incorrect decoding", "\uDBFF\uDFFF", actual);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user