public void TestListFinalizedCopy()
        {
            var input = @"-52x^{13+y}_{15-} + (-12.3 *)\frac{-12}{15.2}\int^\sqrt[!\ ]{=(}_0 \theta";
            var list  = LaTeXParserTest.ParseLaTeX(input);

            Assert.ThrowsAny <Xunit.Sdk.XunitException>(() => CheckListContents(list));
            Assert.ThrowsAny <Xunit.Sdk.XunitException>(() => CheckListContents(list.Clone(false)));
            Assert.All(list, a => Assert.Equal(Range.Zero, a.IndexRange));
            var finalized = list.Clone(true);

            CheckListContents(finalized);
            CheckListContents(finalized.Clone(false));
            CheckListContents(finalized.Clone(true));
        public void TestListCopyWithFusedItems()
        {
            var list = LaTeXParserTest.ParseLaTeX("12+x");

            var finalized  = list.Clone(true);
            var fusedCount = finalized.Sum(atom => atom.FusedAtoms?.Count ?? 0);

            Assert.Equal(2, fusedCount);

            var copy           = finalized.Clone(true);
            var fusedCopyCount = copy.Sum(atom => atom.FusedAtoms?.Count ?? 0);

            Assert.Equal(2, fusedCopyCount);
        }
Exemple #3
0
 void TestOuter(string latex, int rangeMax, double ascent, double descent, double width,
                params System.Action <IDisplay <TFont, TGlyph> >[] inspectors) =>
 TestList(rangeMax, ascent, descent, width, 0, 0, LinePosition.Regular, Range.UndefinedInt, inspectors)
     (Typesetter.CreateLine(LaTeXParserTest.ParseLaTeX(latex), _font, _context, LineStyle.Display));
 internal static ListDisplay <TFont, TGlyph> ParseLaTeXToDisplay(string latex) =>
 Typesetter.CreateLine(LaTeXParserTest.ParseLaTeX(latex), _font, _context, LineStyle.Display);