Files
ldc/tangotests/arrays2.d
Tomas Lindquist Olsen 33b9d4348c [svn r312] Changed assert codegen to insert an unreachable terminator after the call to the assert function, which currently calls abort().
Changed array comparison runtime support to pass the array typeinfo instead of the element typeinfo. This allows a cleaner and faster implementation.
2008-06-21 21:16:26 +02:00

31 lines
564 B
D

module tangotests.arrays2;
void main()
{
intarrays!(byte)();
intarrays!(ubyte)();
intarrays!(short)();
intarrays!(ushort)();
intarrays!(int)();
intarrays!(uint)();
intarrays!(long)();
intarrays!(ulong)();
}
void intarrays(T)()
{
T[] ia = [cast(T)1,2,3,4];
T[] ib = [cast(T)1,2,3,4];
T[] ic = [cast(T)1,2,3];
T[] id = [cast(T)1,2,3,4,5];
assert(ia == ia);
assert(ia == ib);
assert(ia != ic);
assert(ia != id);
assert(ia > ic);
assert(ia !< ic);
assert(ia < id);
assert(ia !> id);
}