From 484cb13317921c78468dc3f9c16a0fc786b119c0 Mon Sep 17 00:00:00 2001 From: Eugen Wissner Date: Mon, 18 Mar 2019 13:03:52 +0100 Subject: Separate non-documentation tests from the code --- source/tanya/algorithm/iteration.d | 2 +- source/tanya/algorithm/mutation.d | 20 ++++++++++---------- source/tanya/container/entry.d | 2 +- source/tanya/conv.d | 4 ++-- source/tanya/exception.d | 4 ++-- source/tanya/functional.d | 4 ++-- source/tanya/math/mp.d | 2 +- source/tanya/math/nbtheory.d | 2 +- source/tanya/math/package.d | 3 +-- source/tanya/math/random.d | 3 +-- source/tanya/net/ip.d | 2 +- source/tanya/range/adapter.d | 2 +- source/tanya/range/array.d | 24 ++++-------------------- source/tanya/range/primitive.d | 2 +- source/tanya/typecons.d | 2 +- 15 files changed, 30 insertions(+), 48 deletions(-) (limited to 'source') diff --git a/source/tanya/algorithm/iteration.d b/source/tanya/algorithm/iteration.d index fcfb1c0..0cca49f 100644 --- a/source/tanya/algorithm/iteration.d +++ b/source/tanya/algorithm/iteration.d @@ -21,7 +21,7 @@ module tanya.algorithm.iteration; import tanya.algorithm.comparison; -import tanya.memory.lifecycle; +import tanya.memory.lifetime; import tanya.meta.trait; import tanya.meta.transform; import tanya.range; diff --git a/source/tanya/algorithm/mutation.d b/source/tanya/algorithm/mutation.d index ddb2743..fd6a9d6 100644 --- a/source/tanya/algorithm/mutation.d +++ b/source/tanya/algorithm/mutation.d @@ -14,21 +14,21 @@ */ module tanya.algorithm.mutation; +static import tanya.memory.lifetime; static import tanya.memory.op; -static import tanya.memory.lifecycle; import tanya.meta.trait; import tanya.meta.transform; import tanya.range; version (unittest) import tanya.test.stub; -deprecated("Use tanya.memory.lifecycle.swap instead") -alias swap = tanya.memory.lifecycle.swap; +deprecated("Use tanya.memory.lifetime.swap instead") +alias swap = tanya.memory.lifetime.swap; -deprecated("Use tanya.memory.lifecycle.moveEmplace instead") -alias moveEmplace = tanya.memory.lifecycle.moveEmplace; +deprecated("Use tanya.memory.lifetime.moveEmplace instead") +alias moveEmplace = tanya.memory.lifetime.moveEmplace; -deprecated("Use tanya.memory.lifecycle.move instead") -alias move = tanya.memory.lifecycle.move; +deprecated("Use tanya.memory.lifetime.move instead") +alias move = tanya.memory.lifetime.move; /** * Copies the $(D_PARAM source) range into the $(D_PARAM target) range. @@ -231,7 +231,7 @@ if (isInputRange!Range && hasLvalueElements!Range for (; !range.empty; range.popFront()) { ElementType!Range* p = &range.front; - tanya.memory.lifecycle.emplace!(ElementType!Range)(cast(void[]) (p[0 .. 1]), value); + tanya.memory.lifetime.emplace!(ElementType!Range)(cast(void[]) (p[0 .. 1]), value); } } else @@ -314,7 +314,7 @@ if (isInputRange!Range && hasLvalueElements!Range) void destroyAll(Range)(Range range) if (isInputRange!Range && hasLvalueElements!Range) { - tanya.memory.lifecycle.destroyAllImpl!(Range, ElementType!Range)(range); + tanya.memory.lifetime.destroyAllImpl!(Range, ElementType!Range)(range); } /// @@ -363,7 +363,7 @@ if (isForwardRange!Range && hasSwappableElements!Range) while (!front.empty && !next.empty && !sameHead(front, next)) { - tanya.memory.lifecycle.swap(front.front, next.front); + tanya.memory.lifetime.swap(front.front, next.front); front.popFront(); next.popFront(); diff --git a/source/tanya/container/entry.d b/source/tanya/container/entry.d index 408849a..cf4484c 100644 --- a/source/tanya/container/entry.d +++ b/source/tanya/container/entry.d @@ -16,7 +16,7 @@ module tanya.container.entry; import tanya.container.array; import tanya.memory.allocator; -import tanya.memory.lifecycle; +import tanya.memory.lifetime; import tanya.meta.trait; import tanya.meta.transform; import tanya.typecons; diff --git a/source/tanya/conv.d b/source/tanya/conv.d index f602e01..4010cb5 100644 --- a/source/tanya/conv.d +++ b/source/tanya/conv.d @@ -16,8 +16,8 @@ module tanya.conv; import tanya.container.string; import tanya.memory; -deprecated("Use tanya.memory.lifecycle.emplace instead") -public import tanya.memory.lifecycle : emplace; +deprecated("Use tanya.memory.lifetime.emplace instead") +public import tanya.memory.lifetime : emplace; import tanya.meta.trait; import tanya.meta.transform; import tanya.range; diff --git a/source/tanya/exception.d b/source/tanya/exception.d index 49a2d40..b65efd1 100644 --- a/source/tanya/exception.d +++ b/source/tanya/exception.d @@ -10,7 +10,7 @@ * Source: $(LINK2 https://github.com/caraus-ecms/tanya/blob/master/source/tanya/exception.d, * tanya/exception.d) */ -deprecated("Use tanya.memory.lifecycle instead") +deprecated("Use tanya.memory.lifetimeinstead") module tanya.exception; -public import tanya.memory.lifecycle : onOutOfMemoryError, OutOfMemoryError; +public import tanya.memory.lifetime : onOutOfMemoryError, OutOfMemoryError; diff --git a/source/tanya/functional.d b/source/tanya/functional.d index 9a1c3a1..cde1b51 100644 --- a/source/tanya/functional.d +++ b/source/tanya/functional.d @@ -12,7 +12,7 @@ * Source: $(LINK2 https://github.com/caraus-ecms/tanya/blob/master/source/tanya/functional.d, * tanya/functional.d) */ -deprecated("Use tanya.memory.lifecycle instead") +deprecated("Use tanya.memory.lifetime instead") module tanya.functional; -public import tanya.memory.lifecycle : forward; +public import tanya.memory.lifetime : forward; diff --git a/source/tanya/math/mp.d b/source/tanya/math/mp.d index b7eb86b..dc470b7 100644 --- a/source/tanya/math/mp.d +++ b/source/tanya/math/mp.d @@ -5,7 +5,7 @@ /** * Arbitrary precision arithmetic. * - * Copyright: Eugene Wissner 2016-2018. + * Copyright: Eugene Wissner 2016-2019. * License: $(LINK2 https://www.mozilla.org/en-US/MPL/2.0/, * Mozilla Public License, v. 2.0). * Authors: $(LINK2 mailto:info@caraus.de, Eugene Wissner) diff --git a/source/tanya/math/nbtheory.d b/source/tanya/math/nbtheory.d index c20cc67..ec5d6c4 100644 --- a/source/tanya/math/nbtheory.d +++ b/source/tanya/math/nbtheory.d @@ -5,7 +5,7 @@ /** * Number theory. * - * Copyright: Eugene Wissner 2017-2018. + * Copyright: Eugene Wissner 2017-2019. * License: $(LINK2 https://www.mozilla.org/en-US/MPL/2.0/, * Mozilla Public License, v. 2.0). * Authors: $(LINK2 mailto:info@caraus.de, Eugene Wissner) diff --git a/source/tanya/math/package.d b/source/tanya/math/package.d index 0fb2456..0ad9caf 100644 --- a/source/tanya/math/package.d +++ b/source/tanya/math/package.d @@ -12,7 +12,7 @@ * be found in its submodules. $(D_PSYMBOL tanya.math) doesn't import any * submodules publically, they should be imported explicitly. * - * Copyright: Eugene Wissner 2016-2018. + * Copyright: Eugene Wissner 2016-2019. * License: $(LINK2 https://www.mozilla.org/en-US/MPL/2.0/, * Mozilla Public License, v. 2.0). * Authors: $(LINK2 mailto:info@caraus.de, Eugene Wissner) @@ -21,7 +21,6 @@ */ module tanya.math; -import tanya.algorithm.mutation; import tanya.math.mp; import tanya.math.nbtheory; import tanya.meta.trait; diff --git a/source/tanya/math/random.d b/source/tanya/math/random.d index cd66950..d5b840b 100644 --- a/source/tanya/math/random.d +++ b/source/tanya/math/random.d @@ -5,7 +5,7 @@ /** * Random number generator. * - * Copyright: Eugene Wissner 2016-2018. + * Copyright: Eugene Wissner 2016-2019. * License: $(LINK2 https://www.mozilla.org/en-US/MPL/2.0/, * Mozilla Public License, v. 2.0). * Authors: $(LINK2 mailto:info@caraus.de, Eugene Wissner) @@ -14,7 +14,6 @@ */ module tanya.math.random; -import std.digest.sha; import tanya.memory; import tanya.typecons; diff --git a/source/tanya/net/ip.d b/source/tanya/net/ip.d index 2afdfe8..2025f15 100644 --- a/source/tanya/net/ip.d +++ b/source/tanya/net/ip.d @@ -21,7 +21,7 @@ import tanya.container.string; import tanya.conv; import tanya.encoding.ascii; import tanya.format; -import tanya.memory.lifecycle; +import tanya.memory.lifetime; import tanya.meta.trait; import tanya.meta.transform; import tanya.net.iface; diff --git a/source/tanya/range/adapter.d b/source/tanya/range/adapter.d index bc20e10..8ab9808 100644 --- a/source/tanya/range/adapter.d +++ b/source/tanya/range/adapter.d @@ -15,7 +15,7 @@ module tanya.range.adapter; import tanya.algorithm.mutation; -import tanya.memory.lifecycle; +import tanya.memory.lifetime; import tanya.meta.trait; import tanya.range; diff --git a/source/tanya/range/array.d b/source/tanya/range/array.d index 97101b9..98cceca 100644 --- a/source/tanya/range/array.d +++ b/source/tanya/range/array.d @@ -55,11 +55,7 @@ module tanya.range.array; * Precondition: $(D_INLINECODE array.length > 0). */ @property ref inout(T) front(T)(return scope inout(T)[] array) -in -{ - assert(array.length > 0); -} -do +in (array.length > 0) { return array[0]; } @@ -95,11 +91,7 @@ do * Precondition: $(D_INLINECODE array.length > 0). */ @property ref inout(T) back(T)(return scope inout(T)[] array) -in -{ - assert(array.length > 0); -} -do +in (array.length > 0) { return array[$ - 1]; } @@ -134,22 +126,14 @@ do * Precondition: $(D_INLINECODE array.length > 0). */ void popFront(T)(scope ref inout(T)[] array) -in -{ - assert(array.length > 0); -} -do +in (array.length > 0) { array = array[1 .. $]; } /// ditto void popBack(T)(scope ref inout(T)[] array) -in -{ - assert(array.length > 0); -} -do +in (array.length > 0) { array = array[0 .. $ - 1]; } diff --git a/source/tanya/range/primitive.d b/source/tanya/range/primitive.d index 0b192b0..21d3584 100644 --- a/source/tanya/range/primitive.d +++ b/source/tanya/range/primitive.d @@ -15,7 +15,7 @@ module tanya.range.primitive; import tanya.algorithm.comparison; -import tanya.memory.lifecycle; +import tanya.memory.lifetime; import tanya.meta.trait; import tanya.meta.transform; import tanya.range.array; diff --git a/source/tanya/typecons.d b/source/tanya/typecons.d index fa09831..700e2dd 100644 --- a/source/tanya/typecons.d +++ b/source/tanya/typecons.d @@ -18,7 +18,7 @@ module tanya.typecons; import tanya.format; -import tanya.memory.lifecycle; +import tanya.memory.lifetime; import tanya.meta.metafunction; import tanya.meta.trait; version (unittest) import tanya.test.stub; -- cgit v1.2.3