mirror of
https://github.com/dlang/phobos.git
synced 2025-04-28 14:10:30 +03:00
Fix DScanner warnings
This commit is contained in:
parent
fcaf801cd1
commit
d9830b739e
17 changed files with 104 additions and 82 deletions
|
@ -851,6 +851,8 @@ pure @safe unittest
|
||||||
++ctr;
|
++ctr;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
bool opEquals(T)(T o) const { return false; }
|
||||||
|
size_t toHash() const { return 0; }
|
||||||
}
|
}
|
||||||
immutable S[4] a;
|
immutable S[4] a;
|
||||||
immutable S[4] b;
|
immutable S[4] b;
|
||||||
|
@ -869,6 +871,8 @@ nothrow pure @safe unittest
|
||||||
{
|
{
|
||||||
return value - rhs.value;
|
return value - rhs.value;
|
||||||
}
|
}
|
||||||
|
bool opEquals(T)(T o) const { return false; }
|
||||||
|
size_t toHash() const { return 0; }
|
||||||
}
|
}
|
||||||
auto result = cmp([F(1), F(2), F(3)], [F(1), F(2), F(3)]);
|
auto result = cmp([F(1), F(2), F(3)], [F(1), F(2), F(3)]);
|
||||||
assert(result == 0);
|
assert(result == 0);
|
||||||
|
|
|
@ -4689,6 +4689,47 @@ if (isSomeChar!C)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// In same combinations substitute needs to calculate the auto-decoded length
|
||||||
|
// of its needles
|
||||||
|
private template hasDifferentAutodecoding(Range, Needles...)
|
||||||
|
{
|
||||||
|
import std.meta : anySatisfy;
|
||||||
|
/* iff
|
||||||
|
- the needles needs auto-decoding, but the incoming range doesn't (or vice versa)
|
||||||
|
- both (range, needle) need auto-decoding and don't share the same common type
|
||||||
|
*/
|
||||||
|
enum needlesAreNarrow = anySatisfy!(isNarrowString, Needles);
|
||||||
|
enum sourceIsNarrow = isNarrowString!Range;
|
||||||
|
enum hasDifferentAutodecoding = sourceIsNarrow != needlesAreNarrow ||
|
||||||
|
(sourceIsNarrow && needlesAreNarrow &&
|
||||||
|
is(CommonType!(Range, Needles) == void));
|
||||||
|
}
|
||||||
|
|
||||||
|
@safe nothrow @nogc pure unittest
|
||||||
|
{
|
||||||
|
import std.meta : AliasSeq; // used for better clarity
|
||||||
|
|
||||||
|
static assert(!hasDifferentAutodecoding!(string, AliasSeq!(string, string)));
|
||||||
|
static assert(!hasDifferentAutodecoding!(wstring, AliasSeq!(wstring, wstring)));
|
||||||
|
static assert(!hasDifferentAutodecoding!(dstring, AliasSeq!(dstring, dstring)));
|
||||||
|
|
||||||
|
// the needles needs auto-decoding, but the incoming range doesn't (or vice versa)
|
||||||
|
static assert(hasDifferentAutodecoding!(string, AliasSeq!(wstring, wstring)));
|
||||||
|
static assert(hasDifferentAutodecoding!(string, AliasSeq!(dstring, dstring)));
|
||||||
|
static assert(hasDifferentAutodecoding!(wstring, AliasSeq!(string, string)));
|
||||||
|
static assert(hasDifferentAutodecoding!(wstring, AliasSeq!(dstring, dstring)));
|
||||||
|
static assert(hasDifferentAutodecoding!(dstring, AliasSeq!(string, string)));
|
||||||
|
static assert(hasDifferentAutodecoding!(dstring, AliasSeq!(wstring, wstring)));
|
||||||
|
|
||||||
|
// both (range, needle) need auto-decoding and don't share the same common type
|
||||||
|
static foreach (T; AliasSeq!(string, wstring, dstring))
|
||||||
|
{
|
||||||
|
static assert(hasDifferentAutodecoding!(T, AliasSeq!(wstring, string)));
|
||||||
|
static assert(hasDifferentAutodecoding!(T, AliasSeq!(dstring, string)));
|
||||||
|
static assert(hasDifferentAutodecoding!(T, AliasSeq!(wstring, dstring)));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// substitute
|
// substitute
|
||||||
/**
|
/**
|
||||||
Returns a range with all occurrences of `substs` in `r`.
|
Returns a range with all occurrences of `substs` in `r`.
|
||||||
|
@ -4731,14 +4772,16 @@ if (substs.length >= 2 && isExpressions!substs)
|
||||||
// Substitute single range elements with compile-time substitution mappings
|
// Substitute single range elements with compile-time substitution mappings
|
||||||
return value.map!(a => substitute(a));
|
return value.map!(a => substitute(a));
|
||||||
}
|
}
|
||||||
else static if (isInputRange!Value && !is(CommonType!(ElementType!Value, ElementType!(typeof(substs[0]))) == void))
|
else static if (isInputRange!Value &&
|
||||||
|
!is(CommonType!(ElementType!Value, ElementType!(typeof(substs[0]))) == void))
|
||||||
{
|
{
|
||||||
// not implemented yet, fallback to runtime variant for now
|
// not implemented yet, fallback to runtime variant for now
|
||||||
return .substitute(value, substs);
|
return .substitute(value, substs);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
static assert(0, "Compile-time substitutions must be elements or ranges of the same type of ` ~ Value.stringof ~ `.");
|
static assert(0, `Compile-time substitutions must be elements or ranges of the same type of ` ~
|
||||||
|
Value.stringof ~ `.`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Substitute single values with compile-time substitution mappings.
|
// Substitute single values with compile-time substitution mappings.
|
||||||
|
@ -4756,47 +4799,6 @@ if (substs.length >= 2 && isExpressions!substs)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// In same combinations substitute needs to calculate the auto-decoded length
|
|
||||||
// of its needles
|
|
||||||
private template hasDifferentAutodecoding(Range, Needles...)
|
|
||||||
{
|
|
||||||
import std.meta : anySatisfy;
|
|
||||||
/* iff
|
|
||||||
- the needles needs auto-decoding, but the incoming range doesn't (or vice versa)
|
|
||||||
- both (range, needle) need auto-decoding and don't share the same common type
|
|
||||||
*/
|
|
||||||
enum needlesAreNarrow = anySatisfy!(isNarrowString, Needles);
|
|
||||||
enum sourceIsNarrow = isNarrowString!Range;
|
|
||||||
enum hasDifferentAutodecoding = sourceIsNarrow != needlesAreNarrow ||
|
|
||||||
(sourceIsNarrow && needlesAreNarrow &&
|
|
||||||
is(CommonType!(Range, Needles) == void));
|
|
||||||
}
|
|
||||||
|
|
||||||
@safe nothrow @nogc pure unittest
|
|
||||||
{
|
|
||||||
import std.meta : AliasSeq; // used for better clarity
|
|
||||||
|
|
||||||
static assert(!hasDifferentAutodecoding!(string, AliasSeq!(string, string)));
|
|
||||||
static assert(!hasDifferentAutodecoding!(wstring, AliasSeq!(wstring, wstring)));
|
|
||||||
static assert(!hasDifferentAutodecoding!(dstring, AliasSeq!(dstring, dstring)));
|
|
||||||
|
|
||||||
// the needles needs auto-decoding, but the incoming range doesn't (or vice versa)
|
|
||||||
static assert(hasDifferentAutodecoding!(string, AliasSeq!(wstring, wstring)));
|
|
||||||
static assert(hasDifferentAutodecoding!(string, AliasSeq!(dstring, dstring)));
|
|
||||||
static assert(hasDifferentAutodecoding!(wstring, AliasSeq!(string, string)));
|
|
||||||
static assert(hasDifferentAutodecoding!(wstring, AliasSeq!(dstring, dstring)));
|
|
||||||
static assert(hasDifferentAutodecoding!(dstring, AliasSeq!(string, string)));
|
|
||||||
static assert(hasDifferentAutodecoding!(dstring, AliasSeq!(wstring, wstring)));
|
|
||||||
|
|
||||||
// both (range, needle) need auto-decoding and don't share the same common type
|
|
||||||
static foreach (T; AliasSeq!(string, wstring, dstring))
|
|
||||||
{
|
|
||||||
static assert(hasDifferentAutodecoding!(T, AliasSeq!(wstring, string)));
|
|
||||||
static assert(hasDifferentAutodecoding!(T, AliasSeq!(dstring, string)));
|
|
||||||
static assert(hasDifferentAutodecoding!(T, AliasSeq!(wstring, dstring)));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// ditto
|
/// ditto
|
||||||
auto substitute(alias pred = (a, b) => a == b, R, Substs...)(R r, Substs substs)
|
auto substitute(alias pred = (a, b) => a == b, R, Substs...)(R r, Substs substs)
|
||||||
if (isInputRange!R && Substs.length >= 2 && !is(CommonType!(Substs) == void))
|
if (isInputRange!R && Substs.length >= 2 && !is(CommonType!(Substs) == void))
|
||||||
|
|
|
@ -1138,11 +1138,14 @@ if (isBidirectionalRange!R &&
|
||||||
static if (isDefaultPred && isSomeChar!E && E.sizeof <= ElementEncodingType!R.sizeof)
|
static if (isDefaultPred && isSomeChar!E && E.sizeof <= ElementEncodingType!R.sizeof)
|
||||||
return doesThisEnd[$ - 1] == withThis;
|
return doesThisEnd[$ - 1] == withThis;
|
||||||
// specialize for ASCII as to not change previous behavior
|
// specialize for ASCII as to not change previous behavior
|
||||||
else if (withThis <= 0x7F)
|
else
|
||||||
|
{
|
||||||
|
if (withThis <= 0x7F)
|
||||||
return predFunc(doesThisEnd[$ - 1], withThis);
|
return predFunc(doesThisEnd[$ - 1], withThis);
|
||||||
else
|
else
|
||||||
return predFunc(doesThisEnd.back, withThis);
|
return predFunc(doesThisEnd.back, withThis);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return predFunc(doesThisEnd.back, withThis);
|
return predFunc(doesThisEnd.back, withThis);
|
||||||
|
@ -4263,11 +4266,14 @@ if (isInputRange!R &&
|
||||||
static if (isDefaultPred && isSomeChar!E && E.sizeof <= ElementEncodingType!R.sizeof)
|
static if (isDefaultPred && isSomeChar!E && E.sizeof <= ElementEncodingType!R.sizeof)
|
||||||
return doesThisStart[0] == withThis;
|
return doesThisStart[0] == withThis;
|
||||||
// specialize for ASCII as to not change previous behavior
|
// specialize for ASCII as to not change previous behavior
|
||||||
else if (withThis <= 0x7F)
|
else
|
||||||
|
{
|
||||||
|
if (withThis <= 0x7F)
|
||||||
return predFunc(doesThisStart[0], withThis);
|
return predFunc(doesThisStart[0], withThis);
|
||||||
else
|
else
|
||||||
return predFunc(doesThisStart.front, withThis);
|
return predFunc(doesThisStart.front, withThis);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return predFunc(doesThisStart.front, withThis);
|
return predFunc(doesThisStart.front, withThis);
|
||||||
|
|
|
@ -1835,6 +1835,7 @@ unittest
|
||||||
|
|
||||||
enum BigInt test1 = BigInt(123);
|
enum BigInt test1 = BigInt(123);
|
||||||
enum BigInt test2 = plusTwo(test1);
|
enum BigInt test2 = plusTwo(test1);
|
||||||
|
assert(test2 == 125);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -10322,7 +10322,6 @@ if (isSomeString!S)
|
||||||
import std.ascii : isDigit;
|
import std.ascii : isDigit;
|
||||||
import std.conv : to;
|
import std.conv : to;
|
||||||
import std.string : representation;
|
import std.string : representation;
|
||||||
import core.time;
|
|
||||||
|
|
||||||
if (isoString.empty)
|
if (isoString.empty)
|
||||||
return Duration.zero;
|
return Duration.zero;
|
||||||
|
@ -10963,7 +10962,6 @@ version(StdUnittest)
|
||||||
|
|
||||||
void initializeTests() @safe
|
void initializeTests() @safe
|
||||||
{
|
{
|
||||||
import core.time;
|
|
||||||
import std.algorithm.sorting : sort;
|
import std.algorithm.sorting : sort;
|
||||||
import std.typecons : Rebindable;
|
import std.typecons : Rebindable;
|
||||||
immutable lt = LocalTime().utcToTZ(0);
|
immutable lt = LocalTime().utcToTZ(0);
|
||||||
|
|
|
@ -909,7 +909,8 @@ alias SHA512_256 = SHA!(1024, 256); /// SHA alias for SHA-512/256, hash is ubyte
|
||||||
sha256.put(cast(ubyte[])"abcdef");
|
sha256.put(cast(ubyte[])"abcdef");
|
||||||
sha256.start();
|
sha256.start();
|
||||||
sha256.put(cast(ubyte[])"");
|
sha256.put(cast(ubyte[])"");
|
||||||
assert(sha256.finish() == cast(ubyte[]) hexString!"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855");
|
assert(sha256.finish() == cast(ubyte[])
|
||||||
|
hexString!"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855");
|
||||||
|
|
||||||
SHA384 sha384;
|
SHA384 sha384;
|
||||||
sha384.put(cast(ubyte[])"abcdef");
|
sha384.put(cast(ubyte[])"abcdef");
|
||||||
|
@ -922,7 +923,8 @@ alias SHA512_256 = SHA!(1024, 256); /// SHA alias for SHA-512/256, hash is ubyte
|
||||||
sha512.put(cast(ubyte[])"abcdef");
|
sha512.put(cast(ubyte[])"abcdef");
|
||||||
sha512.start();
|
sha512.start();
|
||||||
sha512.put(cast(ubyte[])"");
|
sha512.put(cast(ubyte[])"");
|
||||||
assert(sha512.finish() == cast(ubyte[]) hexString!("cf83e1357eefb8bdf1542850d66d8007d620e4050b571"
|
assert(sha512.finish() == cast(ubyte[])
|
||||||
|
hexString!("cf83e1357eefb8bdf1542850d66d8007d620e4050b571"
|
||||||
~"5dc83f4a921d36ce9ce47d0d13c5d85f2b0ff8318d2877eec2f63b931bd47417a81a538327af927da3e"));
|
~"5dc83f4a921d36ce9ce47d0d13c5d85f2b0ff8318d2877eec2f63b931bd47417a81a538327af927da3e"));
|
||||||
|
|
||||||
SHA512_224 sha512_224;
|
SHA512_224 sha512_224;
|
||||||
|
@ -935,7 +937,8 @@ alias SHA512_256 = SHA!(1024, 256); /// SHA alias for SHA-512/256, hash is ubyte
|
||||||
sha512_256.put(cast(ubyte[])"abcdef");
|
sha512_256.put(cast(ubyte[])"abcdef");
|
||||||
sha512_256.start();
|
sha512_256.start();
|
||||||
sha512_256.put(cast(ubyte[])"");
|
sha512_256.put(cast(ubyte[])"");
|
||||||
assert(sha512_256.finish() == cast(ubyte[]) hexString!"c672b8d1ef56ed28ab87c3622c5114069bdd3ad7b8f9737498d0c01ecef0967a");
|
assert(sha512_256.finish() == cast(ubyte[])
|
||||||
|
hexString!"c672b8d1ef56ed28ab87c3622c5114069bdd3ad7b8f9737498d0c01ecef0967a");
|
||||||
|
|
||||||
digest = sha1Of ("");
|
digest = sha1Of ("");
|
||||||
digest224 = sha224Of ("");
|
digest224 = sha224Of ("");
|
||||||
|
|
|
@ -416,7 +416,7 @@ T enforce(T)(T value, lazy Throwable ex)
|
||||||
}
|
}
|
||||||
|
|
||||||
///
|
///
|
||||||
unittest
|
@system unittest
|
||||||
{
|
{
|
||||||
import core.stdc.stdlib : malloc, free;
|
import core.stdc.stdlib : malloc, free;
|
||||||
import std.conv : ConvException, to;
|
import std.conv : ConvException, to;
|
||||||
|
|
|
@ -531,7 +531,7 @@ nothrow:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
unittest
|
@system unittest
|
||||||
{
|
{
|
||||||
import std.experimental.allocator.building_blocks.region : Region;
|
import std.experimental.allocator.building_blocks.region : Region;
|
||||||
import std.conv : emplace;
|
import std.conv : emplace;
|
||||||
|
@ -553,7 +553,7 @@ unittest
|
||||||
assert((cast(CAllocatorImpl!(Region!(), Yes.indirect))(rcalloc._alloc)).rc == 1);
|
assert((cast(CAllocatorImpl!(Region!(), Yes.indirect))(rcalloc._alloc)).rc == 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
unittest
|
@system unittest
|
||||||
{
|
{
|
||||||
import std.conv;
|
import std.conv;
|
||||||
import std.experimental.allocator.mallocator;
|
import std.experimental.allocator.mallocator;
|
||||||
|
@ -576,7 +576,7 @@ unittest
|
||||||
~ to!string(bytesUsed) ~ " bytes");
|
~ to!string(bytesUsed) ~ " bytes");
|
||||||
}
|
}
|
||||||
|
|
||||||
unittest
|
@safe unittest
|
||||||
{
|
{
|
||||||
import std.conv;
|
import std.conv;
|
||||||
import std.experimental.allocator.mallocator;
|
import std.experimental.allocator.mallocator;
|
||||||
|
@ -2554,7 +2554,7 @@ RCIAllocator allocatorObject(A)(A* pa)
|
||||||
assert(a.deallocate(b));
|
assert(a.deallocate(b));
|
||||||
}
|
}
|
||||||
|
|
||||||
unittest
|
@system unittest
|
||||||
{
|
{
|
||||||
import std.conv;
|
import std.conv;
|
||||||
import std.experimental.allocator.mallocator;
|
import std.experimental.allocator.mallocator;
|
||||||
|
|
|
@ -9,7 +9,7 @@ module std.experimental.scripting;
|
||||||
import std.experimental.scripting;
|
import std.experimental.scripting;
|
||||||
|
|
||||||
int len;
|
int len;
|
||||||
auto r = 6.iota
|
const r = 6.iota
|
||||||
.filter!(a => a % 2) // 0 2 4
|
.filter!(a => a % 2) // 0 2 4
|
||||||
.map!(a => a * 2) // 0 4 8
|
.map!(a => a * 2) // 0 4 8
|
||||||
.tee!(_ => len++)
|
.tee!(_ => len++)
|
||||||
|
|
|
@ -4047,7 +4047,7 @@ if ((is(T == struct) || is(T == union)) && (hasToString!(T, Char) || !is(Builtin
|
||||||
assert(w.data == "S()");
|
assert(w.data == "S()");
|
||||||
}
|
}
|
||||||
|
|
||||||
unittest
|
@safe unittest
|
||||||
{
|
{
|
||||||
//struct Foo { @disable string toString(); }
|
//struct Foo { @disable string toString(); }
|
||||||
//Foo foo;
|
//Foo foo;
|
||||||
|
|
|
@ -524,7 +524,7 @@ template isDeprecatedComplex(T)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
deprecated unittest
|
@safe deprecated unittest
|
||||||
{
|
{
|
||||||
static assert(isDeprecatedComplex!cfloat);
|
static assert(isDeprecatedComplex!cfloat);
|
||||||
static assert(isDeprecatedComplex!cdouble);
|
static assert(isDeprecatedComplex!cdouble);
|
||||||
|
|
|
@ -313,7 +313,7 @@ version(StdUnittest)
|
||||||
version(StdDdoc) import std.stdio;
|
version(StdDdoc) import std.stdio;
|
||||||
|
|
||||||
// Default data timeout for Protocols
|
// Default data timeout for Protocols
|
||||||
enum _defaultDataTimeout = dur!"minutes"(2);
|
private enum _defaultDataTimeout = dur!"minutes"(2);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Macros:
|
Macros:
|
||||||
|
@ -1643,7 +1643,7 @@ if (isCurlConn!Conn && isSomeChar!Char && isSomeChar!Terminator)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
import std.concurrency;
|
import std.concurrency : OnCrowding, send, setMaxMailboxSize, spawn, thisTid, Tid;
|
||||||
// 50 is just an arbitrary number for now
|
// 50 is just an arbitrary number for now
|
||||||
setMaxMailboxSize(thisTid, 50, OnCrowding.block);
|
setMaxMailboxSize(thisTid, 50, OnCrowding.block);
|
||||||
auto tid = spawn(&_async!().spawn!(Conn, Char, Terminator));
|
auto tid = spawn(&_async!().spawn!(Conn, Char, Terminator));
|
||||||
|
@ -1767,7 +1767,7 @@ if (isCurlConn!(Conn))
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
import std.concurrency;
|
import std.concurrency : OnCrowding, send, setMaxMailboxSize, spawn, thisTid, Tid;
|
||||||
// 50 is just an arbitrary number for now
|
// 50 is just an arbitrary number for now
|
||||||
setMaxMailboxSize(thisTid, 50, OnCrowding.block);
|
setMaxMailboxSize(thisTid, 50, OnCrowding.block);
|
||||||
auto tid = spawn(&_async!().spawn!(Conn, ubyte));
|
auto tid = spawn(&_async!().spawn!(Conn, ubyte));
|
||||||
|
@ -1826,7 +1826,7 @@ if (isCurlConn!(Conn))
|
||||||
*/
|
*/
|
||||||
private mixin template Protocol()
|
private mixin template Protocol()
|
||||||
{
|
{
|
||||||
import etc.c.curl : CurlReadFunc;
|
import etc.c.curl : CurlReadFunc, RawCurlProxy = CurlProxy;
|
||||||
import core.time : Duration;
|
import core.time : Duration;
|
||||||
import std.socket : InternetAddress;
|
import std.socket : InternetAddress;
|
||||||
|
|
||||||
|
@ -1911,7 +1911,7 @@ private mixin template Protocol()
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Type of proxy
|
/// Type of proxy
|
||||||
alias CurlProxy = etc.c.curl.CurlProxy;
|
alias CurlProxy = RawCurlProxy;
|
||||||
|
|
||||||
/** Proxy type
|
/** Proxy type
|
||||||
* See: $(HTTP curl.haxx.se/libcurl/c/curl_easy_setopt.html#CURLOPTPROXY, _proxy_type)
|
* See: $(HTTP curl.haxx.se/libcurl/c/curl_easy_setopt.html#CURLOPTPROXY, _proxy_type)
|
||||||
|
@ -2323,7 +2323,7 @@ struct HTTP
|
||||||
|
|
||||||
import std.datetime.systime : SysTime;
|
import std.datetime.systime : SysTime;
|
||||||
import std.typecons : RefCounted;
|
import std.typecons : RefCounted;
|
||||||
import etc.c.curl;
|
import etc.c.curl : CurlAuth, CurlInfo, curl_slist, CURLVERSION_NOW, curl_off_t;
|
||||||
|
|
||||||
/// Authentication method equal to $(REF CurlAuth, etc,c,curl)
|
/// Authentication method equal to $(REF CurlAuth, etc,c,curl)
|
||||||
alias AuthMethod = CurlAuth;
|
alias AuthMethod = CurlAuth;
|
||||||
|
@ -3244,7 +3244,7 @@ struct FTP
|
||||||
mixin Protocol;
|
mixin Protocol;
|
||||||
|
|
||||||
import std.typecons : RefCounted;
|
import std.typecons : RefCounted;
|
||||||
import etc.c.curl;
|
import etc.c.curl : CurlError, CurlInfo, curl_off_t, curl_slist;
|
||||||
|
|
||||||
private struct Impl
|
private struct Impl
|
||||||
{
|
{
|
||||||
|
@ -3646,7 +3646,7 @@ struct SMTP
|
||||||
{
|
{
|
||||||
mixin Protocol;
|
mixin Protocol;
|
||||||
import std.typecons : RefCounted;
|
import std.typecons : RefCounted;
|
||||||
import etc.c.curl;
|
import etc.c.curl : CurlUseSSL, curl_slist;
|
||||||
|
|
||||||
private struct Impl
|
private struct Impl
|
||||||
{
|
{
|
||||||
|
@ -4056,9 +4056,11 @@ alias ThrowOnError = Flag!"throwOnError";
|
||||||
|
|
||||||
private struct CurlAPI
|
private struct CurlAPI
|
||||||
{
|
{
|
||||||
import etc.c.curl;
|
import etc.c.curl : CurlGlobal;
|
||||||
static struct API
|
static struct API
|
||||||
{
|
{
|
||||||
|
import etc.c.curl : curl_version_info, curl_version_info_data,
|
||||||
|
CURL, CURLcode, CURLINFO, CURLoption, CURLversion, curl_slist;
|
||||||
extern(C):
|
extern(C):
|
||||||
import core.stdc.config : c_long;
|
import core.stdc.config : c_long;
|
||||||
CURLcode function(c_long flags) global_init;
|
CURLcode function(c_long flags) global_init;
|
||||||
|
@ -4189,7 +4191,10 @@ private struct CurlAPI
|
||||||
*/
|
*/
|
||||||
struct Curl
|
struct Curl
|
||||||
{
|
{
|
||||||
import etc.c.curl;
|
import etc.c.curl : CURL, CurlError, CurlPause, CurlSeek, CurlSeekPos,
|
||||||
|
curl_socket_t, CurlSockType,
|
||||||
|
CurlReadFunc, CurlInfo, curlsocktype, curl_off_t,
|
||||||
|
LIBCURL_VERSION_MAJOR, LIBCURL_VERSION_MINOR, LIBCURL_VERSION_PATCH;
|
||||||
|
|
||||||
alias OutData = void[];
|
alias OutData = void[];
|
||||||
alias InData = ubyte[];
|
alias InData = ubyte[];
|
||||||
|
|
|
@ -2545,7 +2545,7 @@ pure @safe nothrow unittest
|
||||||
|
|
||||||
// https://issues.dlang.org/show_bug.cgi?id=18092
|
// https://issues.dlang.org/show_bug.cgi?id=18092
|
||||||
// can't combine take and takeExactly
|
// can't combine take and takeExactly
|
||||||
unittest
|
@safe unittest
|
||||||
{
|
{
|
||||||
import std.algorithm.comparison : equal;
|
import std.algorithm.comparison : equal;
|
||||||
import std.internal.test.dummyrange : AllDummyRanges;
|
import std.internal.test.dummyrange : AllDummyRanges;
|
||||||
|
@ -8475,7 +8475,7 @@ public:
|
||||||
assert(3.iota.slide!(Partial)(4, 3).walkLength == expectedLength);
|
assert(3.iota.slide!(Partial)(4, 3).walkLength == expectedLength);
|
||||||
}}
|
}}
|
||||||
|
|
||||||
enum list = [
|
static immutable list = [
|
||||||
// iota slide expected
|
// iota slide expected
|
||||||
[4, 2, 1, 3, 3],
|
[4, 2, 1, 3, 3],
|
||||||
[5, 3, 1, 3, 3],
|
[5, 3, 1, 3, 3],
|
||||||
|
@ -8637,7 +8637,7 @@ public:
|
||||||
import std.typecons : tuple;
|
import std.typecons : tuple;
|
||||||
|
|
||||||
alias t = tuple;
|
alias t = tuple;
|
||||||
enum list = [
|
static immutable list = [
|
||||||
// iota slide expected
|
// iota slide expected
|
||||||
t(6, t(4, 2), [[1, 2, 3, 4], [3, 4, 5, 6]]),
|
t(6, t(4, 2), [[1, 2, 3, 4], [3, 4, 5, 6]]),
|
||||||
t(6, t(4, 6), [[1, 2, 3, 4]]),
|
t(6, t(4, 6), [[1, 2, 3, 4]]),
|
||||||
|
@ -8655,7 +8655,7 @@ public:
|
||||||
foreach (e; list)
|
foreach (e; list)
|
||||||
assert(Range().take(e[0]).slide!Partial(e[1].expand).equal!equal(e[2]));
|
assert(Range().take(e[0]).slide!Partial(e[1].expand).equal!equal(e[2]));
|
||||||
|
|
||||||
enum listSpecial = [
|
static immutable listSpecial = [
|
||||||
// iota slide expected
|
// iota slide expected
|
||||||
t(6, t(4, 3), [[1, 2, 3, 4], [4, 5, 6]]),
|
t(6, t(4, 3), [[1, 2, 3, 4], [4, 5, 6]]),
|
||||||
t(7, t(4, 5), [[1, 2, 3, 4], [6, 7]]),
|
t(7, t(4, 5), [[1, 2, 3, 4], [6, 7]]),
|
||||||
|
@ -8686,11 +8686,12 @@ public:
|
||||||
import std.typecons : tuple;
|
import std.typecons : tuple;
|
||||||
alias t = tuple;
|
alias t = tuple;
|
||||||
|
|
||||||
enum list = [
|
static immutable list = [
|
||||||
// slide expected
|
// slide expected
|
||||||
t(1, 1, [[10], [9], [8], [7], [6], [5], [4], [3], [2], [1]]),
|
t(1, 1, [[10], [9], [8], [7], [6], [5], [4], [3], [2], [1]]),
|
||||||
t(2, 1, [[9, 10], [8, 9], [7, 8], [6, 7], [5, 6], [4, 5], [3, 4], [2, 3], [1, 2]]),
|
t(2, 1, [[9, 10], [8, 9], [7, 8], [6, 7], [5, 6], [4, 5], [3, 4], [2, 3], [1, 2]]),
|
||||||
t(5, 1, [[6, 7, 8, 9, 10], [5, 6, 7, 8, 9], [4, 5, 6, 7, 8], [3, 4, 5, 6, 7], [2, 3, 4, 5, 6], [1, 2, 3, 4, 5]]),
|
t(5, 1, [[6, 7, 8, 9, 10], [5, 6, 7, 8, 9], [4, 5, 6, 7, 8],
|
||||||
|
[3, 4, 5, 6, 7], [2, 3, 4, 5, 6], [1, 2, 3, 4, 5]]),
|
||||||
t(2, 2, [[9, 10], [7, 8], [5, 6], [3, 4], [1, 2]]),
|
t(2, 2, [[9, 10], [7, 8], [5, 6], [3, 4], [1, 2]]),
|
||||||
t(2, 4, [[9, 10], [5, 6], [1, 2]]),
|
t(2, 4, [[9, 10], [5, 6], [1, 2]]),
|
||||||
];
|
];
|
||||||
|
|
|
@ -827,11 +827,12 @@ private auto matchMany(RegEx, R)(R input, RegEx re) @safe
|
||||||
}
|
}
|
||||||
|
|
||||||
// https://issues.dlang.org/show_bug.cgi?id=18135
|
// https://issues.dlang.org/show_bug.cgi?id=18135
|
||||||
unittest
|
@system unittest
|
||||||
{
|
{
|
||||||
static struct MapResult { RegexMatch!string m; }
|
static struct MapResult { RegexMatch!string m; }
|
||||||
MapResult m;
|
MapResult m;
|
||||||
m = MapResult();
|
m = MapResult();
|
||||||
|
assert(m == m);
|
||||||
}
|
}
|
||||||
|
|
||||||
private enum isReplaceFunctor(alias fun, R) =
|
private enum isReplaceFunctor(alias fun, R) =
|
||||||
|
|
|
@ -6402,7 +6402,7 @@ if (isSomeString!S ||
|
||||||
|
|
||||||
version(TestComplex)
|
version(TestComplex)
|
||||||
deprecated
|
deprecated
|
||||||
unittest
|
@safe unittest
|
||||||
{
|
{
|
||||||
import std.conv : to;
|
import std.conv : to;
|
||||||
assert(isNumeric(to!string(123e+2+1234.78Li)) == true);
|
assert(isNumeric(to!string(123e+2+1234.78Li)) == true);
|
||||||
|
|
|
@ -5238,7 +5238,8 @@ template IntegralTypeOf(T)
|
||||||
static assert( is(Q!T == IntegralTypeOf!( SubTypeOf!(Q!T) )));
|
static assert( is(Q!T == IntegralTypeOf!( SubTypeOf!(Q!T) )));
|
||||||
}
|
}
|
||||||
|
|
||||||
static foreach (T; AliasSeq!(void, bool, FloatingPointTypeList, /*ImaginaryTypeList, ComplexTypeList,*/ CharTypeList))
|
static foreach (T; AliasSeq!(void, bool, FloatingPointTypeList,
|
||||||
|
/*ImaginaryTypeList, ComplexTypeList,*/ CharTypeList))
|
||||||
static foreach (Q; TypeQualifierList)
|
static foreach (Q; TypeQualifierList)
|
||||||
{
|
{
|
||||||
static assert(!is(IntegralTypeOf!( Q!T )));
|
static assert(!is(IntegralTypeOf!( Q!T )));
|
||||||
|
|
|
@ -1299,7 +1299,7 @@ if (distinctFieldNames!(Specs))
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Use tuples as ranges
|
/// Use tuples as ranges
|
||||||
unittest
|
@safe unittest
|
||||||
{
|
{
|
||||||
import std.algorithm.iteration : sum;
|
import std.algorithm.iteration : sum;
|
||||||
import std.range : only;
|
import std.range : only;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue