MCPcopy Create free account
hub / github.com/davidgiven/fluxengine / test_slice

Function test_slice

tests/bytes.cc:112–127  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

110}
111
112static void test_slice()
113{
114 Bytes b = {1, 2, 3};
115
116 Bytes bs = b.slice(1, 1);
117 assert((bs == Bytes{2}));
118
119 bs = b.slice(1, 2);
120 assert((bs == Bytes{2, 3}));
121
122 bs = b.slice(1, 3);
123 assert((bs == Bytes{2, 3, 0}));
124
125 bs = b.slice(4, 2);
126 assert((bs == Bytes{0, 0}));
127}
128
129static void test_split()
130{

Callers 1

mainFunction · 0.85

Calls 1

sliceMethod · 0.80

Tested by

no test coverage detected