From 720d259cfc1db61d2deadca8b3e7751182d789b2 Mon Sep 17 00:00:00 2001 From: Eugen Wissner Date: Mon, 25 Aug 2025 14:32:34 +0200 Subject: Make isWideString compatible with Phobos isNarrowString --- tests/tanya/memory/tests/smartref.d | 1 + tests/tanya/meta/tests/trait.d | 91 ------------------------------------- 2 files changed, 1 insertion(+), 91 deletions(-) delete mode 100644 tests/tanya/meta/tests/trait.d (limited to 'tests') 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)); -} -- cgit v1.2.3