示例#1
0
        public void Load1()
        {
            var x = Span128.Load(span <int>(1, 2, 3, 4, 5, 6, 7, 8));

            Claim.eq(x.BlockCount, 2);
            x.ClaimEqual(Span128.FromParts(1, 2, 3, 4, 5, 6, 7, 8));
        }
示例#2
0
        public void Fill2()
        {
            var blockX = Span128.AllocBlocks <int>(1);

            blockX[0] = 1;
            blockX[1] = 2;
            blockX[2] = 3;
            blockX[3] = 4;

            var blockY = Span128.Load(blockX.Unblock());

            Claim.eq(blockX, blockY);
        }
示例#3
0
        public void BlockSlice()
        {
            var x = Span128.Load(span <int>(1, 2, 3, 4, 5, 6, 7, 8));

            var block0 = x.SliceBlock(0);

            Claim.eq(4, block0.Length);
            block0.ClaimEqual(Span128.Load(span(1, 2, 3, 4)));

            var block2 = x.SliceBlock(1);

            Claim.eq(4, block2.Length);
            block2.ClaimEqual(Span128.FromParts(5, 6, 7, 8));
        }