Tag unittests at global scope as pure

This commit is contained in:
Per Nordlöw 2014-10-20 22:07:04 +02:00
parent 52379a6b92
commit a7f3f22ccd

View file

@ -1606,7 +1606,7 @@ assert(std.algorithm.equal(rbt[], [5]));
} }
//Verify Example for removeKey. //Verify Example for removeKey.
unittest pure unittest
{ {
auto rbt = redBlackTree!true(0, 1, 1, 1, 4, 5, 7); auto rbt = redBlackTree!true(0, 1, 1, 1, 4, 5, 7);
rbt.removeKey(1, 4, 7); rbt.removeKey(1, 4, 7);
@ -1616,7 +1616,7 @@ unittest
} }
//Tests for removeKey //Tests for removeKey
unittest pure unittest
{ {
{ {
auto rbt = redBlackTree(["hello", "world", "foo", "bar"]); auto rbt = redBlackTree(["hello", "world", "foo", "bar"]);
@ -1645,7 +1645,7 @@ unittest
} }
} }
unittest pure unittest
{ {
void test(T)() void test(T)()
{ {
@ -1697,7 +1697,7 @@ auto redBlackTree(alias less, bool allowDuplicates, E)(E[] elems...)
} }
/// ///
unittest pure unittest
{ {
auto rbt1 = redBlackTree(0, 1, 5, 7); auto rbt1 = redBlackTree(0, 1, 5, 7);
auto rbt2 = redBlackTree!string("hello", "world"); auto rbt2 = redBlackTree!string("hello", "world");
@ -1707,7 +1707,7 @@ unittest
} }
//Combinations not in examples. //Combinations not in examples.
unittest pure unittest
{ {
auto rbt1 = redBlackTree!(true, string)("hello", "hello"); auto rbt1 = redBlackTree!(true, string)("hello", "hello");
auto rbt2 = redBlackTree!((a, b){return a < b;}, double)(5.1, 2.3); auto rbt2 = redBlackTree!((a, b){return a < b;}, double)(5.1, 2.3);
@ -1715,13 +1715,13 @@ unittest
} }
//Range construction. //Range construction.
unittest pure unittest
{ {
auto rbt = new RedBlackTree!(int, "a > b")(iota(5)); auto rbt = new RedBlackTree!(int, "a > b")(iota(5));
assert(equal(rbt[], [4, 3, 2, 1, 0])); assert(equal(rbt[], [4, 3, 2, 1, 0]));
} }
unittest pure unittest
{ {
auto rt1 = redBlackTree(5, 4, 3, 2, 1); auto rt1 = redBlackTree(5, 4, 3, 2, 1);
assert(rt1.length == 5); assert(rt1.length == 5);
@ -1739,9 +1739,3 @@ unittest
assert(rt4.length == 1); assert(rt4.length == 1);
assert(array(rt4[]) == ["hello"]); assert(array(rt4[]) == ["hello"]);
} }
unittest
{
auto create() pure { return new RedBlackTree!(int, "a > b")(iota(5)); }
auto x = create();
}