summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorEugen Wissner <belka@caraus.de>2025-08-25 14:32:34 +0200
committerEugen Wissner <belka@caraus.de>2025-08-25 14:32:34 +0200
commit720d259cfc1db61d2deadca8b3e7751182d789b2 (patch)
tree69ffa359aeae76505a959505070bc5d7aeb4f0bd /tests
parent260b1312229c39e6a1a47e5850c7aeb760dccbb2 (diff)
downloadtanya-720d259cfc1db61d2deadca8b3e7751182d789b2.tar.gz
Make isWideString compatible with Phobos isNarrowString
Diffstat (limited to 'tests')
-rw-r--r--tests/tanya/memory/tests/smartref.d1
-rw-r--r--tests/tanya/meta/tests/trait.d91
2 files changed, 1 insertions, 91 deletions
diff --git a/tests/tanya/memory/tests/smartref.d b/tests/tanya/memory/tests/smartref.d
index 63308d8..25d7d8f 100644
--- a/tests/tanya/memory/tests/smartref.d
+++ b/tests/tanya/memory/tests/smartref.d
@@ -3,6 +3,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
module tanya.memory.tests.smartref;
+import std.traits : ReturnType;
import tanya.memory.allocator;
import tanya.memory.smartref;
import tanya.meta.trait;
diff --git a/tests/tanya/meta/tests/trait.d b/tests/tanya/meta/tests/trait.d
deleted file mode 100644
index 3440fa0..0000000
--- a/tests/tanya/meta/tests/trait.d
+++ /dev/null
@@ -1,91 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-module tanya.meta.tests.trait;
-
-import tanya.meta.metafunction;
-import tanya.meta.trait;
-
-// typeof(null) is not a pointer.
-@nogc nothrow pure @safe unittest
-{
- static assert(!isPointer!(typeof(null)));
- static assert(!isPointer!(const shared typeof(null)));
-
- enum typeOfNull : typeof(null)
- {
- null_ = null,
- }
- static assert(!isPointer!typeOfNull);
-}
-
-@nogc nothrow pure @safe unittest
-{
- static struct S
- {
- @property int opCall()
- {
- return 0;
- }
- }
- S s;
- static assert(isCallable!S);
- static assert(isCallable!s);
-}
-
-@nogc nothrow pure @safe unittest
-{
- static assert(is(FunctionTypeOf!(void delegate()) == function));
-
- static void staticFunc()
- {
- }
- auto functionPointer = &staticFunc;
- static assert(is(FunctionTypeOf!staticFunc == function));
- static assert(is(FunctionTypeOf!functionPointer == function));
-
- void func()
- {
- }
- auto dg = &func;
- static assert(is(FunctionTypeOf!func == function));
- static assert(is(FunctionTypeOf!dg == function));
-
- interface I
- {
- @property int prop();
- }
- static assert(is(FunctionTypeOf!(I.prop) == function));
-
- static struct S
- {
- void opCall()
- {
- }
- }
- class C
- {
- static void opCall()
- {
- }
- }
- S s;
-
- static assert(is(FunctionTypeOf!s == function));
- static assert(is(FunctionTypeOf!C == function));
- static assert(is(FunctionTypeOf!S == function));
-}
-
-@nogc nothrow pure @safe unittest
-{
- static struct S2
- {
- @property int opCall()
- {
- return 0;
- }
- }
- S2 s2;
- static assert(is(FunctionTypeOf!S2 == function));
- static assert(is(FunctionTypeOf!s2 == function));
-}