コード例 #1
0
        public void Backwards2_ProducesCorrectIcu()
        {
            _collationXml = "<settings backwards=\"on\" /><rules />";
            string icu = LdmlCollationParser.GetIcuRulesFromCollationNode(_collationXml);

            Assert.AreEqual("[backwards 2]", icu);
        }
コード例 #2
0
        public void AlternateNonIgnorableOption_ProducesCorrectIcu()
        {
            XElement collationXml = XElement.Parse("<collation><settings alternate=\"non-ignorable\" /><cr /></collation>");
            string   icu          = LdmlCollationParser.GetIcuRulesFromCollationNode(collationXml);

            Assert.AreEqual("[alternate non-ignorable]", icu);
        }
コード例 #3
0
        public void NoRules_ProducesEmptyString()
        {
            XElement collationXml = XElement.Parse("<collation></collation>");
            string   icu          = LdmlCollationParser.GetIcuRulesFromCollationNode(collationXml);

            Assert.AreEqual(string.Empty, icu);
        }
コード例 #4
0
        public void VariableTop_ProducesCorrectIcu()
        {
            XElement collationXml = XElement.Parse("<collation><settings variableTop=\"u41\" /><cr /></collation>");
            string   icu          = LdmlCollationParser.GetIcuRulesFromCollationNode(collationXml);

            Assert.AreEqual("& A < [variable top]", icu);
        }
コード例 #5
0
        public void Optimize_ProducesCorrectIcu()
        {
            XElement collationXml = XElement.Parse("<collation><optimize>[abc]</optimize><cr /></collation>");
            string   icu          = LdmlCollationParser.GetIcuRulesFromCollationNode(collationXml);

            Assert.AreEqual("[optimize [abc]]", icu);
        }
コード例 #6
0
        public void CaseFirstUpper_ProducesCorrectIcu()
        {
            XElement collationXml = XElement.Parse("<collation><settings caseFirst=\"upper\" /><cr /></collation>");
            string   icu          = LdmlCollationParser.GetIcuRulesFromCollationNode(collationXml);

            Assert.AreEqual("[caseFirst upper]", icu);
        }
コード例 #7
0
        public void HiraganaQOn_ProducesCorrectIcu()
        {
            XElement collationXml = XElement.Parse("<collation><settings hiraganaQuaternary=\"on\" /><cr /></collation>");
            string   icu          = LdmlCollationParser.GetIcuRulesFromCollationNode(collationXml);

            Assert.AreEqual("[hiraganaQ on]", icu);
        }
コード例 #8
0
        public void VariableTop_ProducesCorrectIcu()
        {
            _collationXml = "<settings variableTop=\"u41\" /><rules><reset>A</reset></rules>";
            string icu = LdmlCollationParser.GetIcuRulesFromCollationNode(_collationXml);

            Assert.AreEqual("& A < [variable top]", icu);
        }
コード例 #9
0
        public void SuppressContractions_ProducesCorrectIcu()
        {
            _collationXml = "<suppress_contractions>[abc]</suppress_contractions><rules />";
            string icu = LdmlCollationParser.GetIcuRulesFromCollationNode(_collationXml);

            Assert.AreEqual("[suppress contractions [abc]]", icu);
        }
コード例 #10
0
        public void HiraganaQOn_ProducesCorrectIcu()
        {
            _collationXml = "<settings hiraganaQuaternary=\"on\" /><rules />";
            string icu = LdmlCollationParser.GetIcuRulesFromCollationNode(_collationXml);

            Assert.AreEqual("[hiraganaQ on]", icu);
        }
コード例 #11
0
        public void NumericOn_ProducesCorrectIcu()
        {
            _collationXml = "<settings numeric=\"on\" /><rules />";
            string icu = LdmlCollationParser.GetIcuRulesFromCollationNode(_collationXml);

            Assert.AreEqual("[numeric on]", icu);
        }
コード例 #12
0
        public void CaseFirstUpper_ProducesCorrectIcu()
        {
            _collationXml = "<settings caseFirst=\"upper\" /><rules />";
            string icu = LdmlCollationParser.GetIcuRulesFromCollationNode(_collationXml);

            Assert.AreEqual("[caseFirst upper]", icu);
        }
コード例 #13
0
        public void CaseLevelOff_ProducesCorrectIcu()
        {
            _collationXml = "<settings caseLevel=\"off\" /><rules />";
            string icu = LdmlCollationParser.GetIcuRulesFromCollationNode(_collationXml);

            Assert.AreEqual("[caseLevel off]", icu);
        }
コード例 #14
0
        public void NormalizationOff_ProducesCorrectIcu()
        {
            _collationXml = "<settings normalization=\"off\" /><rules />";
            string icu = LdmlCollationParser.GetIcuRulesFromCollationNode(_collationXml);

            Assert.AreEqual("[normalization off]", icu);
        }
コード例 #15
0
        public void NormalizationOff_ProducesCorrectIcu()
        {
            XElement collationXml = XElement.Parse("<collation><settings normalization=\"off\" /><cr /></collation>");
            string   icu          = LdmlCollationParser.GetIcuRulesFromCollationNode(collationXml);

            Assert.AreEqual("[normalization off]", icu);
        }
コード例 #16
0
        public void Optimize_ProducesCorrectIcu()
        {
            _collationXml = "<optimize>[abc]</optimize><rules />";
            string icu = LdmlCollationParser.GetIcuRulesFromCollationNode(_collationXml);

            Assert.AreEqual("[optimize [abc]]", icu);
        }
コード例 #17
0
        public void CaseLevelOff_ProducesCorrectIcu()
        {
            XElement collationXml = XElement.Parse("<collation><settings caseLevel=\"off\" /><cr /></collation>");
            string   icu          = LdmlCollationParser.GetIcuRulesFromCollationNode(collationXml);

            Assert.AreEqual("[caseLevel off]", icu);
        }
コード例 #18
0
        public void IcuEscapedCharacter_ProducesCorrectEscapeSequence()
        {
            _collationXml = "<rules><reset>\\(</reset></rules>";
            string icu = LdmlCollationParser.GetIcuRulesFromCollationNode(_collationXml);

            Assert.AreEqual("& \\(", icu);
        }
コード例 #19
0
        public void Rules_ProducesCorrectIcu()
        {
            XElement collationXml = XElement.Parse("<collation><cr><![CDATA[& a << b << c]]></cr></collation>");
            string   icu          = LdmlCollationParser.GetIcuRulesFromCollationNode(collationXml);

            Assert.AreEqual("& a << b << c", icu);
        }
コード例 #20
0
        public void IcuUnicodeEscapes_ProducesCorrectSequence()
        {
            _collationXml = "<rules><reset>\\u0062</reset><p>\\U00000061</p></rules>";
            string icu = LdmlCollationParser.GetIcuRulesFromCollationNode(_collationXml);

            Assert.AreEqual("& \\u0062 < \\U00000061", icu);
        }
コード例 #21
0
        public void NumericOn_ProducesCorrectIcu()
        {
            XElement collationXml = XElement.Parse("<collation><settings numeric=\"on\" /><cr /></collation>");
            string   icu          = LdmlCollationParser.GetIcuRulesFromCollationNode(collationXml);

            Assert.AreEqual("[numeric on]", icu);
        }
コード例 #22
0
        public void IcuEscapableSequence_ProducesCorrectSequence()
        {
            _collationXml = "<rules><reset>k .w</reset></rules>";
            string icu = LdmlCollationParser.GetIcuRulesFromCollationNode(_collationXml);

            Assert.AreEqual("& k' .'w", icu);
        }
コード例 #23
0
        public void SuppressContractions_ProducesCorrectIcu()
        {
            XElement collationXml = XElement.Parse("<collation><suppress_contractions>[abc]</suppress_contractions><cr /></collation>");
            string   icu          = LdmlCollationParser.GetIcuRulesFromCollationNode(collationXml);

            Assert.AreEqual("[suppress contractions [abc]]", icu);
        }
コード例 #24
0
        public void IcuSingleQuote_ProducesCorrectSequence()
        {
            _collationXml = "<rules><reset>k'w'</reset></rules>";
            string icu = LdmlCollationParser.GetIcuRulesFromCollationNode(_collationXml);

            Assert.AreEqual("& k''w''", icu);
        }
コード例 #25
0
        public void AlternateShiftedOption_ProducesCorrectIcu()
        {
            XElement collationXml = XElement.Parse("<collation><settings alternate=\"shifted\" /><cr /></collation>");
            string   icu          = LdmlCollationParser.GetIcuRulesFromCollationNode(collationXml);

            Assert.AreEqual("[alternate shifted]", icu);
        }
コード例 #26
0
        public void NoDifference_ProducesCorrectIcu()
        {
            _collationXml = "<rules><reset>a</reset><i>b</i></rules>";
            string icu = LdmlCollationParser.GetIcuRulesFromCollationNode(_collationXml);

            Assert.AreEqual("& a = b", icu);
        }
コード例 #27
0
        public void StrengthIOption_ProducesCorrectIcu()
        {
            XElement collationXml = XElement.Parse("<collation><settings strength=\"identical\" /><cr /></collation>");
            string   icu          = LdmlCollationParser.GetIcuRulesFromCollationNode(collationXml);

            Assert.AreEqual("[strength I]", icu);
        }
コード例 #28
0
        public void PrefixAndExpansion_ProducesCorrectIcu()
        {
            _collationXml = "<rules><reset>a</reset><x><context>b</context><p>c</p><extend>d</extend></x></rules>";
            string icu = LdmlCollationParser.GetIcuRulesFromCollationNode(_collationXml);

            Assert.AreEqual("& a < b | c / d", icu);
        }
コード例 #29
0
        public void Backwards2_ProducesCorrectIcu()
        {
            XElement collationXml = XElement.Parse("<collation><settings backwards=\"on\" /><cr /></collation>");
            string   icu          = LdmlCollationParser.GetIcuRulesFromCollationNode(collationXml);

            Assert.AreEqual("[backwards 2]", icu);
        }
コード例 #30
0
        public void StrengthIOption_ProducesCorrectIcu()
        {
            _collationXml = "<settings strength=\"identical\" /><rules />";
            string icu = LdmlCollationParser.GetIcuRulesFromCollationNode(_collationXml);

            Assert.AreEqual("[strength I]", icu);
        }