We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents f9dd0f8 + 4fbfeb6 commit 52b6945Copy full SHA for 52b6945
std/experimental/ndslice/selection.d
@@ -96,6 +96,24 @@ template pack(K...)
96
}
97
98
///
99
+@safe @nogc pure nothrow unittest
100
+{
101
+ import std.experimental.ndslice : sliced, Slice, pack;
102
+ import std.range : iota;
103
+
104
+ auto r = (3 * 4 * 5 * 6).iota;
105
+ auto a = r.sliced(3, 4, 5, 6);
106
+ auto b = a.pack!2;
107
108
+ static immutable res1 = [3, 4];
109
+ static immutable res2 = [5, 6];
110
+ assert(b.shape == res1);
111
+ assert(b[0, 0].shape == res2);
112
+ assert(a == b);
113
+ static assert(is(typeof(b) == typeof(a.pack!2)));
114
+ static assert(is(typeof(b) == Slice!(2, Slice!(3, typeof(r)))));
115
+}
116
117
@safe @nogc pure nothrow unittest
118
{
119
import std.experimental.ndslice.slice;
0 commit comments