debug scope(failure) writefln("unittest Failure :%s(%s)", __FILE__, __LINE__); debug scope(success) {writefln("Unittest Success :%s(%s)", __FILE__, __LINE__); stdout.flush();} int[][] r1 = [[0, 1, 2, 3], [4, 5, 6], [7, 8], [9], []]; auto c = concat(r1); assert(equal(c, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9])); assert(equal(c.retro(), retro([0, 1, 2, 3, 4, 5, 6, 7, 8, 9]))); // bidir range assert(equal(c.retro.retro, c)); assert(equal(concat(c), c)); auto r2 = [0, 1, 2, 3, 4, 5]; assert(equal(r2.map!"[a, 2]".concat, [0, 2, 1, 2, 2, 2, 3, 2, 4, 2, 5, 2])); assert(equal(r2[0 .. 4].map!(a => repeat(a, a)).concat, [1, 2, 2, 3, 3, 3])); assert(equal(r2[0 .. 3].repeat(2).map!(map!"a + 1").concat, [1, 2, 3, 1, 2, 3])); int[] emp; assert(emp.repeat(15).concat.empty); assert(emp.concat.empty);
concats elements