public ArrayRun GrowBitArraySegment(int bitSegmentIndex, int additionalBytes)
        {
            // all the data has been moved already
            // just return a new ArrayRun with the desired change.
            var content    = ElementContent.ToList();
            var oldSegment = (ArrayRunBitArraySegment)content[bitSegmentIndex];

            content[bitSegmentIndex] = new ArrayRunBitArraySegment(oldSegment.Name, oldSegment.Length + additionalBytes, oldSegment.SourceArrayName);
            return(new ArrayRun(owner, FormatString, LengthFromAnchor, Start, ElementCount, content, PointerSources, PointerSourcesForInnerElements));
        }
        public void ElementWithSpace_CopyBitFlags_ResultHasQuotes()
        {
            Model.SetList("list", new[] { "noSpaces", "with spaces" });
            Model[0] = 2;
            var segment = new ArrayRunBitArraySegment("name", 1, "list");

            var text = segment.ToText(Model, 0, false);

            Assert.Equal("- \"with spaces\" /", text);
        }