import mir.ndslice : iota; import core.exception; // test OK assertShapeEqual(iota(3, 4), iota(3, 4)); assertShapeEqual(iota(0), iota(0)); // test NG static assert(!__traits(compiles, assertShapeEqual(iota(3, 4), iota(3, 4, 5)))); try { assertShapeEqual(iota(3, 4), iota(3, 2)); assert(false); } catch (AssertError) { // OK! }
testing function for shape equality