예제 #1
0
 private void MatchTagHelper1(
     int expected,
     string lhs,
     string rhs,
     i18n.LanguageTag.MatchGrade matchGrade = i18n.LanguageTag.MatchGrade.LanguageMatch)
 {
     Assert.AreEqual(expected, (new i18n.LanguageTag(lhs).Match(new i18n.LanguageTag(rhs), matchGrade)));
     Assert.AreEqual(expected, (new i18n.LanguageTag(rhs).Match(new i18n.LanguageTag(lhs), matchGrade)));
 }
예제 #2
0
 private void MatchTagHelper(
     int expected,
     string lhs,
     string rhs,
     i18n.LanguageTag.MatchGrade matchGrade = i18n.LanguageTag.MatchGrade.LanguageMatch)
 {
     MatchTagHelper1(expected, lhs, rhs, matchGrade);
     // If PrivateUse subtag not present in either tag...append such a subtag equally to both sides
     // and test again. This should have no effect on the result.
     if (-1 == lhs.IndexOf("-x-", StringComparison.OrdinalIgnoreCase) && -1 == rhs.IndexOf("-x-", StringComparison.OrdinalIgnoreCase))
     {
         MatchTagHelper1(expected, lhs + "-x-abcd", rhs + "-x-abcd", matchGrade);
     }
 }