@@ -145,11 +145,11 @@ func conformXCUITestClassName(name string, rdc bool) string {
145145// "am instrument -e class" filter only accepts real class identifiers.
146146func getFailedEspressoTests (testCases []junit.TestCase ) []string {
147147 classes := map [string ]bool {}
148- var skippedClassnames [] string
148+ skipped := map [ string ] struct {}{}
149149 for _ , tc := range testCases {
150150 if tc .Error != nil || tc .Failure != nil {
151151 if ! isJavaClassName (tc .ClassName ) {
152- skippedClassnames = append ( skippedClassnames , tc .ClassName )
152+ skipped [ tc .ClassName ] = struct {}{}
153153 continue
154154 }
155155 if tc .Name != "" {
@@ -159,10 +159,10 @@ func getFailedEspressoTests(testCases []junit.TestCase) []string {
159159 }
160160 }
161161 }
162- if len (skippedClassnames ) > 0 {
162+ if len (skipped ) > 0 {
163163 log .Warn ().
164- Int ("skipped" , len (skippedClassnames )).
165- Strs ("classnames" , skippedClassnames ).
164+ Int ("skipped" , len (skipped )).
165+ Strs ("classnames" , maps . Keys ( skipped ) ).
166166 Msg (msg .SmartRetryUnsupportedClassnames )
167167 }
168168 return maps .Keys (classes )
@@ -188,6 +188,11 @@ func isJavaClassName(name string) bool {
188188
189189// isJavaIdentifier returns true if s is a valid Java identifier segment
190190// (e.g. "com", "example", "MyTest", "MyTest$Inner").
191+ //
192+ // Intentionally ASCII-only. The JLS permits Unicode letters in identifiers,
193+ // but real-world Android test classes are ASCII; restricting to ASCII keeps
194+ // the check simple and avoids accepting names that the instrumentation class
195+ // filter would still fail to match.
191196func isJavaIdentifier (s string ) bool {
192197 if len (s ) == 0 {
193198 return false
0 commit comments