Replace android.WriteFile rule with android.WriteFileRule
The android.WriteFile rule takes careful escaping to produce the
right contents. Wrap it in an android.WriteFileRule that handles
the escaping.
Test: compare all android.WriteFile outputs
Change-Id: If71a5843af47a37ca61714e1a1ebb32d08536c31
diff --git a/cc/cc_test.go b/cc/cc_test.go
index b803cba..f616cf3 100644
--- a/cc/cc_test.go
+++ b/cc/cc_test.go
@@ -296,8 +296,8 @@
func checkWriteFileOutput(t *testing.T, params android.TestingBuildParams, expected []string) {
t.Helper()
- assertString(t, params.Rule.String(), android.WriteFile.String())
- actual := strings.FieldsFunc(strings.ReplaceAll(params.Args["content"], "\\n", "\n"), func(r rune) bool { return r == '\n' })
+ content := android.ContentFromFileRuleForTests(t, params)
+ actual := strings.FieldsFunc(content, func(r rune) bool { return r == '\n' })
assertArrayString(t, actual, expected)
}