@Test
public void parseAaptOutputWithRange2() throws IOException {

  // Check that when the actual aapt error occurs on a line later than the original error line,
  // the forward search which looks for a value match does not stop on an earlier line that
  // happens to have the same value prefix
  createTempXmlFile();
  writeToFile("<manifest xmlns:android='http://schemas.android.com/apk/res/android'",
              "    android:versionCode='12' android:versionName='2.0' package='com.android.tests.basic'>",
              "  <uses-sdk android:minSdkVersion='16' android:targetSdkVersion='16'/>",
              "  <application android:icon='@drawable/icon' android:label=", "      '@string/app_name2'>");
  String messageText = "No resource found that matches the given name (at 'label' with value " + "'@string/app_name2').";
  String err = sourceFilePath + ":4: error: Error: " + messageText;
  Collection<Message> messages = parser.parseGradleOutput(err);
  assertHasCorrectErrorMessage(messages, messageText, 5, 8);
}