From 1d358ff5bb59f56ab19aa31d6afcf82c46b7c7bc Mon Sep 17 00:00:00 2001 From: Ryan Mitchell Date: Wed, 6 Mar 2019 15:06:49 -0800 Subject: Fix aapt2 whitespace diffs from aapt(1) CDATA blocks were being processed differently in aapt2 so this change fixes aapt2 to not treat cdata blocks differently and still trime whitespace. Also, aapt did not process escapes when compiling xml files. This change removes over-processing of xml text nodes. All test strings are what aapt(1) would output. Test: aapt2_tests Bug: 124470332 Change-Id: I90ee0c1e5e9208f8a5c60cee93e3ba02712c9b2c --- tools/aapt2/ResourceUtils_test.cpp | 23 ----------------------- 1 file changed, 23 deletions(-) (limited to 'tools/aapt2/ResourceUtils_test.cpp') diff --git a/tools/aapt2/ResourceUtils_test.cpp b/tools/aapt2/ResourceUtils_test.cpp index 9018b0fc372a..3b77135a09eb 100644 --- a/tools/aapt2/ResourceUtils_test.cpp +++ b/tools/aapt2/ResourceUtils_test.cpp @@ -266,29 +266,6 @@ TEST(ResourceUtilsTest, StringBuilderUnicodeCodes) { TEST(ResourceUtilsTest, StringBuilderPreserveSpaces) { EXPECT_THAT(ResourceUtils::StringBuilder(true /*preserve_spaces*/).AppendText("\"").to_string(), Eq("\"")); - - // Single quotes should be able to be used without escaping them when preserving spaces and the - // spaces should not be trimmed - EXPECT_THAT(ResourceUtils::StringBuilder() - .AppendText(" hey guys ") - .AppendText(" 'this is so cool' ", /* preserve_spaces */ true) - .AppendText(" wow ") - .to_string(), - Eq(" hey guys 'this is so cool' wow ")); - - // Reading a double quote while preserving spaces should not change the quote state - EXPECT_THAT(ResourceUtils::StringBuilder() - .AppendText(" hey guys ") - .AppendText(" \"this is so cool' ", /* preserve_spaces */ true) - .AppendText(" wow ") - .to_string(), - Eq(" hey guys \"this is so cool' wow ")); - EXPECT_THAT(ResourceUtils::StringBuilder() - .AppendText(" hey guys\" ") - .AppendText(" \"this is so cool' ", /* preserve_spaces */ true) - .AppendText(" wow \" ") - .to_string(), - Eq(" hey guys \"this is so cool' wow ")); } } // namespace aapt -- cgit v1.2.3