diff --git a/std/algorithm/comparison.d b/std/algorithm/comparison.d index 5a671a7ad22..fe7b2992989 100644 --- a/std/algorithm/comparison.d +++ b/std/algorithm/comparison.d @@ -804,9 +804,10 @@ pure @safe unittest assert(result > 0); } +// cmp for string with custom predicate fails if distinct chars can compare equal +// https://issues.dlang.org/show_bug.cgi?id=18286 @nogc nothrow pure @safe unittest { - // Issue 18286: cmp for string with custom predicate fails if distinct chars can compare equal static bool ltCi(dchar a, dchar b)// less than, case insensitive { import std.ascii : toUpper; @@ -819,9 +820,10 @@ pure @safe unittest static assert(cmp!ltCi("apple", "APPLE") == 0); } +// for non-string ranges check that opCmp is evaluated only once per pair. +// https://issues.dlang.org/show_bug.cgi?id=18280 @nogc nothrow @safe unittest { - // Issue 18280: for non-string ranges check that opCmp is evaluated only once per pair. static int ctr = 0; struct S { diff --git a/std/algorithm/iteration.d b/std/algorithm/iteration.d index 846a246b6b7..a82eff28378 100644 --- a/std/algorithm/iteration.d +++ b/std/algorithm/iteration.d @@ -207,7 +207,7 @@ if (isBidirectionalRange!Range) assert(counter == iota(-4, 5).length); } -// issue 15891 +// https://issues.dlang.org/show_bug.cgi?id=15891 @safe pure unittest { assert([1].map!(x=>[x].map!(y=>y)).cache.front.front == 1); @@ -356,7 +356,7 @@ private struct _Cache(R, bool bidir) else { // needed, because the compiler cannot deduce, that 'caches' is initialized - // see issue 15891 + // see https://issues.dlang.org/show_bug.cgi?id=15891 caches[0] = UE.init; static if (bidir) caches[1] = UE.init; @@ -395,7 +395,7 @@ private struct _Cache(R, bool bidir) caches[0] = source.front; else { - // see issue 15891 + // see https://issues.dlang.org/show_bug.cgi?id=15891 caches[0] = UE.init; static if (bidir) caches[1] = UE.init; @@ -409,7 +409,7 @@ private struct _Cache(R, bool bidir) caches[1] = source.back; else { - // see issue 15891 + // see https://issues.dlang.org/show_bug.cgi?id=15891 caches[0] = UE.init; caches[1] = UE.init; } @@ -502,7 +502,9 @@ if (fun.length >= 1) alias _funs = staticMap!(unaryFun, fun); alias _fun = adjoin!_funs; - // Once DMD issue #5710 is fixed, this validation loop can be moved into a template. + // Once https://issues.dlang.org/show_bug.cgi?id=5710 is fixed + // accross all compilers (as of 2020-04, it wasn't fixed in LDC and GDC), + // this validation loop can be moved into a template. foreach (f; _funs) { static assert(!is(typeof(f(RE.init)) == void), @@ -514,7 +516,8 @@ if (fun.length >= 1) alias _fun = unaryFun!fun; alias _funs = AliasSeq!(_fun); - // Do the validation separately for single parameters due to DMD issue #15777. + // Do the validation separately for single parameters due to + // https://issues.dlang.org/show_bug.cgi?id=15777. static assert(!is(typeof(_fun(RE.init)) == void), "Mapping function(s) must not return void: " ~ _funs.stringof); } @@ -565,10 +568,9 @@ it separately: assert(equal(stringize([ 1, 2, 3, 4 ]), [ "1", "2", "3", "4" ])); } +// Verify workaround for https://issues.dlang.org/show_bug.cgi?id=15777 @safe unittest { - // Verify workaround for DMD #15777 - import std.algorithm.mutation, std.string; auto foo(string[] args) { @@ -805,7 +807,7 @@ private struct MapResult(alias fun, Range) assert(equal(ms2[0 .. 2], "日本"w)); assert(equal(ms3[0 .. 2], "HE")); - // Issue 5753 + // https://issues.dlang.org/show_bug.cgi?id=5753 static void voidFun(int) {} static int nonvoidFun(int) { return 0; } static assert(!__traits(compiles, map!voidFun([1]))); @@ -814,7 +816,7 @@ private struct MapResult(alias fun, Range) static assert(!__traits(compiles, map!(voidFun, nonvoidFun)([1]))); static assert(!__traits(compiles, map!(a => voidFun(a))([1]))); - // Phobos issue #15480 + // https://issues.dlang.org/show_bug.cgi?id=15480 auto dd = map!(z => z * z, c => c * c * c)([ 1, 2, 3, 4 ]); assert(dd[0] == tuple(1, 1)); assert(dd[1] == tuple(4, 8)); @@ -836,7 +838,7 @@ private struct MapResult(alias fun, Range) { import std.range : iota; - // Issue #10130 - map of iota with const step. + // https://issues.dlang.org/show_bug.cgi?id=10130 - map of iota with const step. const step = 2; assert(map!(i => i)(iota(0, 10, step)).walkLength == 5); @@ -1142,7 +1144,8 @@ public: assert(b == [ 3, 4, 5 ]); } -// #15358: application of `each` with >2 args (opApply) +// https://issues.dlang.org/show_bug.cgi?id=15358 +// application of `each` with >2 args (opApply) @system unittest { import std.range : lockstep; @@ -1157,7 +1160,8 @@ public: assert(c == [7,8,9]); } -// #15358: application of `each` with >2 args (range interface) +// https://issues.dlang.org/show_bug.cgi?id=15358 +// application of `each` with >2 args (range interface) @safe unittest { import std.range : zip; @@ -1172,7 +1176,8 @@ public: assert(res == [9, 12, 15]); } -// #16255: `each` on opApply doesn't support ref +// https://issues.dlang.org/show_bug.cgi?id=16255 +// `each` on opApply doesn't support ref @safe unittest { int[] dynamicArray = [1, 2, 3, 4, 5]; @@ -1188,7 +1193,8 @@ public: assert(staticArray == [3, 4, 5, 6, 7]); } -// #16255: `each` on opApply doesn't support ref +// https://issues.dlang.org/show_bug.cgi?id=16255 +// `each` on opApply doesn't support ref @system unittest { struct S @@ -1204,7 +1210,8 @@ public: assert(s.x == 2); } -// #15357: `each` should behave similar to foreach +// https://issues.dlang.org/show_bug.cgi?id=15357 +// `each` should behave similar to foreach /// `each` works with iterable objects which provide an index variable, along with each element @safe unittest { @@ -1221,7 +1228,8 @@ public: assert(arr.sum == 4.iota.sum); } -// #15357: `each` should behave similar to foreach +// https://issues.dlang.org/show_bug.cgi?id=15357 +// `each` should behave similar to foreach @system unittest { import std.range : iota, lockstep; @@ -1248,7 +1256,8 @@ public: assert(arrC.sum == 12); } -// #15357: `each` should behave similar to foreach +// https://issues.dlang.org/show_bug.cgi?id=15357 +// `each` should behave similar to foreach @system unittest { import std.range : lockstep; @@ -1502,7 +1511,7 @@ private struct FilterResult(alias pred, Range) assert(equal(filter!underX(list), [ 1, 2, 3, 4 ])); } -// issue 19823 +// https://issues.dlang.org/show_bug.cgi?id=19823 @safe unittest { import std.algorithm.comparison : equal; @@ -1793,7 +1802,7 @@ if (isInputRange!R) import std.algorithm.comparison : equal; import std.typecons : tuple; - // Issue 13857 + // https://issues.dlang.org/show_bug.cgi?id=13857 immutable(int)[] a1 = [1,1,2,2,2,3,4,4,5,6,6,7,8,9,9,9]; auto g1 = group(a1); assert(equal(g1, [ tuple(1, 2u), tuple(2, 3u), tuple(3, 1u), @@ -1801,12 +1810,12 @@ if (isInputRange!R) tuple(7, 1u), tuple(8, 1u), tuple(9, 3u) ])); - // Issue 13162 + // https://issues.dlang.org/show_bug.cgi?id=13162 immutable(ubyte)[] a2 = [1, 1, 1, 0, 0, 0]; auto g2 = a2.group; assert(equal(g2, [ tuple(1, 3u), tuple(0, 3u) ])); - // Issue 10104 + // https://issues.dlang.org/show_bug.cgi?id=10104 const a3 = [1, 1, 2, 2]; auto g3 = a3.group; assert(equal(g3, [ tuple(1, 2u), tuple(2, 2u) ])); @@ -1849,7 +1858,8 @@ if (isInputRange!R) assert(t.equal([ tuple(3, 1u), tuple(4, 3u), tuple(5, 1u) ])); } -pure @safe unittest // issue 18657 +// https://issues.dlang.org/show_bug.cgi?id=18657 +pure @safe unittest { import std.algorithm.comparison : equal; import std.range : refRange; @@ -2402,7 +2412,9 @@ version (none) // this example requires support for non-equivalence relations assert(!range.empty); // Opposite of refInputRange test } - /* Issue 93532 - General behavior of non-forward input ranges. + /* https://issues.dlang.org/show_bug.cgi?id=19532 + * General behavior of non-forward input ranges. + * * - If the same chunk is retrieved multiple times via front, the separate chunk * instances refer to a shared range segment that advances as a single range. * - Emptying a chunk via popFront does not implicitly popFront the chunk off @@ -2517,7 +2529,7 @@ version (none) // this example requires support for non-equivalence relations } } - // Issue 93532 - Using roundRobin/chunkBy + // https://issues.dlang.org/show_bug.cgi?id=19532 - Using roundRobin/chunkBy { import std.algorithm.comparison : equal; import std.range : roundRobin; @@ -2541,7 +2553,7 @@ version (none) // this example requires support for non-equivalence relations assert(r3.equal!equal(expected)); } - // Issue 93532 - Using merge/chunkBy + // https://issues.dlang.org/show_bug.cgi?id=19532 - Using merge/chunkBy { import std.algorithm.comparison : equal; import std.algorithm.sorting : merge; @@ -2564,7 +2576,7 @@ version (none) // this example requires support for non-equivalence relations assert(r3.equal!equal(expected)); } - // Issue 93532 - Using chunkBy/map-fold + // https://issues.dlang.org/show_bug.cgi?id=19532 - Using chunkBy/map-fold { import std.algorithm.comparison : equal; import std.algorithm.iteration : fold, map; @@ -2588,7 +2600,10 @@ version (none) // this example requires support for non-equivalence relations assert(r3.equal(expected)); } - // Issues 16169, 17966, 93532 - Using multiwayMerge/chunkBy + // https://issues.dlang.org/show_bug.cgi?id=16169 + // https://issues.dlang.org/show_bug.cgi?id=17966 + // https://issues.dlang.org/show_bug.cgi?id=19532 + // Using multiwayMerge/chunkBy { import std.algorithm.comparison : equal; import std.algorithm.setops : multiwayMerge; @@ -2628,7 +2643,7 @@ version (none) // this example requires support for non-equivalence relations } -// Issue 13595 +// https://issues.dlang.org/show_bug.cgi?id=13595 version (none) // This requires support for non-equivalence relations @system unittest { @@ -2642,7 +2657,7 @@ version (none) // This requires support for non-equivalence relations ])); } -// Issue 13805 +// https://issues.dlang.org/show_bug.cgi?id=13805 @system unittest { [""].map!((s) => s).chunkBy!((x, y) => true); @@ -2893,7 +2908,7 @@ if (isInputRange!RoR && isInputRange!(ElementType!RoR) import std.algorithm.comparison : equal; import std.range; - // Related to issue 8061 + // Related to https://issues.dlang.org/show_bug.cgi?id=8061 auto r = joiner([ inputRangeObject("abc"), inputRangeObject("def"), @@ -2930,7 +2945,7 @@ if (isInputRange!RoR && isInputRange!(ElementType!RoR) assert(equal(u, "+-abc+-+-def+-")); - // Issue 13441: only(x) as separator + // https://issues.dlang.org/show_bug.cgi?id=13441: only(x) as separator string[][] lines = [null]; lines .joiner(only("b")) @@ -3290,11 +3305,11 @@ if (isInputRange!RoR && isInputRange!(ElementType!RoR)) import std.range.interfaces : inputRangeObject; import std.range : retro; - // bugzilla 8240 + // https://issues.dlang.org/show_bug.cgi?id=8240 assert(equal(joiner([inputRangeObject("")]), "")); assert(equal(joiner([inputRangeObject("")]).retro, "")); - // issue 8792 + // https://issues.dlang.org/show_bug.cgi?id=8792 auto b = [[1], [2], [3]]; auto jb = joiner(b); auto js = jb.save; @@ -3515,7 +3530,7 @@ if (isInputRange!RoR && isInputRange!(ElementType!RoR)) to!string("Unexpected result: '%s'"d.algoFormat(result))); } -// Issue 8061 +// https://issues.dlang.org/show_bug.cgi?id=8061 @system unittest { import std.conv : to; @@ -3592,7 +3607,7 @@ if (isInputRange!RoR && isInputRange!(ElementType!RoR)) } } -// Issue 19850 +// https://issues.dlang.org/show_bug.cgi?id=19850 @safe pure unittest { assert([[0]].joiner.save.back == 0); @@ -3732,7 +3747,7 @@ if (fun.length >= 1) alias E = Select!(isInputRange!R, ElementType!R, ForeachType!R); static if (mustInitialize) bool initialized = false; - foreach (/+auto ref+/ E e; r) // @@@4707@@@ + foreach (/+auto ref+/ E e; r) // https://issues.dlang.org/show_bug.cgi?id=4707 { foreach (i, f; binfuns) { @@ -3941,7 +3956,8 @@ The number of seeds must be correspondingly increased. @safe unittest { - // Issue #10408 - Two-function reduce of a const array. + // https://issues.dlang.org/show_bug.cgi?id= 10408 + // Two-function reduce of a const array. import std.algorithm.comparison : max, min; import std.typecons : tuple, Tuple; @@ -3954,7 +3970,7 @@ The number of seeds must be correspondingly increased. @safe unittest { - //10709 + // https://issues.dlang.org/show_bug.cgi?id=10709 import std.typecons : tuple, Tuple; enum foo = "a + 0.5 * b"; @@ -4021,7 +4037,8 @@ The number of seeds must be correspondingly increased. assert(minmaxElement([1, 2, 3]) == tuple(1, 3)); } -@safe unittest //12569 +// https://issues.dlang.org/show_bug.cgi?id=12569 +@safe unittest { import std.algorithm.comparison : max, min; import std.typecons : tuple; @@ -4042,7 +4059,8 @@ The number of seeds must be correspondingly increased. static assert(!is(typeof(reduce!(all, all)(tuple(1, 1), "hello")))); } -@safe unittest //13304 +// https://issues.dlang.org/show_bug.cgi?id=13304 +@safe unittest { int[] data; static assert(is(typeof(reduce!((a, b) => a + b)(data)))); @@ -4514,7 +4532,8 @@ The number of seeds must be correspondingly increased. assert(minmaxElement([1, 2, 3]).equal([tuple(1, 1), tuple(1, 2), tuple(1, 3)])); } -@safe unittest //12569 +// https://issues.dlang.org/show_bug.cgi?id=12569 +@safe unittest { import std.algorithm.comparison : equal, max, min; import std.typecons : tuple; @@ -4537,7 +4556,8 @@ The number of seeds must be correspondingly increased. static assert(!__traits(compiles, cumulativeFold!(all, all)("hello", tuple(1, 1)))); } -@safe unittest //13304 +// https://issues.dlang.org/show_bug.cgi?id=13304 +@safe unittest { int[] data; assert(data.cumulativeFold!((a, b) => a + b).empty); @@ -4937,7 +4957,9 @@ if (is(typeof(binaryFun!pred(r.front, s)) : bool) assert(split.front == "b "); assert(split.back == "r "); - foreach (DummyType; AllDummyRanges) { // Bug 4408 + // https://issues.dlang.org/show_bug.cgi?id=4408 + foreach (DummyType; AllDummyRanges) + { static if (isRandomAccessRange!DummyType) { static assert(isBidirectionalRange!DummyType); @@ -4964,7 +4986,8 @@ if (is(typeof(binaryFun!pred(r.front, s)) : bool) assert(s.empty); } -@safe unittest // issue 18470 +// https://issues.dlang.org/show_bug.cgi?id=18470 +@safe unittest { import std.algorithm.comparison : equal; @@ -4972,7 +4995,8 @@ if (is(typeof(binaryFun!pred(r.front, s)) : bool) assert(w.splitter!((a, b) => a.front() == b)(1).equal([[[0]], [[2]]])); } -@safe unittest // issue 18470 +// https://issues.dlang.org/show_bug.cgi?id=18470 +@safe unittest { import std.algorithm.comparison : equal; import std.ascii : toLower; @@ -5138,11 +5162,11 @@ if (is(typeof(binaryFun!pred(r.front, s.front)) : bool) assert(equal(sp6, ["", ""][])); } +// https://issues.dlang.org/show_bug.cgi?id=10773 @safe unittest { import std.algorithm.comparison : equal; - // Issue 10773 auto s = splitter("abc", ""); assert(s.equal(["a", "b", "c"])); } @@ -5383,7 +5407,7 @@ private struct SplitterResult(alias isTerminator, Range) import std.algorithm.comparison : equal; import std.uni : isWhite; - //@@@6791@@@ + // https://issues.dlang.org/show_bug.cgi?id=6791 assert(equal( splitter("là dove terminava quella valle"), ["là", "dove", "terminava", "quella", "valle"] @@ -5395,7 +5419,8 @@ private struct SplitterResult(alias isTerminator, Range) assert(equal(splitter!"a=='本'"("日本語"), ["日", "語"])); } -pure @safe unittest // issue 18657 +// https://issues.dlang.org/show_bug.cgi?id=18657 +pure @safe unittest { import std.algorithm.comparison : equal; import std.range : refRange; @@ -5621,9 +5646,9 @@ if (isSomeString!Range || assert(dictionary["last".byCodeUnit]== 4); } +// https://issues.dlang.org/show_bug.cgi?id=19238 @safe pure unittest { - // issue 19238 import std.utf : byCodeUnit; import std.algorithm.comparison : equal; auto range = "hello world".byCodeUnit.splitter; @@ -6334,7 +6359,7 @@ if (isInputRange!R && Substs.length >= 2 && !is(CommonType!(Substs) == void)) }} } -// issue 19207 +// https://issues.dlang.org/show_bug.cgi?id=19207 @safe pure nothrow unittest { import std.algorithm.comparison : equal; @@ -6634,7 +6659,8 @@ private auto sumKahan(Result, R)(Result result, R r) assert(sum(SList!double(1, 2, 3, 4)[]) == 10); } -@safe pure nothrow unittest // 12434 +// https://issues.dlang.org/show_bug.cgi?id=12434 +@safe pure nothrow unittest { immutable a = [10, 20]; auto s1 = sum(a); @@ -6936,7 +6962,8 @@ private struct UniqResult(alias pred, Range) } } -@safe unittest // https://issues.dlang.org/show_bug.cgi?id=17264 +// https://issues.dlang.org/show_bug.cgi?id=17264 +@safe unittest { import std.algorithm.comparison : equal; diff --git a/std/algorithm/mutation.d b/std/algorithm/mutation.d index 81e635257bd..b60cb172c05 100644 --- a/std/algorithm/mutation.d +++ b/std/algorithm/mutation.d @@ -337,7 +337,7 @@ if (isInputRange!InputRange && isForwardRange!ForwardRange) assert(equal(arr, [1, 2, 3, 4, 5, 6, 7])); } - // Bugzilla 16959 + // https://issues.dlang.org/show_bug.cgi?id=16959 auto arr = ['4', '5', '6', '7', '1', '2', '3']; auto p = bringToFront(arr[0 .. 4], arr[4 .. $]); @@ -507,7 +507,8 @@ $(LINK2 http://en.cppreference.com/w/cpp/algorithm/copy_backward, STL's `copy_ba assert(a[4 .. 9] == [6, 7, 8, 9, 10]); } - { // Test for bug 7898 + // https://issues.dlang.org/show_bug.cgi?id=7898 + { enum v = { import std.algorithm; @@ -520,9 +521,9 @@ $(LINK2 http://en.cppreference.com/w/cpp/algorithm/copy_backward, STL's `copy_ba } } +// https://issues.dlang.org/show_bug.cgi?id=13650 @safe unittest { - // Issue 13650 import std.meta : AliasSeq; static foreach (Char; AliasSeq!(char, wchar, dchar)) {{ @@ -534,7 +535,8 @@ $(LINK2 http://en.cppreference.com/w/cpp/algorithm/copy_backward, STL's `copy_ba }} } -@safe unittest // issue 18804 +// https://issues.dlang.org/show_bug.cgi?id=18804 +@safe unittest { static struct NullSink { @@ -607,7 +609,8 @@ if ((isInputRange!Range && is(typeof(range.front = value)) || assert(a == [ 5, 5, 5, 5 ]); } -// issue 16342, test fallback on mutable narrow strings +// test fallback on mutable narrow strings +// https://issues.dlang.org/show_bug.cgi?id=16342 @safe unittest { char[] chars = ['a', 'b']; @@ -670,7 +673,7 @@ if ((isInputRange!Range && is(typeof(range.front = value)) || chars[1 .. 3].fill(':'); assert(chars == "a::d"); } -// end issue 16342 +// end https://issues.dlang.org/show_bug.cgi?id=16342 @safe unittest { @@ -1136,7 +1139,7 @@ pure nothrow @safe @nogc unittest move(s21, s22); assert(s21 == s22); }); - // Issue 5661 test(1) + // https://issues.dlang.org/show_bug.cgi?id=5661 test(1) static struct S3 { static struct X { int n = 0; ~this(){n = 0;} } @@ -1149,7 +1152,7 @@ pure nothrow @safe @nogc unittest assert(s31.x.n == 0); assert(s32.x.n == 1); - // Issue 5661 test(2) + // https://issues.dlang.org/show_bug.cgi?id=5661 test(2) static struct S4 { static struct X { int n = 0; this(this){n = 0;} } @@ -1162,7 +1165,7 @@ pure nothrow @safe @nogc unittest assert(s41.x.n == 0); assert(s42.x.n == 1); - // Issue 13990 test + // https://issues.dlang.org/show_bug.cgi?id=13990 test class S5; S5 s51; @@ -1270,7 +1273,7 @@ private T moveImpl(T)(ref T source) assert(s21 == s22); }); - // Issue 5661 test(1) + // https://issues.dlang.org/show_bug.cgi?id=5661 test(1) static struct S3 { static struct X { int n = 0; ~this(){n = 0;} } @@ -1283,7 +1286,7 @@ private T moveImpl(T)(ref T source) assert(s31.x.n == 0); assert(s32.x.n == 1); - // Issue 5661 test(2) + // https://issues.dlang.org/show_bug.cgi?id=5661 test(2) static struct S4 { static struct X { int n = 0; this(this){n = 0;} } @@ -1296,7 +1299,7 @@ private T moveImpl(T)(ref T source) assert(s41.x.n == 0); assert(s42.x.n == 1); - // Issue 13990 test + // https://issues.dlang.org/show_bug.cgi?id=13990 test class S5; S5 s51; @@ -1320,14 +1323,16 @@ private T moveImpl(T)(ref T source) assert(a.n == 0); } -@safe unittest//Issue 6217 +// https://issues.dlang.org/show_bug.cgi?id=6217 +@safe unittest { import std.algorithm.iteration : map; auto x = map!"a"([1,2,3]); x = move(x); } -@safe unittest// Issue 8055 +// https://issues.dlang.org/show_bug.cgi?id=8055 +@safe unittest { static struct S { @@ -1347,7 +1352,8 @@ private T moveImpl(T)(ref T source) assert(b.x == 0); } -@system unittest// Issue 8057 +// https://issues.dlang.org/show_bug.cgi?id=8057 +@system unittest { int n = 10; struct S @@ -1369,7 +1375,7 @@ private T moveImpl(T)(ref T source) auto b = foo(a); assert(b.x == 1); - // Regression 8171 + // Regression https://issues.dlang.org/show_bug.cgi?id=8171 static struct Array(T) { // nested struct has no member @@ -1476,7 +1482,7 @@ pure nothrow @nogc @system unittest assert(val == 0); } -// issue 18913 +// https://issues.dlang.org/show_bug.cgi?id=18913 @safe unittest { static struct NoCopy @@ -1998,7 +2004,7 @@ private auto removeImpl(SwapStrategy s, Range, Offset...)(Range range, Offset of import std.exception : assertThrown; import std.range; - // http://d.puremagic.com/issues/show_bug.cgi?id=10173 + // https://issues.dlang.org/show_bug.cgi?id=10173 int[] test = iota(0, 10).array(); assertThrown(remove!(SwapStrategy.stable)(test, tuple(2, 4), tuple(1, 3))); assertThrown(remove!(SwapStrategy.unstable)(test, tuple(2, 4), tuple(1, 3))); @@ -2021,7 +2027,7 @@ private auto removeImpl(SwapStrategy s, Range, Offset...)(Range range, Offset of a = [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ]; assert(remove!(SwapStrategy.unstable)(a, 0, tuple(9, 11)) == [ 8, 1, 2, 3, 4, 5, 6, 7 ]); - // http://d.puremagic.com/issues/show_bug.cgi?id=5224 + // https://issues.dlang.org/show_bug.cgi?id=5224 a = [ 1, 2, 3, 4 ]; assert(remove!(SwapStrategy.unstable)(a, 2) == [ 1, 2, 4 ]); @@ -2042,19 +2048,19 @@ private auto removeImpl(SwapStrategy s, Range, Offset...)(Range range, Offset of == [0, 9, 8, 7, 4, 5]); } +// https://issues.dlang.org/show_bug.cgi?id=11576 @safe unittest { - // Issue 11576 auto arr = [1,2,3]; arr = arr.remove!(SwapStrategy.unstable)(2); assert(arr == [1,2]); } +// https://issues.dlang.org/show_bug.cgi?id=12889 @safe unittest { import std.range; - // Bug# 12889 int[1][] arr = [[0], [1], [2], [3], [4], [5], [6]]; auto orig = arr.dup; foreach (i; iota(arr.length)) @@ -2906,9 +2912,9 @@ if (isBlitAssignable!T && !is(typeof(lhs.proxySwap(rhs)))) static assert(!__traits(compiles, swap(const1, const2))); } +// https://issues.dlang.org/show_bug.cgi?id=4789 @safe unittest { - //Bug# 4789 int[1] s = [1]; swap(s, s); @@ -2946,23 +2952,24 @@ if (isBlitAssignable!T && !is(typeof(lhs.proxySwap(rhs)))) assert(s.i3 == 2); } +// https://issues.dlang.org/show_bug.cgi?id=11853 @safe unittest { - //11853 import std.traits : isAssignable; alias T = Tuple!(int, double); static assert(isAssignable!T); } +// https://issues.dlang.org/show_bug.cgi?id=12024 @safe unittest { - // 12024 import std.datetime; SysTime a, b; swap(a, b); } -@system unittest // 9975 +// https://issues.dlang.org/show_bug.cgi?id=9975 +@system unittest { import std.exception : doesPointTo, mayPointTo; static struct S2 diff --git a/std/algorithm/searching.d b/std/algorithm/searching.d index 87e121e4f6e..1c851b58537 100644 --- a/std/algorithm/searching.d +++ b/std/algorithm/searching.d @@ -569,7 +569,7 @@ if (isNarrowString!R1 && isNarrowString!R2) assert(commonPrefix(to!S("hello, world"), to!T("hello, ")) == to!S("hello, ")); assert(commonPrefix(to!S("hello, world"), to!T("hello, world")) == to!S("hello, world")); - //Bug# 8890 + // https://issues.dlang.org/show_bug.cgi?id=8890 assert(commonPrefix(to!S("Пиво"), to!T("Пони"))== to!S("П")); assert(commonPrefix(to!S("Пони"), to!T("Пиво"))== to!S("П")); assert(commonPrefix(to!S("Пиво"), to!T("Пиво"))== to!S("Пиво")); @@ -735,7 +735,7 @@ if (isInputRange!R && !isInfinite!R) assert(count("日本語") == 3); } -// Issue 11253 +// https://issues.dlang.org/show_bug.cgi?id=11253 @safe nothrow unittest { assert([1, 2, 3].count([2, 3]) == 1); @@ -847,7 +847,8 @@ if (isForwardRange!R } } - //Because of @@@8804@@@: Avoids both "unreachable code" or "no return statement" + // Because of https://issues.dlang.org/show_bug.cgi?id=8804 + // Avoids both "unreachable code" or "no return statement" static if (isInfinite!R) assert(false, R.stringof ~ " must not be an" ~ " infinite range"); else return -1; @@ -951,7 +952,8 @@ if (isInputRange!R && } } - //Because of @@@8804@@@: Avoids both "unreachable code" or "no return statement" + // Because of https://issues.dlang.org/show_bug.cgi?id=8804 + // Avoids both "unreachable code" or "no return statement" static if (isInfinite!R) assert(false, R.stringof ~ " must not be an" ~ " inifite range"); else return -1; @@ -1196,7 +1198,8 @@ if (isInputRange!R && import std.meta : AliasSeq; static foreach (S; AliasSeq!(char[], wchar[], dchar[], string, wstring, dstring)) - (){ // workaround slow optimizations for large functions @@@BUG@@@ 2396 + (){ // workaround slow optimizations for large functions + // https://issues.dlang.org/show_bug.cgi?id=2396 assert(!endsWith(to!S("abc"), 'a')); assert(endsWith(to!S("abc"), 'a', 'c') == 2); assert(!endsWith(to!S("abc"), 'x', 'n', 'b')); @@ -1572,7 +1575,7 @@ if (isInputRange!InputRange && // If the haystack is a SortedRange we can use binary search to find the needle. // Works only for the default find predicate and any SortedRange predicate. - // 8829 enhancement + // https://issues.dlang.org/show_bug.cgi?id=8829 import std.range : SortedRange; static if (is(InputRange : SortedRange!TT, TT) && isDefaultPred) { @@ -1658,7 +1661,7 @@ if (isInputRange!InputRange && } else static if (isArray!R) { - //10403 optimization + // https://issues.dlang.org/show_bug.cgi?id=10403 optimization static if (isDefaultPred && isIntegral!EType && EType.sizeof == 1 && isIntegralNeedle) { import std.algorithm.comparison : max, min; @@ -1810,9 +1813,9 @@ if (isInputRange!InputRange && assertCTFEable!dg; } +// https://issues.dlang.org/show_bug.cgi?id=11603 @safe unittest { - // Bugzilla 11603 enum Foo : ubyte { A } assert([Foo.A].find(Foo.A).empty == false); @@ -1978,7 +1981,7 @@ if (isForwardRange!R1 && isForwardRange!R2 // Binary search can be used to find the first occurence // of the first element of the needle in haystack. // When it is found O(walklength(needle)) steps are performed. - // 8829 enhancement + // https://issues.dlang.org/show_bug.cgi?id=8829 enhancement import std.algorithm.comparison : mismatch; import std.range : SortedRange; static if (is(R1 == R2) @@ -2099,7 +2102,8 @@ if (isForwardRange!R1 && isForwardRange!R2 assert([C(1,0), C(2,0), C(3,1), C(4,0)].find!"a.x == b"(SList!int(2, 3)[]) == [C(2,0), C(3,1), C(4,0)]); } -@safe unittest // issue 12470 +// https://issues.dlang.org/show_bug.cgi?id=12470 +@safe unittest { import std.array : replace; inout(char)[] sanitize(inout(char)[] p) @@ -2167,7 +2171,7 @@ if (isForwardRange!R1 && isForwardRange!R2 assert(find([ 1, 2, 1, 2, 3, 3 ], SList!int(2, 3)[]) == [ 2, 3, 3 ]); } -//Bug# 8334 +// https://issues.dlang.org/show_bug.cgi?id=8334 @safe unittest { import std.algorithm.iteration : filter; @@ -2183,7 +2187,7 @@ if (isForwardRange!R1 && isForwardRange!R2 assert(find(haystack, filter!"true"(needle)).empty); } -// issue 11013 +// https://issues.dlang.org/show_bug.cgi?id=11013 @safe unittest { assert(find!"a == a"("abc","abc") == "abc"); @@ -2665,7 +2669,7 @@ if (isForwardRange!(Range)) ReferenceForwardRange!int rfr = new ReferenceForwardRange!int([1, 2, 3, 2, 2, 3]); assert(equal(findAdjacent(rfr), [2, 2, 3])); - // Issue 9350 + // https://issues.dlang.org/show_bug.cgi?id=9350 assert(!repeat(1).findAdjacent().empty); } @@ -2718,7 +2722,8 @@ if (isInputRange!InputRange && isForwardRange!ForwardRange) assert(findAmong!("a == b")(b, [ 4, 6, 7 ][]).empty); } -@system unittest // issue 19765 +// https://issues.dlang.org/show_bug.cgi?id=19765 +@system unittest { import std.range.interfaces : inputRangeObject; auto choices = inputRangeObject("b"); @@ -2781,7 +2786,8 @@ if (isForwardRange!R1 && isForwardRange!R2 assert(findSkip(s, "def") && s.empty); } -@safe unittest // issue 19020 +// https://issues.dlang.org/show_bug.cgi?id=19020 +@safe unittest { static struct WrapperRange { @@ -3313,7 +3319,7 @@ if (isForwardRange!R1 && isForwardRange!R2) assert(split[1] == "one"); } -// issue 11013 +// https://issues.dlang.org/show_bug.cgi?id=11013 @safe pure unittest { auto var = "abc"; @@ -4842,7 +4848,8 @@ if (isInputRange!R && import std.range; static foreach (S; AliasSeq!(char[], wchar[], dchar[], string, wstring, dstring)) - (){ // workaround slow optimizations for large functions @@@BUG@@@ 2396 + (){ // workaround slow optimizations for large functions + // https://issues.dlang.org/show_bug.cgi?id=2396 assert(!startsWith(to!S("abc"), 'c')); assert(startsWith(to!S("abc"), 'a', 'c') == 1); assert(!startsWith(to!S("abc"), 'x', 'n', 'b')); @@ -5125,7 +5132,8 @@ if (isInputRange!Range) assert(equal(until!"a == 2"(a, No.openRight), [1, 2])); } -@system unittest // bugzilla 13171 +// https://issues.dlang.org/show_bug.cgi?id=13171 +@system unittest { import std.algorithm.comparison : equal; import std.range; @@ -5134,7 +5142,8 @@ if (isInputRange!Range) assert(a == [4]); } -@safe unittest // Issue 10460 +// https://issues.dlang.org/show_bug.cgi?id=10460 +@safe unittest { import std.algorithm.comparison : equal; auto a = [1, 2, 3, 4]; @@ -5143,14 +5152,16 @@ if (isInputRange!Range) assert(equal(a, [0, 0, 3, 4])); } -@safe unittest // Issue 13124 +// https://issues.dlang.org/show_bug.cgi?id=13124 +@safe unittest { import std.algorithm.comparison : among, equal; auto s = "hello how\nare you"; assert(equal(s.until!(c => c.among!('\n', '\r')), "hello how")); } -pure @safe unittest // issue 18657 +// https://issues.dlang.org/show_bug.cgi?id=18657 +pure @safe unittest { import std.algorithm.comparison : equal; import std.range : refRange; diff --git a/std/algorithm/setops.d b/std/algorithm/setops.d index d6c05b54077..e80791a182d 100644 --- a/std/algorithm/setops.d +++ b/std/algorithm/setops.d @@ -346,7 +346,7 @@ if (!allSatisfy!(isForwardRange, R1, R2) || } } -// Issue 13091 +// https://issues.dlang.org/show_bug.cgi?id=13091 pure nothrow @safe @nogc unittest { int[1] a = [1]; @@ -421,9 +421,10 @@ if (ranges.length >= 2 && return Result(ranges); } +// cartesian product of empty ranges should be empty +// https://issues.dlang.org/show_bug.cgi?id=10693 @safe unittest { - // Issue 10693: cartesian product of empty ranges should be empty. int[] a, b, c, d, e; auto cprod = cartesianProduct(a,b,c,d,e); assert(cprod.empty); @@ -445,9 +446,9 @@ if (ranges.length >= 2 && assert(cprod.init.empty); } +// https://issues.dlang.org/show_bug.cgi?id=13393 @safe unittest { - // Issue 13393 assert(!cartesianProduct([0],[0],[0]).save.empty); } @@ -506,7 +507,7 @@ if (!allSatisfy!(isForwardRange, R1, R2, RR) || assert(canFind(N4, tuple(10, 3, 1, 2))); } -// Issue 9878 +// https://issues.dlang.org/show_bug.cgi?id=9878 /// @safe unittest { @@ -545,7 +546,7 @@ pure @safe nothrow @nogc unittest assert(D.front == front1); } -// Issue 13935 +// https://issues.dlang.org/show_bug.cgi?id=13935 @safe unittest { import std.algorithm.iteration : map; @@ -1109,7 +1110,8 @@ SetDifference!(less, R1, R2) setDifference(alias less = "a < b", R1, R2) assert(setDifference(r, x).empty); } -@safe unittest // Issue 10460 +// https://issues.dlang.org/show_bug.cgi?id=10460 +@safe unittest { import std.algorithm.comparison : equal; @@ -1429,7 +1431,8 @@ setSymmetricDifference(alias less = "a < b", R1, R2) assert(equal(setSymmetricDifference(c, d), [1, 1, 2, 5, 6, 7, 9])); } -@safe unittest // Issue 10460 +// https://issues.dlang.org/show_bug.cgi?id=10460 +@safe unittest { import std.algorithm.comparison : equal; diff --git a/std/algorithm/sorting.d b/std/algorithm/sorting.d index 9e88a2326e7..affe2aada0b 100644 --- a/std/algorithm/sorting.d +++ b/std/algorithm/sorting.d @@ -224,7 +224,7 @@ if (isForwardRange!(Range)) { import std.conv : to; - // Issue 9457 + // https://issues.dlang.org/show_bug.cgi?id=9457 auto x = "abcd"; assert(isSorted(x)); auto y = "acbd"; @@ -1563,7 +1563,8 @@ private void multiSortImpl(Range, SwapStrategy ss, funs...)(Range r) assert(pts4.multiSort!("a > b").release.equal(iota(10).retro)); } -@safe unittest //issue 9160 (L-value only comparators) +//https://issues.dlang.org/show_bug.cgi?id=9160 (L-value only comparators) +@safe unittest { static struct A { @@ -1587,7 +1588,9 @@ private void multiSortImpl(Range, SwapStrategy ss, funs...)(Range r) assert(points[1] == A(4, 1)); } -@safe unittest // issue 16179 (cannot access frame of function) +// cannot access frame of function +// https://issues.dlang.org/show_bug.cgi?id=16179 +@safe unittest { auto arr = [[1, 2], [2, 0], [1, 0], [1, 1]]; int c = 3; @@ -1599,7 +1602,8 @@ private void multiSortImpl(Range, SwapStrategy ss, funs...)(Range r) assert(arr == [[1, 0], [1, 1], [1, 2], [2, 0]]); } -@safe unittest //Issue 16413 - @system comparison function +// https://issues.dlang.org/show_bug.cgi?id=16413 - @system comparison function +@safe unittest { bool lt(int a, int b) { return a < b; } static @system auto a = [2, 1]; @@ -2015,14 +2019,14 @@ if (((ss == SwapStrategy.unstable && (hasSwappableElements!Range || assert(isSorted!("toUpper(a) < toUpper(b)")(b)); { - // Issue 10317 + // https://issues.dlang.org/show_bug.cgi?id=10317 enum E_10317 { a, b } auto a_10317 = new E_10317[10]; sort(a_10317); } { - // Issue 7767 + // https://issues.dlang.org/show_bug.cgi?id=7767 // Unstable sort should complete without an excessive number of predicate calls // This would suggest it's running in quadratic time @@ -2137,7 +2141,7 @@ package(std) template HeapOps(alias less, Range) alias lessFun = binaryFun!less; - //template because of @@@12410@@@ + //template because of https://issues.dlang.org/show_bug.cgi?id=12410 void heapSort()(Range r) { // If true, there is nothing to do @@ -2152,7 +2156,7 @@ package(std) template HeapOps(alias less, Range) } } - //template because of @@@12410@@@ + //template because of https://issues.dlang.org/show_bug.cgi?id=12410 void buildHeap()(Range r) { immutable n = r.length; @@ -2177,7 +2181,7 @@ package(std) template HeapOps(alias less, Range) // Sifts down r[parent] (which is initially assumed to be messed up) so the // heap property is restored for r[parent .. end]. - // template because of @@@12410@@@ + // template because of https://issues.dlang.org/show_bug.cgi?id=12410 void siftDown()(Range r, size_t parent, immutable size_t end) { for (;;) @@ -2205,7 +2209,7 @@ package(std) template HeapOps(alias less, Range) // restored. So there are more swaps but fewer comparisons. Gains are made // when the final position is likely to end toward the bottom of the heap, // so not a lot of sifts back are performed. - //template because of @@@12410@@@ + //template because of https://issues.dlang.org/show_bug.cgi?id=12410 void percolate()(Range r, size_t parent, immutable size_t end) { immutable root = parent; @@ -2873,8 +2877,9 @@ private template TimSortImpl(alias pred, R) assert(result == true, "invalid result"); } +// https://issues.dlang.org/show_bug.cgi?id=4584 @safe unittest -{//bugzilla 4584 +{ assert(isSorted!"a < b"(sort!("a < b", SwapStrategy.stable)( [83, 42, 85, 86, 87, 22, 89, 30, 91, 46, 93, 94, 95, 6, 97, 14, 33, 10, 101, 102, 103, 26, 105, 106, 107, 6] @@ -2894,9 +2899,9 @@ private template TimSortImpl(alias pred, R) assert(y == "aebcd"d); } +// https://issues.dlang.org/show_bug.cgi?id=14223 @safe unittest { - // Issue 14223 import std.array, std.range; auto arr = chain(iota(0, 384), iota(0, 256), iota(0, 80), iota(0, 64), iota(0, 96)).array; sort!("a < b", SwapStrategy.stable)(arr); @@ -3081,33 +3086,33 @@ if (isRandomAccessRange!R && hasLength!R && hasSwappableElements!R) assert(strings == [ "three", "two", "one" ]); } +// https://issues.dlang.org/show_bug.cgi?id=4909 @safe unittest { - // issue 4909 import std.typecons : Tuple; Tuple!(char)[] chars; schwartzSort!"a[0]"(chars); } +// https://issues.dlang.org/show_bug.cgi?id=5924 @safe unittest { - // issue 5924 import std.typecons : Tuple; Tuple!(char)[] chars; schwartzSort!((Tuple!(char) c){ return c[0]; })(chars); } +// https://issues.dlang.org/show_bug.cgi?id=13965 @safe unittest { - // issue 13965 import std.typecons : Tuple; Tuple!(char)[] chars; schwartzSort!("a[0]", SwapStrategy.stable)(chars); } +// https://issues.dlang.org/show_bug.cgi?id=13965 @safe unittest { - // issue 13965 import std.algorithm.iteration : map; import std.numeric : entropy; @@ -3670,7 +3675,7 @@ done: } } -// bug 12987 +// https://issues.dlang.org/show_bug.cgi?id=12987 @safe unittest { int[] a = [ 25, 7, 9, 2, 0, 5, 21 ]; @@ -3720,7 +3725,7 @@ if (isRandomAccessRange!(Range1) && hasLength!Range1 && assert(a == [0, 1, 2, 2, 3]); } -// bug 15421 +// https://issues.dlang.org/show_bug.cgi?id=15421 @system unittest { import std.algorithm.comparison : equal; @@ -3764,7 +3769,7 @@ if (isRandomAccessRange!(Range1) && hasLength!Range1 && } } -// bug 15421 +// https://issues.dlang.org/show_bug.cgi?id=15421 @system unittest { auto a = [ 9, 8, 0, 3, 5, 25, 43, 4, 2, 0, 7 ]; @@ -3783,7 +3788,7 @@ if (isRandomAccessRange!(Range1) && hasLength!Range1 && assert(a == b); } -// bug 12987 +// https://issues.dlang.org/show_bug.cgi?id=12987 @system unittest { int[] a = [ 5, 7, 2, 6, 7 ]; @@ -3793,7 +3798,7 @@ if (isRandomAccessRange!(Range1) && hasLength!Range1 && assert(t == [ 0, 1, 2, 2, 3 ]); } -// bug 15420 +// https://issues.dlang.org/show_bug.cgi?id=15420 @system unittest { int[] a = [ 5, 7, 2, 6, 7 ]; @@ -4386,7 +4391,7 @@ if (isBidirectionalRange!BidirectionalRange && assert(a == [3,2,1]); } -// Issue 13594 +// https://issues.dlang.org/show_bug.cgi?id=13594 @safe unittest { int[3] a = [1,2,3]; @@ -4561,9 +4566,9 @@ if (isBidirectionalRange!BidirectionalRange && assert(b == [ 1, 3, 2 ]); } +// https://issues.dlang.org/show_bug.cgi?id=13594 @safe unittest { - // Issue 13594 int[3] a = [1,2,3]; assert(nextEvenPermutation(a[])); assert(a == [2,3,1]); diff --git a/std/array.d b/std/array.d index 651e3c8d0a0..c8818bd349c 100644 --- a/std/array.d +++ b/std/array.d @@ -207,9 +207,9 @@ if (isPointer!Range && isIterable!(PointerTarget!Range) && !isNarrowString!Range assert(equal(a, [Foo(1), Foo(2), Foo(3), Foo(4), Foo(5)])); } +// https://issues.dlang.org/show_bug.cgi?id=12315 @safe unittest { - // Issue 12315 static struct Bug12315 { immutable int i; } enum bug12315 = [Bug12315(123456789)].array(); static assert(bug12315[0].i == 123456789); @@ -226,9 +226,9 @@ if (isPointer!Range && isIterable!(PointerTarget!Range) && !isNarrowString!Range version (StdUnittest) private extern(C) void _d_delarray_t(void[] *p, TypeInfo_Struct ti); +// https://issues.dlang.org/show_bug.cgi?id=18995 @system unittest { - // Issue 18995 int nAlive = 0; struct S { @@ -343,7 +343,7 @@ if (isNarrowString!String) assert(array("ABC".dup) == "ABC"d.dup); } -//Bug# 8233 +// https://issues.dlang.org/show_bug.cgi?id=8233 @safe unittest { assert(array("hello world"d) == "hello world"d); @@ -371,9 +371,9 @@ if (isNarrowString!String) }} } +// https://issues.dlang.org/show_bug.cgi?id=9824 @safe unittest { - //9824 static struct S { @disable void opAssign(S); @@ -383,7 +383,7 @@ if (isNarrowString!String) arr.array(); } -// Bugzilla 10220 +// https://issues.dlang.org/show_bug.cgi?id=10220 @safe unittest { import std.algorithm.comparison : equal; @@ -554,7 +554,8 @@ if (isInputRange!Values && isInputRange!Keys) assert(c == expected); } -// @@@11053@@@ - Cannot be version (StdUnittest) - recursive instantiation error +// Cannot be version (StdUnittest) - recursive instantiation error +// https://issues.dlang.org/show_bug.cgi?id=11053 @safe unittest { import std.typecons; @@ -564,7 +565,7 @@ if (isInputRange!Values && isInputRange!Keys) assert([ tuple("foo", "bar") ].assocArray() == ["foo": "bar"]); } -// Issue 13909 +// https://issues.dlang.org/show_bug.cgi?id=13909 @safe unittest { import std.typecons; @@ -726,7 +727,7 @@ if (isAssociativeArray!AA) assert(savedPairs.front == tuple("a", 2)); } -// Issue 17711 +// https://issues.dlang.org/show_bug.cgi?id=17711 @safe unittest { const(int[string]) aa = [ "abc": 123 ]; @@ -988,7 +989,8 @@ private auto arrayAllocImpl(bool minimallyInitialized, T, I...)(I sizes) nothrow assert(s2.length == 0); } -@safe nothrow pure unittest //@@@9803@@@ +// https://issues.dlang.org/show_bug.cgi?id=9803 +@safe nothrow pure unittest { auto a = minimallyInitializedArray!(int*[])(1); assert(a[0] == null); @@ -998,7 +1000,8 @@ private auto arrayAllocImpl(bool minimallyInitialized, T, I...)(I sizes) nothrow assert(c[0][0] == null); } -@safe unittest //@@@10637@@@ +// https://issues.dlang.org/show_bug.cgi?id=10637 +@safe unittest { static struct S { @@ -1141,7 +1144,8 @@ if (is(typeof(a.ptr < b.ptr) == bool)) assert(overlap(c, d.idup).empty); } -@safe pure nothrow unittest // bugzilla 9836 + // https://issues.dlang.org/show_bug.cgi?id=9836 +@safe pure nothrow unittest { // range primitives for array should work with alias this types struct Wrapper @@ -1523,7 +1527,8 @@ private template isInputRangeOrConvertible(E) }); } -@system unittest // bugzilla 6874 +// https://issues.dlang.org/show_bug.cgi?id=6874 +@system unittest { import core.memory; // allocate some space @@ -2003,7 +2008,8 @@ if (isInputRange!RoR && } } -@safe unittest // Issue 14230 +// https://issues.dlang.org/show_bug.cgi?id=14230 +@safe unittest { string[] ary = ["","aa","bb","cc"]; // leaded by _empty_ element assert(ary.join(" @") == " @aa @bb @cc"); // OK in 2.067b1 and olders @@ -2077,7 +2083,8 @@ if (isInputRange!RoR && } } -@safe unittest // Issue 10895 +// https://issues.dlang.org/show_bug.cgi?id=10895 +@safe unittest { class A { @@ -2092,7 +2099,8 @@ if (isInputRange!RoR && assert(temp.length == 3); } -@safe unittest // Issue 14230 +// https://issues.dlang.org/show_bug.cgi?id=14230 +@safe unittest { string[] ary = ["","aa","bb","cc"]; assert(ary.join('@') == "@aa@bb@cc"); @@ -2321,7 +2329,7 @@ if (isInputRange!RoR && assert(join(f([f([1, 2]), f([41, 42])]), f([5, 6])) == [1, 2, 5, 6, 41, 42]); } -// Issue 10683 +// https://issues.dlang.org/show_bug.cgi?id=10683 @safe unittest { import std.range : join; @@ -2330,7 +2338,7 @@ if (isInputRange!RoR && assert([[tuple("x")]].join == [tuple("x")]); } -// Issue 13877 +// https://issues.dlang.org/show_bug.cgi?id=13877 @safe unittest { // Test that the range is iterated only once. @@ -2723,7 +2731,7 @@ if (isInputRange!Range && assert(replace(d, 5, 10, "⁴³²¹⁰"d) == "⁰¹²³⁴⁴³²¹⁰"d); } -// Issue 18166 +// https://issues.dlang.org/show_bug.cgi?id=18166 @safe pure unittest { auto str = replace("aaaaa"d, 1, 4, "***"d); @@ -2793,9 +2801,9 @@ if (is(typeof(replace(array, from, to, stuff)))) assert(a == [1, 4, 5, 5]); } +// https://issues.dlang.org/show_bug.cgi?id=12889 @safe unittest { - // Bug# 12889 int[1][] arr = [[0], [1], [2], [3], [4], [5], [6]]; int[1][] stuff = [[0], [1]]; replaceInPlace(arr, 4, 6, stuff); @@ -2804,7 +2812,7 @@ if (is(typeof(replace(array, from, to, stuff)))) @system unittest { - // Bug# 14925 + // https://issues.dlang.org/show_bug.cgi?id=14925 char[] a = "mon texte 1".dup; char[] b = "abc".dup; replaceInPlace(a, 4, 9, b); @@ -3030,7 +3038,7 @@ if (isDynamicArray!(E[]) && } } -//Bug# 8187 +// https://issues.dlang.org/show_bug.cgi?id=8187 @safe unittest { auto res = ["a", "a"]; @@ -3636,7 +3644,8 @@ if (isDynamicArray!A) assert(app3[] == "Appender!(int[])(0001, 0002, 0003)"); } -@safe unittest // issue 17251 +// https://issues.dlang.org/show_bug.cgi?id=17251 +@safe unittest { static struct R { @@ -3651,7 +3660,8 @@ if (isDynamicArray!A) app.put(r[]); } -@safe unittest // issue 13300 +// https://issues.dlang.org/show_bug.cgi?id=13300 +@safe unittest { static test(bool isPurePostblit)() { @@ -3686,7 +3696,8 @@ if (isDynamicArray!A) static assert(!__traits(compiles, () pure { test!false(); })); } -@system unittest // issue 19572 +// https://issues.dlang.org/show_bug.cgi?id=19572 +@system unittest { static struct Struct { @@ -3907,7 +3918,8 @@ Appender!(E[]) appender(A : E[], E)(auto ref A array) } catch (Exception) assert(0); - // Issue 5663 & 9725 tests + // https://issues.dlang.org/show_bug.cgi?id=5663 + // https://issues.dlang.org/show_bug.cgi?id=9725 static foreach (S; AliasSeq!(char[], const(char)[], string)) { { @@ -4022,11 +4034,11 @@ unittest } } +// https://issues.dlang.org/show_bug.cgi?id=10690 @safe unittest { import std.algorithm; import std.typecons; - //10690 [tuple(1)].filter!(t => true).array; // No error [tuple("A")].filter!(t => true).array; // error } @@ -4096,9 +4108,9 @@ unittest a2.put([s2]); } +// https://issues.dlang.org/show_bug.cgi?id=9528 @safe unittest { - //9528 const(E)[] fastCopy(E)(E[] src) { auto app = appender!(const(E)[])(); foreach (i, e; src) @@ -4114,10 +4126,10 @@ unittest assert(t.length == 1); } +// https://issues.dlang.org/show_bug.cgi?id=10753 @safe unittest { import std.algorithm.iteration : map; - //10753 struct Foo { immutable dchar d; } @@ -4237,7 +4249,7 @@ unittest @system unittest { - // Issue 13077 + // https://issues.dlang.org/show_bug.cgi?id=13077 static class A {} // reduced case @@ -4336,7 +4348,8 @@ unittest assert(app3[] == [1, 2, 3]); } -@safe unittest // issue 14605 +// https://issues.dlang.org/show_bug.cgi?id=14605 +@safe unittest { static assert(isOutputRange!(Appender!(int[]), int)); static assert(isOutputRange!(RefAppender!(int[]), int)); @@ -4526,7 +4539,7 @@ nothrow pure @safe unittest // Tests that code compiles when there is an elaborate destructor and exceptions // are thrown. Unfortunately can't test that memory is initialized // before having a destructor called on it. -// @system required because of issue 18872. +// @system required because of https://issues.dlang.org/show_bug.cgi?id=18872. @system nothrow unittest { // exists only to allow doing something in the destructor. Not tested diff --git a/std/base64.d b/std/base64.d index 3991313f59a..cb8abad0540 100644 --- a/std/base64.d +++ b/std/base64.d @@ -476,12 +476,6 @@ template Base64Impl(char Map62th, char Map63th, char Padding = '=') size_t encode(R1, R2)(R1 source, auto ref R2 range) if (!isArray!R1 && isInputRange!R1 && is(ElementType!R1 : ubyte) && hasLength!R1 && !is(R2 == char[]) && isOutputRange!(R2, char)) - out(result) - { - // @@@BUG@@@ Workaround for DbC problem. - //assert(result == encodeLength(source.length), "The number of put is different from the length of Base64"); - } - do { immutable srcLen = source.length; if (srcLen == 0) @@ -1077,12 +1071,6 @@ template Base64Impl(char Map62th, char Map63th, char Padding = '=') { assert(buffer.length >= decodeLength(source.length), "Insufficient buffer for decoding"); } - out(result) - { - // @@@BUG@@@ Workaround for DbC problem. - //immutable expect = decodeLength(source.length) - 2; - //assert(result.length >= expect, "The length of result is smaller than expected length"); - } do { immutable srcLen = source.length; @@ -1135,7 +1123,7 @@ template Base64Impl(char Map62th, char Map63th, char Padding = '=') } } - // @@@BUG@@@ Workaround for DbC problem. + // We need to do the check here because we have consumed the length version (StdUnittest) assert( (bufptr - buffer.ptr) >= (decodeLength(srcLen) - 2), @@ -1908,7 +1896,8 @@ class Base64Exception : Exception assert(tv["foobar"] == b.data); a.clear(); b.clear(); } - // @@@9543@@@ These tests were disabled because they actually relied on the input range having length. + // https://issues.dlang.org/show_bug.cgi?id=9543 + // These tests were disabled because they actually relied on the input range having length. // The implementation (currently) doesn't support encoding/decoding from a length-less source. version (none) { // with InputRange diff --git a/std/bigint.d b/std/bigint.d index 1f50e24fef0..53b88373212 100644 --- a/std/bigint.d +++ b/std/bigint.d @@ -311,7 +311,7 @@ public: assert(b == BigInt("200_002_469")); } - // Issue 16264 + // https://issues.dlang.org/show_bug.cgi?id=16264 @safe unittest { auto a = BigInt( @@ -1607,7 +1607,7 @@ unittest assert(BigInt(-0x1234_5678_9ABC_5A5AL).toLong() == -0x1234_5678_9ABC_5A5AL); assert(BigInt(0xF234_5678_9ABC_5A5AL).toLong() == long.max); assert(BigInt(-0x123456789ABCL).toInt() == -int.max); - char[] s1 = "123".dup; // bug 8164 + char[] s1 = "123".dup; // https://issues.dlang.org/show_bug.cgi?id=8164 assert(BigInt(s1) == 123); char[] s2 = "0xABC".dup; assert(BigInt(s2) == 2748); @@ -1619,10 +1619,10 @@ unittest b = long.max / a; assert( b == long.max /(ulong.max - 5)); assert(BigInt(1) - 1 == 0); - assert((-4) % BigInt(5) == -4); // bug 5928 + assert((-4) % BigInt(5) == -4); // https://issues.dlang.org/show_bug.cgi?id=5928 assert(BigInt(-4) % BigInt(5) == -4); - assert(BigInt(2)/BigInt(-3) == BigInt(0)); // bug 8022 - assert(BigInt("-1") > long.min); // bug 9548 + assert(BigInt(2)/BigInt(-3) == BigInt(0)); // https://issues.dlang.org/show_bug.cgi?id=8022 + assert(BigInt("-1") > long.min); // https://issues.dlang.org/show_bug.cgi?id=9548 assert(toDecimalString(BigInt("0000000000000000000000000000000000000000001234567")) == "1234567"); @@ -1649,7 +1649,8 @@ unittest assert((BigInt(int.min)-1)%int.min == -1); } -@safe unittest // Recursive division, bug 5568 + // Recursive division (https://issues.dlang.org/show_bug.cgi?id=5568) +@safe unittest { enum Z = 4843; BigInt m = (BigInt(1) << (Z*8) ) - 1; @@ -1669,17 +1670,17 @@ unittest BigInt w = c - b + a; assert(w % m == 0); - // Bug 6819. ^^ + // https://issues.dlang.org/show_bug.cgi?id=6819 BigInt z1 = BigInt(10)^^64; BigInt w1 = BigInt(10)^^128; assert(z1^^2 == w1); BigInt z2 = BigInt(1)<<64; BigInt w2 = BigInt(1)<<128; assert(z2^^2 == w2); - // Bug 7993 + // https://issues.dlang.org/show_bug.cgi?id=7993 BigInt n7793 = 10; assert( n7793 / 1 == 10); - // Bug 7973 + // https://issues.dlang.org/show_bug.cgi?id=7973 auto a7973 = 10_000_000_000_000_000; const c7973 = 10_000_000_000_000_000; immutable i7973 = 10_000_000_000_000_000; @@ -1690,7 +1691,7 @@ unittest assert(v7973 == 2551700137); v7973 %= i7973; assert(v7973 == 2551700137); - // 8165 + // https://issues.dlang.org/show_bug.cgi?id=8165 BigInt[2] a8165; a8165[0] = a8165[1] = 1; } @@ -1848,7 +1849,7 @@ unittest } } -// 6448 +// https://issues.dlang.org/show_bug.cgi?id=6448 @safe unittest { import std.array; @@ -1862,7 +1863,7 @@ unittest BigInt bx = x; formattedWrite(w2, "%010d", bx); assert(w1.data == w2.data); - //8011 + // https://issues.dlang.org/show_bug.cgi?id=8011 BigInt y = -3; ++y; assert(y.toLong() == -2); @@ -1878,12 +1879,12 @@ unittest @safe unittest { import std.math : abs; - auto r = abs(BigInt(-1000)); // 6486 + auto r = abs(BigInt(-1000)); // https://issues.dlang.org/show_bug.cgi?id=6486 assert(r == 1000); - auto r2 = abs(const(BigInt)(-500)); // 11188 + auto r2 = abs(const(BigInt)(-500)); // https://issues.dlang.org/show_bug.cgi?id=11188 assert(r2 == 500); - auto r3 = abs(immutable(BigInt)(-733)); // 11188 + auto r3 = abs(immutable(BigInt)(-733)); // https://issues.dlang.org/show_bug.cgi?id=11188 assert(r3 == 733); // opCast!bool @@ -1891,7 +1892,8 @@ unittest assert(one && !zero); } -@safe unittest // 6850 +// https://issues.dlang.org/show_bug.cgi?id=6850 +@safe unittest { pure long pureTest() { BigInt a = 1; @@ -1903,7 +1905,9 @@ unittest assert(pureTest() == 1337); } -@safe unittest // 8435 & 10118 +// https://issues.dlang.org/show_bug.cgi?id=8435 +// https://issues.dlang.org/show_bug.cgi?id=10118 +@safe unittest { auto i = BigInt(100); auto j = BigInt(100); @@ -1927,7 +1931,8 @@ unittest assert(keys.empty); } -@safe unittest // 11148 +// https://issues.dlang.org/show_bug.cgi?id=11148 +@safe unittest { void foo(BigInt) {} const BigInt cbi = 3; @@ -1965,14 +1970,16 @@ unittest assert(n == 4); } -@safe unittest // 8167 +// https://issues.dlang.org/show_bug.cgi?id=8167 +@safe unittest { BigInt a = BigInt(3); BigInt b = BigInt(a); assert(b == 3); } -@safe unittest // 9061 +// https://issues.dlang.org/show_bug.cgi?id=9061 +@safe unittest { long l1 = 0x12345678_90ABCDEF; long l2 = 0xFEDCBA09_87654321; @@ -1991,7 +1998,8 @@ unittest assert(l5 == b5); } -@safe unittest // 11600 +// https://issues.dlang.org/show_bug.cgi?id=11600 +@safe unittest { import std.conv; import std.exception : assertThrown; @@ -2006,13 +2014,15 @@ unittest assertThrown!ConvException(to!BigInt("-123four")); } -@safe unittest // 11583 +// https://issues.dlang.org/show_bug.cgi?id=11583 +@safe unittest { BigInt x = 0; assert((x > 0) == false); } -@safe unittest // 13391 +// https://issues.dlang.org/show_bug.cgi?id=13391 +@safe unittest { BigInt x1 = "123456789"; BigInt x2 = "123456789123456789"; @@ -2043,7 +2053,8 @@ unittest assert(x2 == 1); } -@safe unittest // 13963 +// https://issues.dlang.org/show_bug.cgi?id=13963 +@safe unittest { BigInt x = 1; import std.meta : AliasSeq; @@ -2094,7 +2105,8 @@ unittest assert(-x2 % ulong.max == -x2); } -@safe unittest // 14124 +// https://issues.dlang.org/show_bug.cgi?id=14124 +@safe unittest { auto x = BigInt(-3); x %= 3; @@ -2117,7 +2129,7 @@ unittest assert(x.isZero()); } -// issue 15678 +// https://issues.dlang.org/show_bug.cgi?id=15678 @safe unittest { import std.exception : assertThrown; @@ -2126,7 +2138,7 @@ unittest assertThrown!ConvException(BigInt("1234PUKE")); } -// Issue 6447 +// https://issues.dlang.org/show_bug.cgi?id=6447 @safe unittest { import std.algorithm.comparison : equal; @@ -2142,14 +2154,15 @@ unittest ])); } -// Issue 17330 +// https://issues.dlang.org/show_bug.cgi?id=17330 @safe unittest { auto b = immutable BigInt("123"); assert(b == 123); } -@safe pure unittest // issue 14767 +// https://issues.dlang.org/show_bug.cgi?id=14767 +@safe pure unittest { static immutable a = BigInt("340282366920938463463374607431768211455"); assert(a == BigInt("340282366920938463463374607431768211455")); @@ -2197,7 +2210,7 @@ void divMod(const BigInt dividend, const BigInt divisor, out BigInt quotient, ou assert(q * b + r == a); } -// Issue 18086 +// https://issues.dlang.org/show_bug.cgi?id=18086 @safe pure nothrow unittest { BigInt q = 1; @@ -2226,7 +2239,7 @@ void divMod(const BigInt dividend, const BigInt divisor, out BigInt quotient, ou assert(q * d + r == -c); } -// Issue 19740 +// https://issues.dlang.org/show_bug.cgi?id=19740 @safe unittest { BigInt a = BigInt( diff --git a/std/bitmanip.d b/std/bitmanip.d index 5f0c8dbccea..bd642130f49 100644 --- a/std/bitmanip.d +++ b/std/bitmanip.d @@ -397,7 +397,9 @@ if (is(T == class)) @safe pure nothrow @nogc unittest { - // Degenerate bitfields (#8474 / #11160) tests mixed with range tests + // Degenerate bitfields tests mixed with range tests + // https://issues.dlang.org/show_bug.cgi?id=8474 + // https://issues.dlang.org/show_bug.cgi?id=11160 struct Test1 { mixin(bitfields!(uint, "a", 32, @@ -525,9 +527,9 @@ unittest static assert(!__traits(compiles, bar(s))); } +// https://issues.dlang.org/show_bug.cgi?id=6686 @safe unittest { - // Bug #6686 union S { ulong bits = ulong.max; mixin (bitfields!( @@ -542,9 +544,9 @@ unittest assert(num.bits == 0xFFFF_FFFF_8000_0001uL); } +// https://issues.dlang.org/show_bug.cgi?id=5942 @safe unittest { - // Bug #5942 struct S { mixin(bitfields!( @@ -607,7 +609,7 @@ unittest assert(i.checkExpectations(true, 7, 7)); } - //Bug# 8876 + //https://issues.dlang.org/show_bug.cgi?id=8876 { struct MoreIntegrals { bool checkExpectations(uint eu, ushort es, uint ei) { return u == eu && s == es && i == ei; } @@ -660,7 +662,7 @@ unittest assert(f.checkExpectations(true)); } -// Issue 12477 +// https://issues.dlang.org/show_bug.cgi?id=12477 @system unittest { import core.exception : AssertError; @@ -868,9 +870,9 @@ struct DoubleRep assert(x.value == -5.0); } +// https://issues.dlang.org/show_bug.cgi?id=15305 @safe unittest { - // Issue #15305 struct S { mixin(bitfields!( bool, "alice", 1, @@ -1126,7 +1128,7 @@ public: return _len; } - // Issue 20240 + // https://issues.dlang.org/show_bug.cgi?id=20240 @system unittest { BitArray ba; @@ -2382,7 +2384,7 @@ public: } } - // Issue 17467 + // https://issues.dlang.org/show_bug.cgi?id=17467 @system unittest { import std.algorithm.comparison : equal; @@ -2403,7 +2405,8 @@ public: assert(equal(b.bitsSet, iota(64, 128))); } - // Issue 18134 - shifting right when length is a multiple of 8 * size_t.sizeof. + // https://issues.dlang.org/show_bug.cgi?id=18134 + // shifting right when length is a multiple of 8 * size_t.sizeof. @system unittest { import std.algorithm.comparison : equal; @@ -2613,7 +2616,7 @@ public: assert(b.bitsSet.equal(iota(wordBits * 2))); } - // Issue 20241 + // https://issues.dlang.org/show_bug.cgi?id=20241 @system unittest { BitArray ba; @@ -2827,7 +2830,7 @@ if (isIntegral!T || isSomeChar!T || isBoolean!T) static if (isSigned!T) assert(swapEndian(swapEndian(cast(T) 0)) == 0); - // used to trigger BUG6354 + // used to trigger https://issues.dlang.org/show_bug.cgi?id=6354 static if (T.sizeof > 1 && isUnsigned!T) { T left = 0xffU; @@ -3838,7 +3841,7 @@ if (canSwapEndianness!T && isInputRange!R && is(ElementType!R : const ubyte)) } } -// issue 17247 +// https://issues.dlang.org/show_bug.cgi?id=17247 @safe unittest { struct UbyteRange diff --git a/std/complex.d b/std/complex.d index 73bafbb2867..b9e597a297b 100644 --- a/std/complex.d +++ b/std/complex.d @@ -1013,7 +1013,8 @@ Complex!T sqrt(T)(Complex!T z) @safe pure nothrow @nogc assert(approxEqual(c2s.im, 0.8836155)); } -// Issue 10881: support %f formatting of complex numbers +// support %f formatting of complex numbers +// https://issues.dlang.org/show_bug.cgi?id=10881 @safe unittest { import std.format : format; diff --git a/std/concurrency.d b/std/concurrency.d index 44fb99b57ec..e63ac97379d 100644 --- a/std/concurrency.d +++ b/std/concurrency.d @@ -98,9 +98,9 @@ private static assert(!hasLocalAliasing!(Tid, Container, int)); } + // https://issues.dlang.org/show_bug.cgi?id=20097 @safe unittest { - /* Issue 20097 */ import std.datetime.systime : SysTime; static struct Container { SysTime time; } static assert(!hasLocalAliasing!(SysTime, Container)); @@ -1164,7 +1164,7 @@ struct ThreadInfo unregisterMe(this); // clean up registry entries } - // issue 20160 + // https://issues.dlang.org/show_bug.cgi?id=20160 @system unittest { register("main_thread", thisTid()); diff --git a/std/container/array.d b/std/container/array.d index 85c1246dab3..436afde851f 100644 --- a/std/container/array.d +++ b/std/container/array.d @@ -80,7 +80,7 @@ pure @system unittest private struct RangeT(A) { - /* Workaround for Issue 13629 at https://issues.dlang.org/show_bug.cgi?id=13629 + /* Workaround for https://issues.dlang.org/show_bug.cgi?id=13629 See also: http://forum.dlang.org/post/vbmwhzvawhnkoxrhbnyb@forum.dlang.org */ private A[1] _outer_; @@ -1280,7 +1280,8 @@ if (!is(Unqual!T == bool)) assert(a.length == 7); assert(equal(a[1 .. 4], [1, 2, 3])); } -// Test issue 5920 + +// https://issues.dlang.org/show_bug.cgi?id=5920 @system unittest { struct structBug5920 @@ -1319,7 +1320,9 @@ if (!is(Unqual!T == bool)) } assert(dMask == 0b1111_1111); // make sure the d'tor is called once only. } -// Test issue 5792 (mainly just to check if this piece of code is compilable) + +// Test for https://issues.dlang.org/show_bug.cgi?id=5792 +// (mainly just to check if this piece of code is compilable) @system unittest { auto a = Array!(int[])([[1,2],[3,4]]); @@ -1478,7 +1481,8 @@ if (!is(Unqual!T == bool)) arr ~= s; } -@safe unittest //11459 +// https://issues.dlang.org/show_bug.cgi?id=11459 +@safe unittest { static struct S { @@ -1489,18 +1493,21 @@ if (!is(Unqual!T == bool)) alias B = Array!(shared bool); } -@system unittest //11884 +// https://issues.dlang.org/show_bug.cgi?id=11884 +@system unittest { import std.algorithm.iteration : filter; auto a = Array!int([1, 2, 2].filter!"true"()); } -@safe unittest //8282 +// https://issues.dlang.org/show_bug.cgi?id=8282 +@safe unittest { auto arr = new Array!int; } -@system unittest //6998 +// https://issues.dlang.org/show_bug.cgi?id=6998 +@system unittest { static int i = 0; class C @@ -1525,7 +1532,9 @@ if (!is(Unqual!T == bool)) //Just to make sure the GC doesn't collect before the above test. assert(c.dummy == 1); } -@system unittest //6998-2 + +//https://issues.dlang.org/show_bug.cgi?id=6998 (2) +@system unittest { static class C {int i;} auto c = new C; @@ -1586,7 +1595,7 @@ if (!is(Unqual!T == bool)) } /** - * issue 20589 - typeof may give wrong result in case of classes defining `opCall` operator + * typeof may give wrong result in case of classes defining `opCall` operator * https://issues.dlang.org/show_bug.cgi?id=20589 * * destructor std.container.array.Array!(MyClass).Array.~this is @system @@ -2248,7 +2257,7 @@ if (is(Unqual!T == bool)) slice.front = true; slice.back = true; slice[1] = true; - slice = slice[0 .. $]; // bug 19171 + slice = slice[0 .. $]; // https://issues.dlang.org/show_bug.cgi?id=19171 assert(slice.front == true); assert(slice.back == true); assert(slice[1] == true); @@ -2257,7 +2266,8 @@ if (is(Unqual!T == bool)) assert(slice.moveAt(1) == true); } -// issue 16331 - uncomparable values are valid values for an array +// uncomparable values are valid values for an array +// https://issues.dlang.org/show_bug.cgi?id=16331 @system unittest { double[] values = [double.nan, double.nan]; @@ -2518,7 +2528,8 @@ if (is(Unqual!T == bool)) assert(arr[1] == [4, 5, 6]); } -// Issue 13642 - Change of length reallocates without calling GC. +// Change of length reallocates without calling GC. +// https://issues.dlang.org/show_bug.cgi?id=13642 @system unittest { import core.memory; diff --git a/std/container/binaryheap.d b/std/container/binaryheap.d index 3e0badba938..e763357a012 100644 --- a/std/container/binaryheap.d +++ b/std/container/binaryheap.d @@ -480,7 +480,8 @@ BinaryHeap!(Store, less) heapify(alias less = "a < b", Store)(Store s, assert(h.equal([16, 14, 10, 9, 8, 7, 4, 3, 2, 1])); } -@system unittest // 15675 +// https://issues.dlang.org/show_bug.cgi?id=15675 +@system unittest { import std.container.array : Array; @@ -489,7 +490,8 @@ BinaryHeap!(Store, less) heapify(alias less = "a < b", Store)(Store s, assert(heap.front == 12); } -@system unittest // 16072 +// https://issues.dlang.org/show_bug.cgi?id=16072 +@system unittest { auto q = heapify!"a > b"([2, 4, 5]); q.insert(1); @@ -584,7 +586,8 @@ BinaryHeap!(Store, less) heapify(alias less = "a < b", Store)(Store s, assert(equal(b, [10, 9, 8, 7, 6, 6, 7, 8, 9, 10])); } -@system unittest // Issue 17314 +// https://issues.dlang.org/show_bug.cgi?id=17314 +@system unittest { import std.algorithm.comparison : equal; int[] a = [5]; diff --git a/std/container/dlist.d b/std/container/dlist.d index c0b60367554..2f67d761822 100644 --- a/std/container/dlist.d +++ b/std/container/dlist.d @@ -986,7 +986,7 @@ private: assert(r.back == 1); } -// Issue 8895 +// https://issues.dlang.org/show_bug.cgi?id=8895 @safe unittest { auto a = make!(DList!int)(1,2,3,4); @@ -1057,7 +1057,7 @@ private: { import std.algorithm.comparison : equal; - //8905 + // https://issues.dlang.org/show_bug.cgi?id=8905 auto a = DList!int([1, 2, 3, 4]); auto r = a[]; a.stableRemoveBack(); @@ -1065,7 +1065,8 @@ private: assert(a[].equal([1, 2, 3, 7])); } -@safe unittest //12566 +// https://issues.dlang.org/show_bug.cgi?id=12566 +@safe unittest { auto dl2 = DList!int([2,7]); dl2.removeFront(); @@ -1074,14 +1075,16 @@ private: assert(dl2.empty, "not empty?!"); } -@safe unittest //13076 +// https://issues.dlang.org/show_bug.cgi?id=13076 +@safe unittest { DList!int list; assert(list.empty); list.clear(); } -@safe unittest //13425 +// https://issues.dlang.org/show_bug.cgi?id=13425 +@safe unittest { import std.range : drop, take; auto list = DList!int([1,2,3,4,5]); @@ -1091,7 +1094,8 @@ private: assert(r.empty); // fails } -@safe unittest //14300 +// https://issues.dlang.org/show_bug.cgi?id=14300 +@safe unittest { interface ITest {} static class Test : ITest {} @@ -1099,7 +1103,8 @@ private: DList!ITest().insertBack(new Test()); } -@safe unittest //15263 +// https://issues.dlang.org/show_bug.cgi?id=15263 +@safe unittest { import std.range : iota; auto a = DList!int(); diff --git a/std/container/rbtree.d b/std/container/rbtree.d index 6540f93d958..b61ce4b3216 100644 --- a/std/container/rbtree.d +++ b/std/container/rbtree.d @@ -542,7 +542,8 @@ struct RBNode(V) _parent.right = null; } - // clean references to help GC - Bugzilla 12915 + // clean references to help GC + // https://issues.dlang.org/show_bug.cgi?id=12915 _left = _right = _parent = null; return ret; @@ -1948,7 +1949,7 @@ assert(equal(rbt[], [5])); test!byte(); } -// issue 19626 +// https://issues.dlang.org/show_bug.cgi?id=19626 @safe pure unittest { enum T { a, b } @@ -2185,14 +2186,15 @@ if ( is(typeof(binaryFun!less((ElementType!Stuff).init, (ElementType!Stuff).init assert(rt1.upperBound(2).equal([3, 4, 5])); } -// issue 15941 +// =https://issues.dlang.org/show_bug.cgi?id=issue 15941 @safe pure unittest { class C {} RedBlackTree!(C, "cast(void*)a < cast(void*) b") tree; } -@safe pure unittest // const/immutable elements (issue 17519) +// const/immutable elements (https://issues.dlang.org/show_bug.cgi?id=17519) +@safe pure unittest { RedBlackTree!(immutable int) t1; RedBlackTree!(const int) t2; diff --git a/std/container/slist.d b/std/container/slist.d index b494915dc16..0b504b474a8 100644 --- a/std/container/slist.d +++ b/std/container/slist.d @@ -879,9 +879,9 @@ Complexity: $(BIGOH n) auto s = make!(SList!int)(1, 2, 3); } +// https://issues.dlang.org/show_bug.cgi?id=5193 @safe unittest { - // 5193 static struct Data { const int val; @@ -899,17 +899,17 @@ Complexity: $(BIGOH n) assert(r.front == 1); } +// https://issues.dlang.org/show_bug.cgi?id=14920 @safe unittest { - // issue 14920 SList!int s; s.insertAfter(s[], 1); assert(s.front == 1); } +// https://issues.dlang.org/show_bug.cgi?id=15659 @safe unittest { - // issue 15659 SList!int s; s.clear(); } diff --git a/std/container/util.d b/std/container/util.d index 8a2a67b189e..cc273a24b71 100644 --- a/std/container/util.d +++ b/std/container/util.d @@ -32,7 +32,7 @@ if (is(T == struct) || is(T == class)) // does not initialize its payload and is equivalent // to a null reference. We therefore construct an empty container // by passing an empty array to its constructor. - // Issue #13872. + // https://issues.dlang.org/show_bug.cgi?id=13872. static if (arguments.length == 0) { import std.range.primitives : ElementType; @@ -84,7 +84,7 @@ if (is(T == struct) || is(T == class)) assert(equal(rtb2[], "ehlo"d)); } -// Issue 8895 +// https://issues.dlang.org/show_bug.cgi?id=8895 @safe unittest { import std.algorithm.comparison : equal; @@ -162,7 +162,7 @@ if (!is(Container)) assert(equal(rbtmin[], [1, 2, 3])); } -// Issue 13872 +// https://issues.dlang.org/show_bug.cgi?id=13872 @system unittest { import std.container; diff --git a/std/conv.d b/std/conv.d index 289aa6602f8..add6b7aa181 100644 --- a/std/conv.d +++ b/std/conv.d @@ -137,7 +137,7 @@ private T toStr(T, S)(S src) if (isSomeString!T) { - // workaround for Bugzilla 14198 + // workaround for https://issues.dlang.org/show_bug.cgi?id=14198 static if (is(S == bool) && is(typeof({ T s = "string"; }))) { return src ? "true" : "false"; @@ -548,9 +548,10 @@ if (isImplicitlyConvertible!(S, T) && return value; } +// https://issues.dlang.org/show_bug.cgi?id=9523: Allow identity enum conversion @safe pure nothrow unittest { - enum E { a } // Issue 9523 - Allow identity enum conversion + enum E { a } auto e = to!E(E.a); assert(e == E.a); } @@ -562,7 +563,7 @@ if (isImplicitlyConvertible!(S, T) && assert(a == b); } -// Tests for issue 6377 +// https://issues.dlang.org/show_bug.cgi?id=6377 @safe pure unittest { import std.exception; @@ -709,7 +710,7 @@ if (!isImplicitlyConvertible!(S, T) && return T(value); } -// Bugzilla 3961 +// https://issues.dlang.org/show_bug.cgi?id=3961 @safe pure unittest { struct Int @@ -738,7 +739,7 @@ if (!isImplicitlyConvertible!(S, T) && Int3 i3 = to!Int3(1); } -// Bugzilla 6808 +// https://issues.dlang.org/show_bug.cgi?id=6808 @safe pure unittest { static struct FakeBigInt @@ -1050,13 +1051,13 @@ if (!(isImplicitlyConvertible!(S, T) && } } -// Bugzilla 14042 +// https://issues.dlang.org/show_bug.cgi?id=14042 @system unittest { immutable(char)* ptr = "hello".ptr; auto result = ptr.to!(char[]); } -// Bugzilla 8384 +// https://issues.dlang.org/show_bug.cgi?id=8384 @system unittest { void test1(T)(T lp, string cmp) @@ -1103,7 +1104,7 @@ if (!(isImplicitlyConvertible!(S, T) && return w.data; } -// Bugzilla 16108 +// https://issues.dlang.org/show_bug.cgi?id=16108 @system unittest { static struct A @@ -1131,7 +1132,7 @@ if (!(isImplicitlyConvertible!(S, T) && assert(to!string(b) == "B(0, false)"); } -// Bugzilla 20070 +// https://issues.dlang.org/show_bug.cgi?id=20070 @safe unittest { void writeThem(T)(ref inout(T) them) @@ -1304,7 +1305,7 @@ if (is (T == immutable) && isExactSomeString!T && is(S == enum)) a = new A; assert(to!string(a) == "an A"); - // Bug 7660 + // https://issues.dlang.org/show_bug.cgi?id=7660 class C { override string toString() const { return "C"; } } struct S { C c; alias c this; } S s; s.c = new C(); @@ -1344,7 +1345,8 @@ if (is (T == immutable) && isExactSomeString!T && is(S == enum)) // Conversion representing enum value with string enum EB : bool { a = true } enum EU : uint { a = 0, b = 1, c = 2 } // base type is unsigned - enum EI : int { a = -1, b = 0, c = 1 } // base type is signed (bug 7909) + // base type is signed (https://issues.dlang.org/show_bug.cgi?id=7909) + enum EI : int { a = -1, b = 0, c = 1 } enum EF : real { a = 1.414, b = 1.732, c = 2.236 } enum EC : char { a = 'x', b = 'y' } enum ES : string { a = "aaa", b = "bbb" } @@ -1637,7 +1639,7 @@ if (!isImplicitlyConvertible!(S, T) && auto f = to!(float[][])(e); assert(f[0] == b && f[1] == b); - // Test for bug 8264 + // Test for https://issues.dlang.org/show_bug.cgi?id=8264 struct Wrap { string wrap; @@ -1645,7 +1647,7 @@ if (!isImplicitlyConvertible!(S, T) && } Wrap[] warr = to!(Wrap[])(["foo", "bar"]); // should work - // Issue 12633 + // https://issues.dlang.org/show_bug.cgi?id=12633 import std.conv : to; const s2 = ["10", "20"]; @@ -1704,7 +1706,9 @@ if (!isImplicitlyConvertible!(S, T) && isAssociativeArray!S && auto b = to!(double[dstring])(a); assert(b["0"d] == 1 && b["1"d] == 2); } -@safe unittest // Bugzilla 8705, from doc + +// https://issues.dlang.org/show_bug.cgi?id=8705, from doc +@safe unittest { import std.exception; int[string][double[int[]]] a; @@ -1950,7 +1954,8 @@ if (isInputRange!S && !isInfinite!S && isSomeChar!(ElementEncodingType!S) && @safe pure unittest { - // Issue 6668 - ensure no collaterals thrown + // https://issues.dlang.org/show_bug.cgi?id=6668 + // ensure no collaterals thrown try { to!uint("-1"); } catch (ConvException e) { assert(e.next is null); } } @@ -1964,12 +1969,12 @@ if (isInputRange!S && !isInfinite!S && isSomeChar!(ElementEncodingType!S) && assert(to!double(a) == 123); }} - // 6255 + // https://issues.dlang.org/show_bug.cgi?id=6255 auto n = to!int("FF", 16); assert(n == 255); } -// bugzilla 15800 +// https://issues.dlang.org/show_bug.cgi?id=15800 @safe unittest { import std.utf : byCodeUnit, byChar, byWchar, byDchar; @@ -2123,7 +2128,7 @@ template roundTo(Target) assert(ex.msg == "Input was NaN"); } -// issue 5232 +// https://issues.dlang.org/show_bug.cgi?id=5232 @safe pure unittest { static if (real.mant_dig >= 64) @@ -2610,7 +2615,7 @@ Lerr: assertCTFEable!({ string s = "1234abc"; assert(parse!uint(s) == 1234 && s == "abc"); }); } -// Issue 13931 +// https://issues.dlang.org/show_bug.cgi?id=13931 @safe pure unittest { import std.exception; @@ -2619,7 +2624,7 @@ Lerr: assertThrown!ConvOverflowException("-92233720368547758080".to!long()); } -// Issue 14396 +// https://issues.dlang.org/show_bug.cgi?id=14396 @safe pure unittest { struct StrInputRange @@ -2635,7 +2640,7 @@ Lerr: assert(parse!int(input) == 777); } -// issue 9621 +// https://issues.dlang.org/show_bug.cgi?id=9621 @safe pure unittest { string s1 = "[ \"\\141\", \"\\0\", \"\\41\", \"\\418\" ]"; @@ -2731,13 +2736,14 @@ do assert(parse!int(s = "765", 8) == octal!765); assert(parse!int(s = "fCDe", 16) == 0xfcde); - // 6609 + // https://issues.dlang.org/show_bug.cgi?id=6609 assert(parse!int(s = "-42", 10) == -42); assert(parse!ubyte(s = "ff", 16) == 0xFF); } -@safe pure unittest // bugzilla 7302 +// https://issues.dlang.org/show_bug.cgi?id=7302 +@safe pure unittest { import std.range : cycle; auto r = cycle("2A!"); @@ -2746,20 +2752,23 @@ do assert(r.front == '!'); } -@safe pure unittest // bugzilla 13163 +// https://issues.dlang.org/show_bug.cgi?id=13163 +@safe pure unittest { import std.exception; foreach (s; ["fff", "123"]) assertThrown!ConvOverflowException(s.parse!ubyte(16)); } -@safe pure unittest // bugzilla 17282 +// https://issues.dlang.org/show_bug.cgi?id=17282 +@safe pure unittest { auto str = "0=\x00\x02\x55\x40&\xff\xf0\n\x00\x04\x55\x40\xff\xf0~4+10\n"; assert(parse!uint(str) == 0); } -@safe pure unittest // bugzilla 18248 +// https://issues.dlang.org/show_bug.cgi?id=18248 +@safe pure unittest { import std.exception : assertThrown; @@ -2840,7 +2849,8 @@ if (isSomeString!Source && !is(Source == enum) && } } -@safe pure unittest // bugzilla 4744 +// https://issues.dlang.org/show_bug.cgi?id=4744 +@safe pure unittest { enum A { member1, member11, member111 } assert(to!A("member1" ) == A.member1 ); @@ -3400,7 +3410,7 @@ if (isInputRange!Source && isSomeChar!(ElementType!Source) && !is(Source == enum { import std.exception; - // Bugzilla 4959 + // https://issues.dlang.org/show_bug.cgi?id=4959 { auto s = "0 "; auto x = parse!double(s); @@ -3408,19 +3418,19 @@ if (isInputRange!Source && isSomeChar!(ElementType!Source) && !is(Source == enum assert(x == 0.0); } - // Bugzilla 3369 + // https://issues.dlang.org/show_bug.cgi?id=3369 assert(to!float("inf") == float.infinity); assert(to!float("-inf") == -float.infinity); - // Bugzilla 6160 + // https://issues.dlang.org/show_bug.cgi?id=6160 assert(6_5.536e3L == to!real("6_5.536e3")); // 2^16 assert(0x1000_000_000_p10 == to!real("0x1000_000_000_p10")); // 7.03687e+13 - // Bugzilla 6258 + // https://issues.dlang.org/show_bug.cgi?id=6258 assertThrown!ConvException(to!real("-")); assertThrown!ConvException(to!real("in")); - // Bugzilla 7055 + // https://issues.dlang.org/show_bug.cgi?id=7055 assertThrown!ConvException(to!float("INF2")); //extra stress testing @@ -3671,7 +3681,8 @@ if (isSomeString!Source && !is(Source == enum) && assert(a2 == ["aaa", "bbb", "ccc"]); } -@safe unittest // Bugzilla 9615 +// https://issues.dlang.org/show_bug.cgi?id=9615 +@safe unittest { string s0 = "[1,2, ]"; string s1 = "[1,2, \t\v\r\n]"; @@ -4003,16 +4014,18 @@ if (isInputRange!Source && isSomeChar!(ElementType!Source)) `\"`, `\'`, `\?`, `\\`, `\a`, `\b`, `\f`, `\n`, `\r`, `\t`, `\v`, //Normal escapes `\141`, `\x61`, - `\u65E5`, `\U00012456` - //`\&`, `\"`, //@@@9621@@@ Named Character Entities. + `\u65E5`, `\U00012456`, + // https://issues.dlang.org/show_bug.cgi?id=9621 (Named Character Entities) + //`\&`, `\"`, ]; const(dchar)[] s2 = [ '\"', '\'', '\?', '\\', '\a', '\b', '\f', '\n', '\r', '\t', '\v', //Normal escapes '\141', '\x61', - '\u65E5', '\U00012456' - //'\&', '\"', //@@@9621@@@ Named Character Entities. + '\u65E5', '\U00012456', + // https://issues.dlang.org/show_bug.cgi?id=9621 (Named Character Entities) + //'\&', '\"', ]; foreach (i ; 0 .. s1.length) @@ -4876,9 +4889,8 @@ if (!is(T == class)) assert(u1.a == "hello"); } - - -@system unittest // bugzilla 15772 + // https://issues.dlang.org/show_bug.cgi?id=15772 +@system unittest { abstract class Foo {} class Bar: Foo {} @@ -5097,8 +5109,6 @@ if (!is(T == class)) //postblit precedence @system unittest { - //Works, but breaks in "-w -O" because of @@@9332@@@. - //Uncomment test when 9332 is fixed. static struct S { int i; @@ -5485,7 +5495,8 @@ version (StdUnittest) } } -@safe unittest //@@@9559@@@ +// https://issues.dlang.org/show_bug.cgi?id=9959 +@safe unittest { import std.algorithm.iteration : map; import std.array : array; @@ -5702,9 +5713,9 @@ pure nothrow @safe /* @nogc */ unittest static assert(!__traits(compiles, emplaceRef(uninitializedUnsafeArr, unsafeArr))); } +// https://issues.dlang.org/show_bug.cgi?id=15313 @system unittest { - // Issue 15313 static struct Node { int payload; @@ -5722,10 +5733,6 @@ pure nothrow @safe /* @nogc */ unittest assert(n.refs == 10); } -@system unittest -{ -} - @system unittest { class A @@ -5759,7 +5766,7 @@ pure nothrow @safe /* @nogc */ unittest { import std.algorithm.comparison : equal; import std.algorithm.iteration : map; - // Check fix for http://d.puremagic.com/issues/show_bug.cgi?id=2971 + // Check fix for https://issues.dlang.org/show_bug.cgi?id=2971 assert(equal(map!(to!int)(["42", "34", "345"]), [42, 34, 345])); } @@ -5928,9 +5935,9 @@ if (isIntegral!T) } } +// https://issues.dlang.org/show_bug.cgi?id=10874 @safe unittest { - // issue 10874 enum Test { a = 0 } ulong l = 0; auto t = l.to!Test; diff --git a/std/csv.d b/std/csv.d index cd21c34efa3..2f2db979605 100644 --- a/std/csv.d +++ b/std/csv.d @@ -124,7 +124,8 @@ class CSVException : Exception /// size_t row, col; - // FIXME: Use std.exception.basicExceptionCtors here once bug #11500 is fixed + // FIXME: Use std.exception.basicExceptionCtors here once + // https://issues.dlang.org/show_bug.cgi?id=11500 is fixed this(string msg, string file = __FILE__, size_t line = __LINE__, Throwable next = null) @nogc @safe pure nothrow @@ -1163,7 +1164,7 @@ public: } } -// Bugzilla 15545 +// https://issues.dlang.org/show_bug.cgi?id=15545 // @system due to the catch for Throwable @system pure unittest { @@ -1717,7 +1718,7 @@ if (isSomeChar!Separator && isInputRange!Range assert(a.data == ""d); } -// Bugzilla 8908 +// https://issues.dlang.org/show_bug.cgi?id=8908 @safe pure unittest { string csv = ` 1.0, 2.0, 3.0 diff --git a/std/datetime/date.d b/std/datetime/date.d index d73b3e62087..0bc9285216a 100644 --- a/std/datetime/date.d +++ b/std/datetime/date.d @@ -3225,7 +3225,7 @@ public: assert(DateTime.fromISOString(" 19990706T123033 ") == DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33))); } - // bug# 17801 + // https://issues.dlang.org/show_bug.cgi?id=17801 @safe unittest { import std.conv : to; @@ -3325,7 +3325,7 @@ public: assert(DateTime.fromISOExtString(" 1999-07-06T12:30:33 ") == DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33))); } - // bug# 17801 + // https://issues.dlang.org/show_bug.cgi?id=17801 @safe unittest { import std.conv : to; @@ -3429,7 +3429,7 @@ public: DateTime(Date(1999, 7, 6), TimeOfDay(12, 30, 33))); } - // bug# 17801 + // https://issues.dlang.org/show_bug.cgi?id=17801 @safe unittest { import std.conv : to; @@ -7733,7 +7733,7 @@ public: assert(Date.fromISOString(" 19990706 ") == Date(1999, 7, 6)); } - // bug# 17801 + // https://issues.dlang.org/show_bug.cgi?id=17801 @safe unittest { import std.conv : to; @@ -7871,7 +7871,7 @@ public: assert(Date.fromISOExtString(" 1999-07-06 ") == Date(1999, 7, 6)); } - // bug# 17801 + // https://issues.dlang.org/show_bug.cgi?id=17801 @safe unittest { import std.conv : to; @@ -8009,7 +8009,7 @@ public: assert(Date.fromSimpleString(" 1999-Jul-06 ") == Date(1999, 7, 6)); } - // bug# 17801 + // https://issues.dlang.org/show_bug.cgi?id=17801 @safe unittest { import std.conv : to; @@ -9295,7 +9295,7 @@ public: assert(TimeOfDay.fromISOString(" 011217 ") == TimeOfDay(1, 12, 17)); } - // bug# 17801 + // https://issues.dlang.org/show_bug.cgi?id=17801 @safe unittest { import std.conv : to; @@ -9420,7 +9420,7 @@ public: assert(TimeOfDay.fromISOExtString(" 01:12:17 ") == TimeOfDay(1, 12, 17)); } - // bug# 17801 + // https://issues.dlang.org/show_bug.cgi?id=17801 @safe unittest { import std.conv : to; diff --git a/std/datetime/interval.d b/std/datetime/interval.d index d727e6691f7..6226f76a00d 100644 --- a/std/datetime/interval.d +++ b/std/datetime/interval.d @@ -4133,9 +4133,9 @@ assert(!range.empty); /+ Converts this interval to a string. +/ - //Due to bug http://d.puremagic.com/issues/show_bug.cgi?id=3715 , we can't - //have versions of toString() with extra modifiers, so we define one version - //with modifiers and one without. + // Due to bug https://issues.dlang.org/show_bug.cgi?id=3715 , we can't + // have versions of toString() with extra modifiers, + // so we define one version with modifiers and one without. string toString() { return _toStringImpl(); @@ -4145,9 +4145,9 @@ assert(!range.empty); /++ Converts this interval to a string. +/ - //Due to bug http://d.puremagic.com/issues/show_bug.cgi?id=3715 , we can't - //have versions of toString() with extra modifiers, so we define one version - //with modifiers and one without. + // Due to bug https://issues.dlang.org/show_bug.cgi?id=3715 , we can't + // have versions of toString() with extra modifiers, + // so we define one version with modifiers and one without. string toString() const nothrow { return _toStringImpl(); @@ -6357,9 +6357,9 @@ assert(!range.empty); /+ Converts this interval to a string. +/ - //Due to bug http://d.puremagic.com/issues/show_bug.cgi?id=3715 , we can't - //have versions of toString() with extra modifiers, so we define one version - //with modifiers and one without. + // Due to bug https://issues.dlang.org/show_bug.cgi?id=3715 , we can't + // have versions of toString() with extra modifiers, + // so we define one version with modifiers and one without. string toString() { return _toStringImpl(); @@ -6369,9 +6369,9 @@ assert(!range.empty); /++ Converts this interval to a string. +/ - //Due to bug http://d.puremagic.com/issues/show_bug.cgi?id=3715 , we can't - //have versions of toString() with extra modifiers, so we define one version - //with modifiers and one without. + // Due to bug https://issues.dlang.org/show_bug.cgi?id=3715 , we can't + // have versions of toString() with extra modifiers, + // so we define one version with modifiers and one without. string toString() const nothrow { return _toStringImpl(); @@ -8307,8 +8307,8 @@ private: static assert(isInputRange!(IntervalRange!(Date, Direction.fwd))); static assert(isForwardRange!(IntervalRange!(Date, Direction.fwd))); - //Commented out due to bug http://d.puremagic.com/issues/show_bug.cgi?id=4895 - //static assert(!isOutputRange!(IntervalRange!(Date, Direction.fwd), Date)); + // Commented out due to bug https://issues.dlang.org/show_bug.cgi?id=4895 + // static assert(!isOutputRange!(IntervalRange!(Date, Direction.fwd), Date)); static assert(!isBidirectionalRange!(IntervalRange!(Date, Direction.fwd))); static assert(!isRandomAccessRange!(IntervalRange!(Date, Direction.fwd))); @@ -8754,8 +8754,8 @@ private: static assert(isForwardRange!(PosInfIntervalRange!Date)); static assert(isInfinite!(PosInfIntervalRange!Date)); - //Commented out due to bug http://d.puremagic.com/issues/show_bug.cgi?id=4895 - //static assert(!isOutputRange!(PosInfIntervalRange!Date, Date)); + // Commented out due to bug https://issues.dlang.org/show_bug.cgi?id=4895 + // static assert(!isOutputRange!(PosInfIntervalRange!Date, Date)); static assert(!isBidirectionalRange!(PosInfIntervalRange!Date)); static assert(!isRandomAccessRange!(PosInfIntervalRange!Date)); static assert(!hasSwappableElements!(PosInfIntervalRange!Date)); @@ -9037,8 +9037,8 @@ private: static assert(isForwardRange!(NegInfIntervalRange!Date)); static assert(isInfinite!(NegInfIntervalRange!Date)); - //Commented out due to bug http://d.puremagic.com/issues/show_bug.cgi?id=4895 - //static assert(!isOutputRange!(NegInfIntervalRange!Date, Date)); + // Commented out due to bug https://issues.dlang.org/show_bug.cgi?id=4895 + // static assert(!isOutputRange!(NegInfIntervalRange!Date, Date)); static assert(!isBidirectionalRange!(NegInfIntervalRange!Date)); static assert(!isRandomAccessRange!(NegInfIntervalRange!Date)); static assert(!hasSwappableElements!(NegInfIntervalRange!Date)); diff --git a/std/datetime/package.d b/std/datetime/package.d index b975dcd5780..cdbf9589ee0 100644 --- a/std/datetime/package.d +++ b/std/datetime/package.d @@ -157,7 +157,7 @@ import std.typecons : Flag, Yes, No; @safe unittest { import std.traits : hasUnsharedAliasing; - /* Issue 6642 */ + /* https://issues.dlang.org/show_bug.cgi?id=6642 */ static assert(!hasUnsharedAliasing!Date); static assert(!hasUnsharedAliasing!TimeOfDay); static assert(!hasUnsharedAliasing!DateTime); @@ -598,7 +598,7 @@ deprecated @safe unittest //writeln(b1.point); } -//Bug# 8450 +// Bug# https://issues.dlang.org/show_bug.cgi?id=8450 deprecated @system unittest { @safe void safeFunc() {} @@ -734,7 +734,7 @@ deprecated @safe unittest +/ } -//Bug# 8450 +// https://issues.dlang.org/show_bug.cgi?id=8450 deprecated @system unittest { @safe void safeFunc() {} diff --git a/std/datetime/systime.d b/std/datetime/systime.d index 977cec30584..1954402e8e1 100644 --- a/std/datetime/systime.d +++ b/std/datetime/systime.d @@ -8074,7 +8074,7 @@ public: } - // Temporary hack until bug http://d.puremagic.com/issues/show_bug.cgi?id=4867 is fixed. + // Temporary hack until bug https://issues.dlang.org/show_bug.cgi?id=4867 is fixed. // This allows assignment from const(SysTime) to SysTime. // It may be a good idea to keep it though, since casting from a type to itself // should be allowed, and it doesn't work without this opCast() since opCast() @@ -8923,11 +8923,11 @@ public: // pops up when deprecations are moved along around July 2019. At that // time, we will update fromISOString so that it is conformant with ISO // 8601, and it will no longer accept ISO extended time zones (it does - // currently because of issue #15654 - toISOString used to incorrectly - // use the ISO extended time zone format). These tests will then start - // failing will need to be updated accordingly. Also, the notes about - // this issue in toISOString and fromISOString's documentation will need - // to be removed. + // currently because of https://issues.dlang.org/show_bug.cgi?id=15654 + // toISOString used to incorrectly use the ISO extended time zone format). + // These tests will then start failing will need to be updated accordingly. + // Also, the notes about this issue in toISOString and fromISOString's + // documentation will need to be removed. test("20101222T172201-01:00", SysTime(DateTime(2010, 12, 22, 17, 22, 01), west60)); test("20101222T172201-01:30", SysTime(DateTime(2010, 12, 22, 17, 22, 01), west90)); test("20101222T172201-08:00", SysTime(DateTime(2010, 12, 22, 17, 22, 01), west480)); @@ -8948,7 +8948,7 @@ public: } } - // bug# 17801 + // https://issues.dlang.org/show_bug.cgi?id=17801 @safe unittest { import std.conv : to; @@ -9195,7 +9195,7 @@ public: } } - // bug# 17801 + // https://issues.dlang.org/show_bug.cgi?id=17801 @safe unittest { import core.time; @@ -9446,7 +9446,7 @@ public: } } - // bug# 17801 + // https://issues.dlang.org/show_bug.cgi?id=17801 @safe unittest { import core.time; @@ -10513,7 +10513,8 @@ version (StdUnittest) private void testBadParse822(alias cr)(string str, size_t function(string a){return cast(ubyte[]) a;}, function(string a){return a;}, function(string a){return map!(b => cast(char) b)(a.representation);})) - {(){ // workaround slow optimizations for large functions @@@BUG@@@ 2396 + {(){ // workaround slow optimizations for large functions + // https://issues.dlang.org/show_bug.cgi?id=2396 scope(failure) writeln(typeof(cr).stringof); alias test = testParse822!cr; alias testBad = testBadParse822!cr; @@ -10784,7 +10785,8 @@ version (StdUnittest) private void testBadParse822(alias cr)(string str, size_t function(string a){return cast(ubyte[]) a;}, function(string a){return a;}, function(string a){return map!(b => cast(char) b)(a.representation);})) - {(){ // workaround slow optimizations for large functions @@@BUG@@@ 2396 + {(){ // workaround slow optimizations for large functions + // https://issues.dlang.org/show_bug.cgi?id=2396 scope(failure) writeln(typeof(cr).stringof); alias test = testParse822!cr; { diff --git a/std/datetime/timezone.d b/std/datetime/timezone.d index 33097dacea7..2144e092f32 100644 --- a/std/datetime/timezone.d +++ b/std/datetime/timezone.d @@ -450,7 +450,7 @@ public: bool first = true; auto springSwitch = SysTime(dstSwitches[i][0] + dur!"hours"(spring), UTC()) - stdOffset; auto fallSwitch = SysTime(dstSwitches[i][1] + dur!"hours"(fall), UTC()) - dstOffset; - // @@@BUG@@@ 3659 makes this necessary. + // https://issues.dlang.org/show_bug.cgi?id=3659 makes this necessary. auto fallSwitchMinus1 = fallSwitch - dur!"hours"(1); foreach (hour; -24 .. 25) @@ -596,7 +596,7 @@ public: GetTimeZoneInformation(&tzInfo); // Cannot use to!string() like this should, probably due to bug - // http://d.puremagic.com/issues/show_bug.cgi?id=5016 + // https://issues.dlang.org/show_bug.cgi?id=5016 //return to!string(tzInfo.StandardName); wchar[32] str; @@ -681,7 +681,7 @@ public: GetTimeZoneInformation(&tzInfo); // Cannot use to!string() like this should, probably due to bug - // http://d.puremagic.com/issues/show_bug.cgi?id=5016 + // https://issues.dlang.org/show_bug.cgi?id=5016 //return to!string(tzInfo.DaylightName); wchar[32] str; @@ -1039,7 +1039,7 @@ public: bool first = true; auto springSwitch = SysTime(tzInfos[i][1] + dur!"hours"(spring), UTC()) - stdOffset; auto fallSwitch = SysTime(tzInfos[i][2] + dur!"hours"(fall), UTC()) - dstOffset; - // @@@BUG@@@ 3659 makes this necessary. + // https://issues.dlang.org/show_bug.cgi?id=3659 makes this necessary. auto fallSwitchMinus1 = fallSwitch - dur!"hours"(1); foreach (hour; -24 .. 25) diff --git a/std/digest/package.d b/std/digest/package.d index 2de76308075..e98c471ff0c 100644 --- a/std/digest/package.d +++ b/std/digest/package.d @@ -606,7 +606,7 @@ interface Digest @trusted nothrow ubyte[] finish(); ///ditto nothrow ubyte[] finish(ubyte[] buf); - //@@@BUG@@@ http://d.puremagic.com/issues/show_bug.cgi?id=6549 + // https://issues.dlang.org/show_bug.cgi?id=6549 /*in { assert(buf.length >= this.length); diff --git a/std/digest/sha.d b/std/digest/sha.d index 47503be39dc..0aebb62fc7b 100644 --- a/std/digest/sha.d +++ b/std/digest/sha.d @@ -103,7 +103,7 @@ module std.digest.sha; version (D_InlineAsm_X86) { - version (D_PIC) {} // Bugzilla 9378 + version (D_PIC) {} // https://issues.dlang.org/show_bug.cgi?id=9378 else private version = USE_SSSE3; } else version (D_InlineAsm_X86_64) @@ -209,7 +209,8 @@ struct SHA(uint hashBlockSize, uint digestSize) if (ssse3) { version (D_InlineAsm_X86_64) - // constants as extra argument for PIC, see Bugzilla 9378 + // constants as extra argument for PIC + // see https://issues.dlang.org/show_bug.cgi?id=9378 transformSSSE3(state, block, &sse3_constants); else transformSSSE3(state, block); diff --git a/std/exception.d b/std/exception.d index eec3c9055f8..7931bc48ef3 100644 --- a/std/exception.d +++ b/std/exception.d @@ -526,9 +526,9 @@ private void bailOut(E : Throwable = Exception)(string file, size_t line, scope } } +// https://issues.dlang.org/show_bug.cgi?id=10510 @safe unittest { - // Issue 10510 extern(C) void cFoo() { } enforce(false, &cFoo); } @@ -566,7 +566,7 @@ private void bailOut(E : Throwable = Exception)(string file, size_t line, scope } } -// Test for bugzilla 8637 +// Test for https://issues.dlang.org/show_bug.cgi?id=8637 @system unittest { struct S @@ -600,10 +600,9 @@ private void bailOut(E : Throwable = Exception)(string file, size_t line, scope enforce!E2(s); } +// https://issues.dlang.org/show_bug.cgi?id=14685 @safe unittest { - // Issue 14685 - class E : Exception { this() { super("Not found"); } @@ -1249,7 +1248,9 @@ bool mayPointTo(S, T)(auto ref const shared S source, ref const shared T target) @system unittest { int i; - int* p = &i; // trick the compiler when initializing slicep; https://issues.dlang.org/show_bug.cgi?id=18637 + // trick the compiler when initializing slice + // https://issues.dlang.org/show_bug.cgi?id=18637 + int* p = &i; int[] slice = [0, 1, 2, 3, 4]; int[5] arr = [0, 1, 2, 3, 4]; int*[] slicep = [p]; @@ -1315,8 +1316,9 @@ bool mayPointTo(S, T)(auto ref const shared S source, ref const shared T target) version (StdUnittest) { - // 17084 : the bug doesn't happen if these declarations are - // in the unittest block (static or not). + // https://issues.dlang.org/show_bug.cgi?id=17084 + // the bug doesn't happen if these declarations are in the unittest block + // (static or not). private struct Page17084 { URL17084 url; @@ -1332,7 +1334,8 @@ version (StdUnittest) } } -@system unittest // Bugzilla 17084 +// https://issues.dlang.org/show_bug.cgi?id=17084 +@system unittest { import std.algorithm.sorting : sort; Page17084[] s; diff --git a/std/experimental/allocator/building_blocks/free_tree.d b/std/experimental/allocator/building_blocks/free_tree.d index 4115a835e7f..bd4bb9511ea 100644 --- a/std/experimental/allocator/building_blocks/free_tree.d +++ b/std/experimental/allocator/building_blocks/free_tree.d @@ -418,7 +418,8 @@ version (StdUnittest) testAllocator!(() => FreeTree!GCAllocator()); } -@system unittest // issue 16506 +// https://issues.dlang.org/show_bug.cgi?id=16506 +@system unittest { import std.experimental.allocator.gc_allocator : GCAllocator; import std.experimental.allocator.mallocator : Mallocator; @@ -437,7 +438,8 @@ version (StdUnittest) f!GCAllocator(1); } -@system unittest // issue 16507 +// https://issues.dlang.org/show_bug.cgi?id=16507 +@system unittest { static struct MyAllocator { diff --git a/std/experimental/allocator/mallocator.d b/std/experimental/allocator/mallocator.d index bc463a7af16..bd813a51f76 100644 --- a/std/experimental/allocator/mallocator.d +++ b/std/experimental/allocator/mallocator.d @@ -374,7 +374,8 @@ version (LDC_AddressSanitizer) version (Posix) @nogc @system nothrow unittest { - // 16398 : test the "pseudo" alignedReallocate for Posix + // https://issues.dlang.org/show_bug.cgi?id=16398 + // test the "pseudo" alignedReallocate for Posix void[] s = AlignedMallocator.instance.alignedAllocate(16, 32); (cast(ubyte[]) s)[] = ubyte(1); AlignedMallocator.instance.alignedReallocate(s, 32, 32); diff --git a/std/experimental/allocator/package.d b/std/experimental/allocator/package.d index 92073ccb777..7503614c744 100644 --- a/std/experimental/allocator/package.d +++ b/std/experimental/allocator/package.d @@ -226,8 +226,9 @@ module std.experimental.allocator; public import std.experimental.allocator.common, std.experimental.allocator.typed; -// Fix issue 17806: this should always be the first unittest in this module -// in order to ensure that we use the `processAllocator` setter before the getter +// Fix https://issues.dlang.org/show_bug.cgi?id=17806 +// this should always be the first unittest in this module in order to ensure +// that we use the `processAllocator` setter before the getter @system unittest { import std.experimental.allocator.mallocator : Mallocator; @@ -1246,7 +1247,9 @@ auto make(T, Allocator, A...)(auto ref Allocator alloc, auto ref A args) assert(outer.x == inner.getX); } -@system unittest // bugzilla 15639 & 15772 +// https://issues.dlang.org/show_bug.cgi?id=15639 +// https://issues.dlang.org/show_bug.cgi?id=15772 +@system unittest { abstract class Foo {} class Bar: Foo {} @@ -1410,7 +1413,8 @@ nothrow @safe @nogc unittest "Don't allow zero-ctor-args `make` for structs with `@disable this();`"); } -@safe unittest // issue 18937 +// https://issues.dlang.org/show_bug.cgi?id=18937 +@safe unittest { static struct S { @@ -2455,7 +2459,8 @@ void dispose(A, T)(auto ref A alloc, auto ref T[] array) theAllocator.dispose(arr); } -@system unittest //bugzilla 16512 +// https://issues.dlang.org/show_bug.cgi?id=16512 +@system unittest { import std.experimental.allocator.mallocator : Mallocator; @@ -2476,7 +2481,8 @@ void dispose(A, T)(auto ref A alloc, auto ref T[] array) assert(ua is null); } -@system unittest //bugzilla 15721 +// https://issues.dlang.org/show_bug.cgi?id=15721 +@system unittest { import std.experimental.allocator.mallocator : Mallocator; diff --git a/std/experimental/logger/core.d b/std/experimental/logger/core.d index 0f5a9dbb512..dc537048fe9 100644 --- a/std/experimental/logger/core.d +++ b/std/experimental/logger/core.d @@ -3071,7 +3071,7 @@ private void trustedStore(T)(ref shared T dst, ref T src) @trusted stdThreadLocalLog.logLevel = LogLevel.all; } -// Issue 14940 +// https://issues.dlang.org/show_bug.cgi?id=14940 @safe unittest { import std.typecons : Nullable; @@ -3101,7 +3101,7 @@ private void trustedStore(T)(ref shared T dst, ref T src) @trusted assert(tl.msg == SystemToStringMsg); } -// Issue 17328 +// https://issues.dlang.org/show_bug.cgi?id=17328 @safe unittest { import std.format : format; @@ -3123,7 +3123,7 @@ private void trustedStore(T)(ref shared T dst, ref T src) @trusted assert(fs.length == 2); } -// Issue 15954 +// https://issues.dlang.org/show_bug.cgi?id=15954 @safe unittest { import std.conv : to; @@ -3132,7 +3132,7 @@ private void trustedStore(T)(ref shared T dst, ref T src) @trusted assert(tl.msg == "123456789"); } -// Issue 16256 +// https://issues.dlang.org/show_bug.cgi?id=16256 @safe unittest { import std.conv : to; @@ -3141,7 +3141,7 @@ private void trustedStore(T)(ref shared T dst, ref T src) @trusted assert(tl.msg == "123456789"); } -// Issue 15517 +// https://issues.dlang.org/show_bug.cgi?id=15517 @system unittest { import std.file : exists, remove, tempDir; diff --git a/std/experimental/typecons.d b/std/experimental/typecons.d index 7f5d0da3f59..cbe682b13b0 100644 --- a/std/experimental/typecons.d +++ b/std/experimental/typecons.d @@ -663,9 +663,10 @@ template unwrap(Target) assert(d.draw(10) == 10); } } + +// https://issues.dlang.org/show_bug.cgi?id=10377 @system unittest { - // Bugzilla 10377 import std.algorithm, std.range; interface MyInputRange(T) @@ -680,9 +681,10 @@ template unwrap(Target) auto r = iota(0,10,1).inputRangeObject().wrap!(MyInputRange!int)(); assert(equal(r, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9])); } + +// https://issues.dlang.org/show_bug.cgi?id=10536 @system unittest { - // Bugzilla 10536 interface Interface { int foo(); @@ -696,9 +698,10 @@ template unwrap(Target) Interface i = new Pluggable().wrap!Interface; assert(i.foo() == 1); } + +// https://issues.dlang.org/show_bug.cgi?id=10538 @system unittest { - // Enhancement 10538 interface Interface { int foo(); @@ -1049,7 +1052,7 @@ pure nothrow @safe unittest assert((arr ~ 4) == [1, 2, 3, 4]); } -// issue 17270 +// https://issues.dlang.org/show_bug.cgi?id=17270 pure nothrow @nogc @system unittest { int i = 1; diff --git a/std/file.d b/std/file.d index d973d71236c..28dbaad3eac 100644 --- a/std/file.d +++ b/std/file.d @@ -283,9 +283,9 @@ private T cenforce(T)(T condition, scope const(char)[] name, scope const(FSChar) throw new FileException(name, .errno, file, line); } +// https://issues.dlang.org/show_bug.cgi?id=17102 @safe unittest { - // issue 17102 try { cenforce(false, null, null, @@ -1985,7 +1985,8 @@ private bool existsImpl(const(FSChar)* namez) @trusted nothrow @nogc assert(deleteme.exists); } -@safe unittest // Bugzilla 16573 +// https://issues.dlang.org/show_bug.cgi?id=16573 +@safe unittest { enum S : string { foo = "foo" } assert(__traits(compiles, S.foo.exists)); @@ -2551,7 +2552,8 @@ if (isConvertibleToString!R) assert(f.isFile); } -@system unittest // bugzilla 15658 +// https://issues.dlang.org/show_bug.cgi?id=15658 +@system unittest { DirEntry e = DirEntry("."); static assert(is(typeof(isFile(e)))); @@ -3117,7 +3119,7 @@ void mkdirRecurse(scope const(char)[] pathname) @safe assertThrown!FileException(mkdirRecurse(`1:\foobar`)); } - // bug3570 + // https://issues.dlang.org/show_bug.cgi?id=3570 { immutable basepath = deleteme ~ "_dir"; version (Windows) @@ -4118,7 +4120,7 @@ else version (Posix) core.sys.posix.unistd.symlink((deleteme ~ "_broken_symlink\0").ptr, symfile.ptr); { - //Issue 8298 + // https://issues.dlang.org/show_bug.cgi?id=8298 DirEntry de = DirEntry(symfile); assert(!de.isFile); @@ -4225,7 +4227,8 @@ if (isConvertibleToString!RF || isConvertibleToString!RT) assert(targetNonExistent.readText == "source"); } -@safe unittest // issue 15319 +// https://issues.dlang.org/show_bug.cgi?id=15319 +@safe unittest { assert(__traits(compiles, copy("from.txt", "to.txt"))); } @@ -4325,9 +4328,10 @@ private void copyImpl(scope const(char)[] f, scope const(char)[] t, } } +// https://issues.dlang.org/show_bug.cgi?id=14817 @safe unittest { - import std.algorithm, std.file; // issue 14817 + import std.algorithm, std.file; auto t1 = deleteme, t2 = deleteme~"2"; scope(exit) foreach (t; [t1, t2]) if (t.exists) t.remove(); write(t1, "11"); @@ -4342,7 +4346,8 @@ private void copyImpl(scope const(char)[] f, scope const(char)[] t, assert(readText(t2.byChar) == "2"); } -@safe version (Posix) @safe unittest //issue 11434 +// https://issues.dlang.org/show_bug.cgi?id=11434 +@safe version (Posix) @safe unittest { import std.conv : octal; auto t1 = deleteme, t2 = deleteme~"2"; @@ -4354,7 +4359,8 @@ private void copyImpl(scope const(char)[] f, scope const(char)[] t, assert(getAttributes(t2) == octal!100767); } -@safe unittest // issue 15865 +// https://issues.dlang.org/show_bug.cgi?id=15865 +@safe unittest { import std.exception : assertThrown; auto t = deleteme; @@ -4364,7 +4370,7 @@ private void copyImpl(scope const(char)[] f, scope const(char)[] t, assert(readText(t) == "a"); } -// issue 19834 +// https://issues.dlang.org/show_bug.cgi?id=19834 version (Windows) @safe unittest { import std.exception : collectException; @@ -4974,7 +4980,7 @@ auto dirEntries(string path, SpanMode mode, bool followSymlink = true) assert(e.isFile || e.isDir, e.name); } - //issue 7264 + // https://issues.dlang.org/show_bug.cgi?id=7264 foreach (string name; dirEntries(testdir, "*.d", SpanMode.breadth)) { @@ -4983,14 +4989,14 @@ auto dirEntries(string path, SpanMode mode, bool followSymlink = true) { static assert(is(typeof(entry) == DirEntry)); } - //issue 7138 + // https://issues.dlang.org/show_bug.cgi?id=7138 auto a = array(dirEntries(testdir, SpanMode.shallow)); - // issue 11392 + // https://issues.dlang.org/show_bug.cgi?id=11392 auto dFiles = dirEntries(testdir, SpanMode.shallow); foreach (d; dFiles){} - // issue 15146 + // https://issues.dlang.org/show_bug.cgi?id=15146 dirEntries("", SpanMode.shallow).walkLength(); } @@ -5081,7 +5087,8 @@ auto dirEntries(string path, string pattern, SpanMode mode, } } -// Bugzilla 17962 - Make sure that dirEntries does not butcher Unicode file names. +// Make sure that dirEntries does not butcher Unicode file names +// https://issues.dlang.org/show_bug.cgi?id=17962 @system unittest { import std.algorithm.comparison : equal; diff --git a/std/format.d b/std/format.d index 98ca3b5ad38..b146a8e01cd 100644 --- a/std/format.d +++ b/std/format.d @@ -1659,7 +1659,7 @@ if (is(Unqual!Char == Char)) assert(w.data == "ab%cd%ef" && f.trailing == "g%%h%sij", w.data); f.writeUpToNextSpec(w); assert(w.data == "ab%cd%efg%h" && f.trailing == "ij"); - // bug4775 + // https://issues.dlang.org/show_bug.cgi?id=4775 f = FormatSpec!char("%%%s"); w.clear(); f.writeUpToNextSpec(w); @@ -1675,9 +1675,9 @@ if (is(Unqual!Char == Char)) assert(w.data == "a%b%c" && f.trailing == "%"); } +// https://issues.dlang.org/show_bug.cgi?id=5237 @safe unittest { - // issue 5237 import std.array; auto w = appender!string(); auto f = FormatSpec!char("%.16f"); @@ -1713,7 +1713,7 @@ if (is(Unqual!Char == Char)) assert(a.data == "Number: \nString: "); } -// Issue 14059 +// https://issues.dlang.org/show_bug.cgi?id=14059 @safe unittest { import std.array : appender; @@ -2455,7 +2455,8 @@ private void formatUnsigned(Writer, T, Char) put(w, ' '); } -@safe pure unittest // bugzilla 18838 +// https://issues.dlang.org/show_bug.cgi?id=18838 +@safe pure unittest { assert("%12,d".format(0) == " 0"); } @@ -2486,7 +2487,7 @@ private void formatUnsigned(Writer, T, Char) formatTest( S2(10), "S" ); } -// bugzilla 9117 +// https://issues.dlang.org/show_bug.cgi?id=9117 @safe unittest { static struct Frop {} @@ -2535,7 +2536,7 @@ private void formatUnsigned(Writer, T, Char) assert(result == "9"); } -// bugzilla 20064 +// https://issues.dlang.org/show_bug.cgi?id=20064 @safe unittest { assert(format( "%03,d", 1234) == "1,234"); @@ -2866,7 +2867,7 @@ useSnprintf: formatTest( S2(2.25), "S" ); } -// bugzilla 19939 +// https://issues.dlang.org/show_bug.cgi?id=19939 @safe unittest { assert(format("^%13,3.2f$", 1.00) == "^ 1.00$"); @@ -2879,7 +2880,7 @@ useSnprintf: assert(format("^%13,3.2f$", 10_000_000.00) == "^10,000,000.00$"); } -// bugzilla 20069 +// https://issues.dlang.org/show_bug.cgi?id=20069 @safe unittest { assert(format("%012,f", -1234.0) == "-1,234.000000"); @@ -2919,7 +2920,7 @@ useSnprintf: assert(t2 == "[ -12.3] [-12.3 ]"); } -// issue 20396 +// https://issues.dlang.org/show_bug.cgi?id=20396 @safe unittest { import std.math : nextUp; @@ -2928,7 +2929,7 @@ useSnprintf: assert(format!"%a"(nextUp(0.0)) == "0x0.0000000000001p-1022"); } -// issue 20371 +// https://issues.dlang.org/show_bug.cgi?id=20371 @safe unittest { assert(format!"%.1000a"(1.0) == @@ -3192,7 +3193,8 @@ if (is(StaticArrayTypeOf!T) && !is(T == enum) && !hasToString!(T, Char)) formatValueImpl(w, obj[], f); } -@safe unittest // Test for issue 8310 +// Test for https://issues.dlang.org/show_bug.cgi?id=8310 +@safe unittest { import std.array : appender; FormatSpec!char f; @@ -3311,9 +3313,9 @@ if (is(DynamicArrayTypeOf!T) && !is(StringTypeOf!T) && !is(T == enum) && !hasToS formatTest( s, "[1, 2, 3]" ); } +// https://issues.dlang.org/show_bug.cgi?id=6640 @safe unittest { - // 6640 struct Range { @safe: @@ -3587,7 +3589,8 @@ if (isInputRange!T) throw new FormatException(text("Incorrect format specifier for range: %", f.spec)); } -@safe pure unittest // Issue 18778 +// https://issues.dlang.org/show_bug.cgi?id=18778 +@safe pure unittest { assert(format("%-(%1$s - %1$s, %)", ["A", "B", "C"]) == "A - A, B - B, C - C"); } @@ -3642,7 +3645,7 @@ if (is(StringTypeOf!T) && !is(T == enum)) import std.array : appender; import std.utf : decode, UTFException; - StringTypeOf!T str = val; // bug 8015 + StringTypeOf!T str = val; // https://issues.dlang.org/show_bug.cgi?id=8015 if (f.spec == 's') { @@ -3830,7 +3833,7 @@ if (is(AssocArrayTypeOf!T) && !is(T == enum) && !hasToString!(T, Char)) formatTest( "{%([%04d->%(%c.%)]%| $ %)}", aa3, [`{[0001->h.e.l.l.o] $ [0002->w.o.r.l.d]}`, `{[0002->w.o.r.l.d] $ [0001->h.e.l.l.o]}`] ); - // issue 12135 + // https://issues.dlang.org/show_bug.cgi?id=12135 formatTest("%(%s:<%s>%|,%)", [1:2], "1:<2>"); formatTest("%(%s:<%s>%|%)" , [1:2], "1:<2>"); } @@ -3850,7 +3853,8 @@ if (is(AssocArrayTypeOf!T) && !is(T == enum) && !hasToString!(T, Char)) formatTest( S2(['c':1, 'd':2]), "S" ); } -@safe unittest // Issue 8921 +// https://issues.dlang.org/show_bug.cgi?id=8921 +@safe unittest { enum E : char { A = 'a', B = 'b', C = 'c' } E[3] e = [E.A, E.B, E.C]; @@ -4135,7 +4139,8 @@ if (is(T == class) && !is(T == enum)) with(HasToStringResult) static if ((is(T == immutable) || is(T == const) || is(T == shared)) && overload == none) { - // issue 7879, remove this when Object gets const toString + // Remove this when Object gets const toString + // https://issues.dlang.org/show_bug.cgi?id=7879 static if (is(T == immutable)) put(w, "immutable("); else static if (is(T == const)) @@ -4182,7 +4187,7 @@ if (is(T == class) && !is(T == enum)) { import std.array : appender; import std.range.interfaces; - // class range (issue 5154) + // class range (https://issues.dlang.org/show_bug.cgi?id=5154) auto c = inputRangeObject([1,2,3,4]); formatTest( c, "[1, 2, 3, 4]" ); assert(c.empty); @@ -4192,7 +4197,7 @@ if (is(T == class) && !is(T == enum)) @system unittest { - // 5354 + // https://issues.dlang.org/show_bug.cgi?id=5354 // If the class has both range I/F and custom toString, the use of custom // toString routine is prioritized. @@ -4251,7 +4256,7 @@ version (StdUnittest) private class C {} } -// issue 7879 +// https://issues.dlang.org/show_bug.cgi?id=7879 @safe unittest { const(C) c; @@ -4388,7 +4393,7 @@ if (is(T == interface) && (hasToString!(T, Char) || !is(BuiltinTypeOf!T)) && !is Whatever val = new C; formatTest( val, "ab" ); - // Issue 11175 + // https://issues.dlang.org/show_bug.cgi?id=11175 version (Windows) { import core.sys.windows.com : IUnknown, IID; @@ -4463,16 +4468,16 @@ if ((is(T == struct) || is(T == union)) && (hasToString!(T, Char) || !is(Builtin } } -// issue 9588 +// https://issues.dlang.org/show_bug.cgi?id=9588 @safe pure unittest { struct S { int x; bool empty() { return false; } } formatTest( S(), "S(0)" ); } +// https://issues.dlang.org/show_bug.cgi?id=4638 @safe unittest { - // bug 4638 struct U8 { string toString() const { return "blah"; } } struct U16 { wstring toString() const { return "blah"; } } struct U32 { dstring toString() const { return "blah"; } } @@ -4481,9 +4486,9 @@ if ((is(T == struct) || is(T == union)) && (hasToString!(T, Char) || !is(Builtin formatTest( U32(), "blah" ); } +// https://issues.dlang.org/show_bug.cgi?id=3890 @safe unittest { - // 3890 struct Int{ int n; } struct Pair{ string s; Int i; } formatTest( Pair("hello", Int(5)), @@ -4516,7 +4521,7 @@ if ((is(T == struct) || is(T == union)) && (hasToString!(T, Char) || !is(Builtin @system unittest { import std.array; - // 7230 + // https://issues.dlang.org/show_bug.cgi?id=7230 static struct Bug7230 { string s = "hello"; @@ -4699,7 +4704,7 @@ if (isSIMDVector!V) { version (X86) { - version (OSX) {/* issue 17823 */} + version (OSX) {/* https://issues.dlang.org/show_bug.cgi?id=17823 */} } else { @@ -4722,7 +4727,7 @@ if (isSIMDVector!V) formatTest( q, "FFEECCAA" ); } -// issue 11782 +// https://issues.dlang.org/show_bug.cgi?id=11782 @safe pure unittest { import std.range : iota; @@ -4736,7 +4741,7 @@ if (isSIMDVector!V) @system pure unittest { - // Test for issue 7869 + // Test for https://issues.dlang.org/show_bug.cgi?id=7869 struct S { string toString() const { return ""; } @@ -4748,9 +4753,9 @@ if (isSIMDVector!V) formatTest( q, "FFEECCAA" ); } +// https://issues.dlang.org/show_bug.cgi?id=8186 @system unittest { - // Test for issue 8186 class B { int*a; @@ -4760,24 +4765,24 @@ if (isSIMDVector!V) formatTest( B.init, "null" ); } +// https://issues.dlang.org/show_bug.cgi?id=9336 @system pure unittest { - // Test for issue 9336 shared int i; format("%s", &i); } +// https://issues.dlang.org/show_bug.cgi?id=11778 @system pure unittest { - // Test for issue 11778 int* p = null; assertThrown!FormatException(format("%d", p)); assertThrown!FormatException(format("%04d", p + 2)); } +// https://issues.dlang.org/show_bug.cgi?id=12505 @safe pure unittest { - // Test for issue 12505 void* p = null; formatTest( "%08X", p, "00000000" ); } @@ -4810,8 +4815,7 @@ if (isDelegate!T) "([])" ); } -//------------------------------------------------------------------------------ -// Fix for issue 1591 +// Fix for https://issues.dlang.org/show_bug.cgi?id=1591 private int getNthInt(string kind, A...)(uint index, A args) { return getNth!(kind, isIntegral,int)(index, args); @@ -5697,9 +5701,9 @@ T unformatValue(T, Range, Char)(ref Range input, scope const ref FormatSpec!Char assert(str.unformatValue!(int[string])(spec) == ["one": 1, "two": 2]); } +// https://issues.dlang.org/show_bug.cgi?id=7241 @safe pure unittest { - // 7241 string input = "a"; auto spec = FormatSpec!char("%s"); spec.readUpToNextSpec(input); @@ -6277,7 +6281,7 @@ deprecated assert(r == "012345"); r = format("%o", 9); assert(r == "11"); - r = format("%#o", 0); // issue 15663 + r = format("%#o", 0); // https://issues.dlang.org/show_bug.cgi?id=15663 assert(r == "0"); r = format("%+d", 123); @@ -6373,7 +6377,8 @@ deprecated assert(format("%8s", "b\u00e9ll\u00f4") == " b\u00e9ll\u00f4"); } -@safe pure unittest // bugzilla 18205 +// https://issues.dlang.org/show_bug.cgi?id=18205 +@safe pure unittest { assert("|%8s|".format("abc") == "| abc|"); assert("|%8s|".format("αβγ") == "| αβγ|"); @@ -6385,18 +6390,18 @@ deprecated assert("%2s".format("a\u0310\u0337"d) == " a\u0310\u0337"); } +// https://issues.dlang.org/show_bug.cgi?id=3479 @safe unittest { - // bugzilla 3479 import std.array; auto stream = appender!(char[])(); formattedWrite(stream, "%2$.*1$d", 12, 10); assert(stream.data == "000000000010", stream.data); } +// https://issues.dlang.org/show_bug.cgi?id=6893 @safe unittest { - // bug 6893 import std.array; enum E : ulong { A, B, C } auto stream = appender!(char[])(); @@ -6897,7 +6902,7 @@ char[] sformat(Char, Args...)(return scope char[] buf, scope const(Char)[] fmt, assert(tmp == "2345", tmp); } -// Issue 18047 +// https://issues.dlang.org/show_bug.cgi?id=18047 @safe unittest { auto cmp = " 123,456"; @@ -6908,7 +6913,7 @@ char[] sformat(Char, Args...)(return scope char[] buf, scope const(Char)[] fmt, assert(tmp == cmp, "'" ~ tmp ~ "'"); } -// Issue 17459 +// https://issues.dlang.org/show_bug.cgi?id=17459 @safe unittest { auto cmp = "100"; @@ -6940,7 +6945,7 @@ char[] sformat(Char, Args...)(return scope char[] buf, scope const(Char)[] fmt, assert(tmp == cmp, tmp); } -// Issue 17459 +// https://issues.dlang.org/show_bug.cgi?id=17459 @safe unittest { auto cmp = "100,000"; @@ -6956,7 +6961,7 @@ char[] sformat(Char, Args...)(return scope char[] buf, scope const(Char)[] fmt, assert(tmp == cmp, tmp); } -// Issue 20288 +// https://issues.dlang.org/show_bug.cgi?id=20288 @safe unittest { string s = format("%,.2f", double.nan); @@ -7038,7 +7043,7 @@ if (is(T == float) || is(T == double) || (is(T == real) && T.mant_dig == double. { version (DigitalMars) { - // hack to work around issue 20363 + // hack to work around https://issues.dlang.org/show_bug.cgi?id=20363 ival ^= rm; ival ^= rm; } @@ -8129,7 +8134,7 @@ printFloat_done: assert(printFloat(buf[], -float.infinity, f) == "-inf"); assert(printFloat(buf[], 0.0f, f) == "0.000000e+00"); assert(printFloat(buf[], -0.0f, f) == "-0.000000e+00"); - // cast needed due to bug 20361 + // cast needed due to https://issues.dlang.org/show_bug.cgi?id=20361 assert(printFloat(buf[], cast(float) 1e-40, f) == "9.999946e-41"); assert(printFloat(buf[], cast(float) -1e-40, f) == "-9.999946e-41"); assert(printFloat(buf[], 1e-30f, f) == "1.000000e-30"); diff --git a/std/functional.d b/std/functional.d index 06010fe8d29..8b3666db330 100644 --- a/std/functional.d +++ b/std/functional.d @@ -128,7 +128,7 @@ template unaryFun(alias fun, string parmName = "a") } else static if (needOpCallAlias!fun) { - // Issue 9906 + // https://issues.dlang.org/show_bug.cgi?id=9906 alias unaryFun = fun.opCall; } else @@ -159,7 +159,7 @@ template unaryFun(alias fun, string parmName = "a") int num = 41; assert(unaryFun!"a + 1"(num) == 42); - // Issue 9906 + // https://issues.dlang.org/show_bug.cgi?id=9906 struct Seen { static bool opCall(int n) { return true; } @@ -222,7 +222,7 @@ template binaryFun(alias fun, string parm1Name = "a", } else static if (needOpCallAlias!fun) { - // Issue 9906 + // https://issues.dlang.org/show_bug.cgi?id=9906 alias binaryFun = fun.opCall; } else @@ -252,7 +252,7 @@ template binaryFun(alias fun, string parm1Name = "a", //@@BUG //assert(binaryFun!("return a + b;")(41, 1) == 42); - // Issue 9906 + // https://issues.dlang.org/show_bug.cgi?id=9906 struct Seen { static bool opCall(int x, int y) { return true; } @@ -840,7 +840,7 @@ template partial(alias fun, alias arg) assert(dg2() == 1); } -// Fix issue 15732 +// Fix https://issues.dlang.org/show_bug.cgi?id=15732 @safe unittest { // Test whether it works with functions. @@ -1261,7 +1261,8 @@ Note: template memoize(alias fun) { import std.traits : ReturnType; - // alias Args = Parameters!fun; // Bugzilla 13580 + // https://issues.dlang.org/show_bug.cgi?id=13580 + // alias Args = Parameters!fun; ReturnType!fun memoize(Parameters!fun args) { @@ -1283,7 +1284,8 @@ template memoize(alias fun) template memoize(alias fun, uint maxSize) { import std.traits : ReturnType; - // alias Args = Parameters!fun; // Bugzilla 13580 + // https://issues.dlang.org/show_bug.cgi?id=13580 + // alias Args = Parameters!fun; ReturnType!fun memoize(Parameters!fun args) { import std.meta : staticMap; @@ -1318,7 +1320,9 @@ template memoize(alias fun, uint maxSize) if (!bt(initialized.ptr, idx1)) { emplace(&memo[idx1], args, fun(args)); - bts(initialized.ptr, idx1); // only set to initialized after setting args and value (bugzilla 14025) + // only set to initialized after setting args and value + // https://issues.dlang.org/show_bug.cgi?id=14025 + bts(initialized.ptr, idx1); return memo[idx1].res; } else if (memo[idx1].args == args) @@ -1328,7 +1332,7 @@ template memoize(alias fun, uint maxSize) if (!bt(initialized.ptr, idx2)) { emplace(&memo[idx2], memo[idx1]); - bts(initialized.ptr, idx2); // only set to initialized after setting args and value (bugzilla 14025) + bts(initialized.ptr, idx2); } else if (memo[idx2].args == args) return memo[idx2].res; @@ -1427,7 +1431,7 @@ unittest } assert(fact(10) == 3628800); - // Issue 12568 + // https://issues.dlang.org/show_bug.cgi?id=12568 static uint len2(const string s) { // Error alias mLen2 = memoize!len2; if (s.length == 0) @@ -1442,7 +1446,8 @@ unittest assert(func(int.init) == 1); } -// 16079: memoize should work with arrays +// https://issues.dlang.org/show_bug.cgi?id=16079 +// memoize should work with arrays @system unittest // not @safe with -dip1000 due to memoize { int executed = 0; @@ -1466,7 +1471,7 @@ unittest assert(executed == 1); } -// 16079: memoize should work with structs +// https://issues.dlang.org/show_bug.cgi?id=16079: memoize should work with structs @safe unittest { int executed = 0; @@ -1485,7 +1490,7 @@ unittest assert(executed == 1); } -// 20439 memoize should work with void opAssign +// https://issues.dlang.org/show_bug.cgi?id=20439 memoize should work with void opAssign @safe unittest { static struct S @@ -1496,7 +1501,7 @@ unittest assert(memoize!(() => S()) == S()); } -// 16079: memoize should work with classes +// https://issues.dlang.org/show_bug.cgi?id=16079: memoize should work with classes @system unittest // not @safe with -dip1000 due to memoize { int executed = 0; diff --git a/std/getopt.d b/std/getopt.d index ebcef9d99a4..cbc5a1dd46a 100644 --- a/std/getopt.d +++ b/std/getopt.d @@ -657,7 +657,8 @@ private template optionValidator(A...) static assert(optionValidator!(C,A,P,C,A,S,F) == ""); } -@safe unittest // bugzilla 15914 +// https://issues.dlang.org/show_bug.cgi?id=15914 +@safe unittest { import std.exception : assertThrown; bool opt; @@ -981,7 +982,7 @@ private bool handleOption(R)(string option, R receiver, ref string[] args, return ret; } -// 17574 +// https://issues.dlang.org/show_bug.cgi?id=17574 @safe unittest { import std.algorithm.searching : startsWith; @@ -1001,7 +1002,7 @@ private bool handleOption(R)(string option, R receiver, ref string[] args, assert(goe.msg.startsWith("Could not find")); } -// 5316 - arrays with arraySep +// https://issues.dlang.org/show_bug.cgi?id=5316 - arrays with arraySep @safe unittest { import std.conv; @@ -1030,7 +1031,7 @@ private bool handleOption(R)(string option, R receiver, ref string[] args, assert(names == ["foo", "bar", "baz"], to!string(names)); } -// 5316 - associative arrays with arraySep +// https://issues.dlang.org/show_bug.cgi?id=5316 - associative arrays with arraySep @safe unittest { import std.conv; @@ -1376,9 +1377,9 @@ private void setConfig(ref configuration cfg, config option) @safe pure nothrow assert(x == 2); } +// https://issues.dlang.org/show_bug.cgi?id=2142 @safe unittest { - // From bugzilla 2142 bool f_linenum, f_filename; string[] args = [ "", "-nl" ]; getopt @@ -1393,9 +1394,9 @@ private void setConfig(ref configuration cfg, config option) @safe pure nothrow assert(f_filename); } +// https://issues.dlang.org/show_bug.cgi?id=6887 @safe unittest { - // From bugzilla 6887 string[] p; string[] args = ["", "-pa"]; getopt(args, "p", &p); @@ -1403,18 +1404,18 @@ private void setConfig(ref configuration cfg, config option) @safe pure nothrow assert(p[0] == "a"); } +// https://issues.dlang.org/show_bug.cgi?id=6888 @safe unittest { - // From bugzilla 6888 int[string] foo; auto args = ["", "-t", "a=1"]; getopt(args, "t", &foo); assert(foo == ["a":1]); } +// https://issues.dlang.org/show_bug.cgi?id=9583 @safe unittest { - // From bugzilla 9583 int opt; auto args = ["prog", "--opt=123", "--", "--a", "--b", "--c"]; getopt(args, "opt", &opt); @@ -1429,7 +1430,7 @@ private void setConfig(ref configuration cfg, config option) @safe pure nothrow assert(foo == "hello"); assert(bar == "bar=baz"); - // From bugzilla 5762 + // From https://issues.dlang.org/show_bug.cgi?id=5762 string a; args = ["prog", "-a-0x12"]; getopt(args, config.bundling, "a|addr", &a); @@ -1438,7 +1439,7 @@ private void setConfig(ref configuration cfg, config option) @safe pure nothrow getopt(args, config.bundling, "a|addr", &a); assert(a == "-0x12"); - // From https://d.puremagic.com/issues/show_bug.cgi?id=11764 + // From https://issues.dlang.org/show_bug.cgi?id=11764 args = ["main", "-test"]; bool opt; args.getopt(config.passThrough, "opt", &opt); @@ -1456,7 +1457,8 @@ private void setConfig(ref configuration cfg, config option) @safe pure nothrow assert(o == "str"); } -@safe unittest // 5228 +// https://issues.dlang.org/show_bug.cgi?id=5228 +@safe unittest { import std.conv; import std.exception; @@ -1469,7 +1471,8 @@ private void setConfig(ref configuration cfg, config option) @safe pure nothrow assertThrown!ConvException(getopt(args, "abc", &abc)); } -@safe unittest // From bugzilla 7693 +// https://issues.dlang.org/show_bug.cgi?id=7693 +@safe unittest { import std.exception; @@ -1489,7 +1492,8 @@ private void setConfig(ref configuration cfg, config option) @safe pure nothrow assertNotThrown(getopt(args, "foo", &foo)); } -@safe unittest // same bug as 7693 only for bool +// Same as https://issues.dlang.org/show_bug.cgi?id=7693 only for `bool` +@safe unittest { import std.exception; @@ -1574,7 +1578,8 @@ private void setConfig(ref configuration cfg, config option) @safe pure nothrow assert(r.helpWanted); } -// Issue 13316 - std.getopt: implicit help option breaks the next argument +// std.getopt: implicit help option breaks the next argument +// https://issues.dlang.org/show_bug.cgi?id=13316 @safe unittest { string[] args = ["program", "--help", "--", "something"]; @@ -1591,7 +1596,8 @@ private void setConfig(ref configuration cfg, config option) @safe pure nothrow assert(args == ["program", "nonoption", "--option"]); } -// Issue 13317 - std.getopt: endOfOptions broken when it doesn't look like an option +// std.getopt: endOfOptions broken when it doesn't look like an option +// https://issues.dlang.org/show_bug.cgi?id=13317 @safe unittest { auto endOfOptionsBackup = endOfOptions; @@ -1604,7 +1610,8 @@ private void setConfig(ref configuration cfg, config option) @safe pure nothrow assert(args == ["program", "--option"]); } -// Issue 20480 - make std.getopt ready for DIP 1000 +// make std.getopt ready for DIP 1000 +// https://issues.dlang.org/show_bug.cgi?id=20480 @safe unittest { string[] args = ["test", "--foo", "42", "--bar", "BAR"]; @@ -1738,7 +1745,8 @@ void defaultGetoptFormatter(Output)(Output output, string text, Option[] opt, st assert(wanted == helpMsg, helpMsg ~ wanted); } -@safe unittest // Issue 14724 +// https://issues.dlang.org/show_bug.cgi?id=14724 +@safe unittest { bool a; auto args = ["prog", "--help"]; @@ -1769,7 +1777,8 @@ void defaultGetoptFormatter(Output)(Output output, string text, Option[] opt, st assertNotThrown!AssertError(getopt(args, "abc", &abc, "def", &def)); } -@safe unittest // Issue 17327 repeated option use +// https://issues.dlang.org/show_bug.cgi?id=17327 repeated option use +@safe unittest { long num = 0; @@ -1856,7 +1865,9 @@ void defaultGetoptFormatter(Output)(Output output, string text, Option[] opt, st assert(y == 50); } -@safe unittest // Hyphens at the start of option values; Issue 17650 +// Hyphens at the start of option values; +// https://issues.dlang.org/show_bug.cgi?id=17650 +@safe unittest { auto args = ["program", "-m", "-5", "-n", "-50", "-c", "-", "-f", "-"]; diff --git a/std/internal/cstring.d b/std/internal/cstring.d index 8453fd297c9..8aed7bbf1fa 100644 --- a/std/internal/cstring.d +++ b/std/internal/cstring.d @@ -84,7 +84,8 @@ if (isSomeChar!To && (isInputRange!From || isSomeString!From) && // Note: res._ptr can't point to res._buff as structs are movable. - static if (isSomeString!From) // Bugzilla 1498 + // https://issues.dlang.org/show_bug.cgi?id=1498 + static if (isSomeString!From) { if (str is null) { @@ -200,7 +201,7 @@ nothrow @nogc @system unittest assert(tempCString(abc[].byChar)[] == abc); } -// Bugzilla 14980 +// https://issues.dlang.org/show_bug.cgi?id=14980 pure nothrow @nogc @safe unittest { const(char[]) str = null; diff --git a/std/internal/digest/sha_SSSE3.d b/std/internal/digest/sha_SSSE3.d index ff27e638526..5598324208d 100644 --- a/std/internal/digest/sha_SSSE3.d +++ b/std/internal/digest/sha_SSSE3.d @@ -17,7 +17,7 @@ module std.internal.digest.sha_SSSE3; version (D_InlineAsm_X86) { - version (D_PIC) {} // Bugzilla 9378 + version (D_PIC) {} // https://issues.dlang.org/show_bug.cgi?id=9378 else { private version = USE_SSSE3; @@ -721,7 +721,8 @@ version (USE_SSSE3) } } - // constants as extra argument for PIC, see Bugzilla 9378 + // constants as extra argument for PIC + // https://issues.dlang.org/show_bug.cgi?id=9378 import std.meta : AliasSeq; version (_64Bit) alias ExtraArgs = AliasSeq!(typeof(&constants)); diff --git a/std/internal/math/biguintcore.d b/std/internal/math/biguintcore.d index ead344cb704..4ad12edf8ab 100644 --- a/std/internal/math/biguintcore.d +++ b/std/internal/math/biguintcore.d @@ -54,7 +54,8 @@ import std.traits; private: // dipatchers to the right low-level primitives. Added to allow BigInt CTFE for -// 32 bit systems (issue 14767) although it's used by the other architectures too. +// 32 bit systems (https://issues.dlang.org/show_bug.cgi?id=14767) although it's +// used by the other architectures too. // See comments below in case it has to be refactored. version (X86) uint multibyteAddSub(char op)(uint[] dest, const(uint)[] src1, const (uint)[] src2, uint carry) @@ -1127,16 +1128,17 @@ public: // ulong comparison test BigUint a = [1]; assert(a == 1); - assert(a < 0x8000_0000_0000_0000UL); // bug 9548 + // https://issues.dlang.org/show_bug.cgi?id=9548 + assert(a < 0x8000_0000_0000_0000UL); - // bug 12234 + // https://issues.dlang.org/show_bug.cgi?id=12234 BigUint z = [0]; assert(z == 0UL); assert(!(z > 0UL)); assert(!(z < 0UL)); } -// issue 16223 +// https://issues.dlang.org/show_bug.cgi?id=16223 @system pure nothrow unittest { BigUint a = [3]; diff --git a/std/json.d b/std/json.d index 278a07098a0..f5035e32173 100644 --- a/std/json.d +++ b/std/json.d @@ -459,7 +459,8 @@ struct JSONValue string t = arg; () @trusted { store.str = t; }(); } - else static if (isSomeString!T) // issue 15884 + // https://issues.dlang.org/show_bug.cgi?id=15884 + else static if (isSomeString!T) { type_tag = JSONType.string; // FIXME: std.Array.Array(Range) is not deduced as 'pure' @@ -1377,7 +1378,8 @@ if (isInputRange!T && !isInfinite!T && isSomeChar!(ElementEncodingType!T)) assert(json["key1"]["key2"].integer == 1); } -@safe unittest // issue 20527 +// https://issues.dlang.org/show_bug.cgi?id=20527 +@safe unittest { static assert(parseJSON(`{"a" : 2}`)["a"].integer == 2); } @@ -1552,7 +1554,7 @@ if (isOutputRange!(Out,char)) } import std.algorithm.sorting : sort; - // @@@BUG@@@ 14439 + // https://issues.dlang.org/show_bug.cgi?id=14439 // auto names = obj.keys; // aa.keys can't be called in @safe code auto names = new string[obj.length]; size_t i = 0; @@ -1663,7 +1665,8 @@ if (isOutputRange!(Out,char)) toValue(root, 0); } -@safe unittest // bugzilla 12897 + // https://issues.dlang.org/show_bug.cgi?id=12897 +@safe unittest { JSONValue jv0 = JSONValue("test测试"); assert(toJSON(jv0, false, JSONOptions.escapeNonAsciiChars) == `"test\u6D4B\u8BD5"`); @@ -1677,7 +1680,8 @@ if (isOutputRange!(Out,char)) assert(toJSON(jv1, false, JSONOptions.none) == `"été"`); } -@system unittest // bugzilla 20511 +// https://issues.dlang.org/show_bug.cgi?id=20511 +@system unittest { import std.format : formattedWrite; import std.range : nullSink, outputRangeObject; @@ -1783,10 +1787,9 @@ class JSONException : Exception assert(jv3.str == "\u001C"); } +// https://issues.dlang.org/show_bug.cgi?id=11504 @system unittest { - // Bugzilla 11504 - JSONValue jv = 1; assert(jv.type == JSONType.integer); @@ -1958,7 +1961,7 @@ class JSONException : Exception @system pure unittest { - // Bugzilla 12969 + // https://issues.dlang.org/show_bug.cgi?id=12969 JSONValue jv; jv["int"] = 123; @@ -2058,7 +2061,8 @@ pure nothrow @safe @nogc unittest assert(testVal.isNull); } -pure nothrow @safe unittest // issue 15884 +// https://issues.dlang.org/show_bug.cgi?id=15884 +pure nothrow @safe unittest { import std.typecons; void Test(C)() { @@ -2073,7 +2077,8 @@ pure nothrow @safe unittest // issue 15884 Test!dchar(); } -@safe unittest // issue 15885 +// https://issues.dlang.org/show_bug.cgi?id=15885 +@safe unittest { enum bool realInDoublePrecision = real.mant_dig == double.mant_dig; @@ -2107,34 +2112,39 @@ pure nothrow @safe unittest // issue 15884 assert(test(3*minSub)); } -@safe unittest // issue 17555 +// https://issues.dlang.org/show_bug.cgi?id=17555 +@safe unittest { import std.exception : assertThrown; assertThrown!JSONException(parseJSON("\"a\nb\"")); } -@safe unittest // issue 17556 +// https://issues.dlang.org/show_bug.cgi?id=17556 +@safe unittest { auto v = JSONValue("\U0001D11E"); auto j = toJSON(v, false, JSONOptions.escapeNonAsciiChars); assert(j == `"\uD834\uDD1E"`); } -@safe unittest // issue 5904 +// https://issues.dlang.org/show_bug.cgi?id=5904 +@safe unittest { string s = `"\uD834\uDD1E"`; auto j = parseJSON(s); assert(j.str == "\U0001D11E"); } -@safe unittest // issue 17557 +// https://issues.dlang.org/show_bug.cgi?id=17557 +@safe unittest { assert(parseJSON("\"\xFF\"").str == "\xFF"); assert(parseJSON("\"\U0001D11E\"").str == "\U0001D11E"); } -@safe unittest // issue 17553 +// https://issues.dlang.org/show_bug.cgi?id=17553 +@safe unittest { auto v = JSONValue("\xFF"); assert(toJSON(v) == "\"\xFF\""); @@ -2147,7 +2157,8 @@ pure nothrow @safe unittest // issue 15884 assert(parseJSON("\"\U0001D11E\"".byChar).str == "\U0001D11E"); } -@safe unittest // JSONOptions.doNotEscapeSlashes (issue 17587) +// JSONOptions.doNotEscapeSlashes (https://issues.dlang.org/show_bug.cgi?id=17587) +@safe unittest { assert(parseJSON(`"/"`).toString == `"\/"`); assert(parseJSON(`"\/"`).toString == `"\/"`); @@ -2155,7 +2166,8 @@ pure nothrow @safe unittest // issue 15884 assert(parseJSON(`"\/"`).toString(JSONOptions.doNotEscapeSlashes) == `"/"`); } -@safe unittest // JSONOptions.strictParsing (issue 16639) +// JSONOptions.strictParsing (https://issues.dlang.org/show_bug.cgi?id=16639) +@safe unittest { import std.exception : assertThrown; @@ -2252,7 +2264,7 @@ pure nothrow @safe unittest // issue 15884 assertThrown(parseJSON(s, -1, JSONOptions.strictParsing)); } -// Issue20330 +// https://issues.dlang.org/show_bug.cgi?id=20330 @safe unittest { import std.array : appender; @@ -2266,7 +2278,7 @@ pure nothrow @safe unittest // issue 15884 assert(app.data == s, app.data); } -// Issue20330 +// https://issues.dlang.org/show_bug.cgi?id=20330 @safe unittest { import std.array : appender; diff --git a/std/math.d b/std/math.d index 33db70e60e4..61dcd3c9f1c 100644 --- a/std/math.d +++ b/std/math.d @@ -661,7 +661,8 @@ deprecated }} } -// see issue #20205, to avoid falling into the trap again +// see https://issues.dlang.org/show_bug.cgi?id=20205 +// to avoid falling into the trap again @safe pure nothrow @nogc unittest { assert(50 - abs(-100) == -50); @@ -727,8 +728,8 @@ auto conj(Num)(Num z) @safe pure nothrow @nogc if (is(Num* : const(cfloat*)) || is(Num* : const(cdouble*)) || is(Num* : const(creal*))) { - //FIXME - //Issue 14206 + // FIXME + // https://issues.dlang.org/show_bug.cgi?id=14206 static if (is(Num* : const(cdouble*))) return cast(cdouble) conj(cast(creal) z); else @@ -751,7 +752,8 @@ deprecated ireal z = -3.2Li; assert(conj(z) == -z); } -//Issue 14206 + +// https://issues.dlang.org/show_bug.cgi?id=14206 deprecated @safe pure nothrow @nogc unittest { @@ -760,7 +762,8 @@ deprecated idouble z = -3.2i; assert(conj(z) == -z); } -//Issue 14206 + +// https://issues.dlang.org/show_bug.cgi?id=14206 deprecated @safe pure nothrow @nogc unittest { @@ -3583,7 +3586,7 @@ if (isFloatingPoint!T) tuple(T.nan, T.nan, int.min), tuple(-T.nan, -T.nan, int.min), - // Phobos issue #16026: + // https://issues.dlang.org/show_bug.cgi?id=16026: tuple(3 * (T.min_normal * T.epsilon), T( .75), (T.min_exp - T.mant_dig) + 2) ]; @@ -3644,7 +3647,7 @@ if (isFloatingPoint!T) tuple(T.nan, T.nan, int.min), tuple(-T.nan, -T.nan, int.min), - // Phobos issue #16026: + // https://issues.dlang.org/show_bug.cgi?id=16026: tuple(3 * (T.min_normal * T.epsilon), T( .75), (T.min_exp - T.mant_dig) + 2) ]; @@ -4010,7 +4013,8 @@ float ldexp(float n, int exp) @safe pure nothrow @nogc { return ldexp(cast(real) else static assert(false, "Floating point type real not supported"); } -/* workaround Issue 14718, float parsing depends on platform strtold +/* workaround https://issues.dlang.org/show_bug.cgi?id=14718 + float parsing depends on platform strtold @safe pure nothrow @nogc unittest { assert(ldexp(1.0, -1024) == 0x1p-1024); @@ -8112,7 +8116,7 @@ if (isIntegral!(F) && isIntegral!(G)) assert(pow(three, four) == 81); } -// issue 7006 +// https://issues.dlang.org/show_bug.cgi?id=7006 @safe pure nothrow @nogc unittest { assert(pow(5, -1) == 0); @@ -8457,7 +8461,7 @@ if (isFloatingPoint!(F) && isFloatingPoint!(G)) assert(isIdentical(pow(0.0, 6.0), 0.0)); assert(isIdentical(pow(-0.0, 6.0), 0.0)); - // Issue #14786 fixed + // https://issues.dlang.org/show_bug.cgi?id=14786 fixed immutable real maxOdd = pow(2.0L, real.mant_dig) - 1.0L; assert(pow(-1.0L, maxOdd) == -1.0L); assert(pow(-1.0L, -maxOdd) == -1.0L); @@ -9300,7 +9304,7 @@ bool approxEqual(T, U, V)(T value, U reference, V maxRelDiff = 1e-2, V maxAbsDif { // relative comparison depends on reference, make sure proper // side is used when comparing range to single value. Based on - // bugzilla issue 15763 + // https://issues.dlang.org/show_bug.cgi?id=15763 auto a = [2e-3 - 1e-5]; auto b = 2e-3 + 1e-5; assert(a[0].approxEqual(b)); @@ -9692,9 +9696,10 @@ private template FloatingPointBaseType(T) } } +// https://issues.dlang.org/show_bug.cgi?id=6381 +// floor/ceil should be usable in pure function. @safe pure nothrow unittest { - // issue 6381: floor/ceil should be usable in pure function. auto x = floor(1.2); auto y = ceil(1.2); } @@ -10092,7 +10097,8 @@ if (isFloatingPoint!T) }} } -@safe @nogc pure nothrow unittest // Issue 15973 +// https://issues.dlang.org/show_bug.cgi?id=15973 +@safe @nogc pure nothrow unittest { assert(nextPow2(uint.max / 2) == uint.max / 2 + 1); assert(nextPow2(uint.max / 2 + 2) == 0); diff --git a/std/meta.d b/std/meta.d index 8d32fb31a5c..2e554f5201f 100644 --- a/std/meta.d +++ b/std/meta.d @@ -517,10 +517,10 @@ template NoDuplicates(TList...) { import std.range : iota; - // Bugzilla 14561: huge enums + // https://issues.dlang.org/show_bug.cgi?id=14561: huge enums alias LongList = Repeat!(1500, int); static assert(NoDuplicates!LongList.length == 1); - // Bugzilla 17995: huge enums, revisited + // https://issues.dlang.org/show_bug.cgi?id=17995: huge enums, revisited alias a = NoDuplicates!(AliasSeq!(1, Repeat!(1000, 3))); alias b = NoDuplicates!(AliasSeq!(1, Repeat!(10, 3))); diff --git a/std/mmfile.d b/std/mmfile.d index 29dedccd034..a6733420aa0 100644 --- a/std/mmfile.d +++ b/std/mmfile.d @@ -676,7 +676,7 @@ private: } version (linux) -@system unittest // Issue 14868 +@system unittest // https://issues.dlang.org/show_bug.cgi?id=14868 { import std.file : deleteme; import std.typecons : scoped; @@ -699,7 +699,9 @@ version (linux) assert(.close(fd) == -1); } -@system unittest // Issue 14994, 14995 +// https://issues.dlang.org/show_bug.cgi?id=14994 +// https://issues.dlang.org/show_bug.cgi?id=14995 +@system unittest { import std.file : deleteme; import std.typecons : scoped; diff --git a/std/net/curl.d b/std/net/curl.d index 05f335ca55c..7ea2cebb30f 100644 --- a/std/net/curl.d +++ b/std/net/curl.d @@ -215,7 +215,8 @@ version (StdUnittest) } catch (Throwable e) { - stderr.writeln(e); // Bugzilla 7018 + // https://issues.dlang.org/show_bug.cgi?id=7018 + stderr.writeln(e); } } } @@ -1114,7 +1115,8 @@ private auto _basicHTTP(T)(const(char)[] url, const(void)[] sendData, HTTP clien assert(e.status == 404); } -// Bugzilla 14760 - content length must be reset after post +// Content length must be reset after post +// https://issues.dlang.org/show_bug.cgi?id=14760 @system unittest { import std.algorithm.searching : canFind; @@ -2097,7 +2099,7 @@ private mixin template Protocol() http.setAuthentication("user", "pass"); http.perform(); - // Bugzilla 17540 + // https://issues.dlang.org/show_bug.cgi?id=17540 http.setNoProxy("www.example.com"); } @@ -3299,7 +3301,7 @@ struct HTTP http.perform(); assert(http.p.charset == "foo"); - // Bugzilla 16736 + // https://issues.dlang.org/show_bug.cgi?id=16736 double val; CurlCode code; @@ -4899,7 +4901,7 @@ private struct Pool(Data) private struct _async() { static: - // @@@@BUG 15831@@@@ + // https://issues.dlang.org/show_bug.cgi?id=15831 // this should be inside byLineAsync // Range that reads one chunk at a time asynchronously. private struct ChunkInputRange @@ -4928,7 +4930,7 @@ static: } } - // @@@@BUG 15831@@@@ + // https://issues.dlang.org/show_bug.cgi?id=15831 // this should be inside byLineAsync // Range that reads one line at a time asynchronously. private static struct LineInputRange(Char) diff --git a/std/numeric.d b/std/numeric.d index d32688c16d4..b3b2591fd9d 100644 --- a/std/numeric.d +++ b/std/numeric.d @@ -605,7 +605,7 @@ public: template toString() { import std.format : FormatSpec, formatValue; - // Needs to be a template because of DMD @@BUG@@ 13737. + // Needs to be a template because of https://issues.dlang.org/show_bug.cgi?id=13737. void toString()(scope void delegate(const(char)[]) sink, scope const ref FormatSpec!char fmt) { sink.formatValue(get!real, fmt); @@ -1675,7 +1675,7 @@ T findRoot(T, R)(scope R delegate(T) f, in T a, in T b, printf("POWER TOTAL = %d avg = %f ", powercalls, (1.0*powercalls)/powerProblems); */ - //Issue 14231 + // https://issues.dlang.org/show_bug.cgi?id=14231 auto xp = findRoot((float x) => x, 0f, 1f); auto xn = findRoot((float x) => x, -1f, -0f); } @@ -3048,7 +3048,7 @@ if (!isIntegral!T && } } -// Issue 7102 +// https://issues.dlang.org/show_bug.cgi?id=7102 @system pure unittest { import std.bigint : BigInt; @@ -3078,7 +3078,7 @@ if (!isIntegral!T && assert(gcd(CrippledInt(2310), CrippledInt(1309)) == CrippledInt(77)); } -// Issue 19514 +// https://issues.dlang.org/show_bug.cgi?id=19514 @system pure unittest { import std.bigint : BigInt; @@ -3337,7 +3337,9 @@ private: // // Also, this is unsafe because the memSpace buffer will be cast // to immutable. - public this(lookup_t[] memSpace) // Public b/c of bug 4636. + // + // Public b/c of https://issues.dlang.org/show_bug.cgi?id=4636. + public this(lookup_t[] memSpace) { immutable size = memSpace.length / 2; diff --git a/std/parallelism.d b/std/parallelism.d index 2170ca93a70..4c638dc0702 100644 --- a/std/parallelism.d +++ b/std/parallelism.d @@ -553,7 +553,8 @@ struct Task(alias fun, Args...) } } - // Work around DMD bug 6588, allow immutable elements. + // Work around DMD bug https://issues.dlang.org/show_bug.cgi?id=6588, + // allow immutable elements. static if (allSatisfy!(isAssignable, Args)) { typeof(this) opAssign(typeof(this) rhs) @@ -1464,7 +1465,7 @@ private: // Disabled until writing code to support // running thread with specified priority - // See https://d.puremagic.com/issues/show_bug.cgi?id=8960 + // See https://issues.dlang.org/show_bug.cgi?id=8960 /*if (priority != int.max) { @@ -2709,8 +2710,8 @@ public: alias RTask = Task!(run, typeof(&reduceOnRange), R, size_t, size_t); RTask[] tasks; - // Can't use alloca() due to Bug 3753. Use a fixed buffer - // backed by malloc(). + // Can't use alloca() due to https://issues.dlang.org/show_bug.cgi?id=3753 + // Use a fixed buffer backed by malloc(). enum maxStack = 2_048; byte[maxStack] buf = void; immutable size_t nBytesNeeded = nWorkUnits * RTask.sizeof; @@ -3581,7 +3582,8 @@ ParallelForeach!R parallel(R)(R range, size_t workUnitSize) return taskPool.parallel(range, workUnitSize); } -// #17019: `each` should be usable with parallel +// `each` should be usable with parallel +// https://issues.dlang.org/show_bug.cgi?id=17019 @system unittest { import std.algorithm.iteration : each, sum; @@ -3628,9 +3630,10 @@ private void submitAndExecute( // The logical thing to do would be to just use alloca() here, but that // causes problems on Windows for reasons that I don't understand // (tentatively a compiler bug) and definitely doesn't work on Posix due - // to Bug 3753. Therefore, allocate a fixed buffer and fall back to - // malloc() if someone's using a ridiculous amount of threads. Also, - // the using a byte array instead of a PTask array as the fixed buffer + // to https://issues.dlang.org/show_bug.cgi?id=3753. + // Therefore, allocate a fixed buffer and fall back to `malloc()` if + // someone's using a ridiculous amount of threads. + // Also, the using a byte array instead of a PTask array as the fixed buffer // is to prevent d'tors from being called on uninitialized excess PTask // instances. enum nBuf = 64; @@ -4363,7 +4366,7 @@ version (StdUnittest) pool2.finish(true); // blocking assert(tSlow2.done); - // Test fix for Bug 8582 by making pool size zero. + // Test fix for https://issues.dlang.org/show_bug.cgi?id=8582 by making pool size zero. auto pool3 = new TaskPool(0); auto tSlow3 = task!slowFun(); pool3.put(tSlow3); diff --git a/std/path.d b/std/path.d index 5d96de3649f..73eafdd5e40 100644 --- a/std/path.d +++ b/std/path.d @@ -1238,7 +1238,7 @@ if (isSomeChar!C1 && is(Unqual!C1 == Unqual!C2)) static assert(setExtension("file"w.dup, "ext"w) == "file.ext"); static assert(setExtension("file.old"d.dup, "new"d) == "file.new"); - // Issue 10601 + // https://issues.dlang.org/show_bug.cgi?id=10601 assert(setExtension("file", "") == "file"); assert(setExtension("file.ext", "") == "file"); } diff --git a/std/process.d b/std/process.d index be36ac9e869..7cf55efe486 100644 --- a/std/process.d +++ b/std/process.d @@ -1268,7 +1268,8 @@ private Pid spawnProcessImpl(scope const(char)[] commandLine, DWORD dwCreationFlags = CREATE_UNICODE_ENVIRONMENT | ((config & Config.suppressConsole) ? CREATE_NO_WINDOW : 0); - auto pworkDir = workDir.tempCStringW(); // workaround until Bugzilla 14696 is fixed + // workaround until https://issues.dlang.org/show_bug.cgi?id=14696 is fixed + auto pworkDir = workDir.tempCStringW(); if (!CreateProcessW(null, commandLine.tempCStringW().buffPtr, null, null, true, dwCreationFlags, envz, workDir.length ? pworkDir : null, &startinfo, &pi)) @@ -1739,7 +1740,8 @@ version (Posix) @system unittest spawnProcess([prog.path], null, Config.none, directory).wait(); } -@system unittest // Reopening the standard streams (issue 13258) +// Reopening the standard streams (https://issues.dlang.org/show_bug.cgi?id=13258) +@system unittest { import std.string; import std.file; @@ -1765,8 +1767,9 @@ version (Posix) @system unittest assert(lines == ["foo", "bar"]); } +// MSVCRT workaround (https://issues.dlang.org/show_bug.cgi?id=14422) version (Windows) -@system unittest // MSVCRT workaround (issue 14422) +@system unittest { auto fn = uniqueTempPath(); std.file.write(fn, "AAAAAAAAAA"); diff --git a/std/random.d b/std/random.d index 6912a3ab395..bb41aac0e67 100644 --- a/std/random.d +++ b/std/random.d @@ -163,11 +163,11 @@ else version (WatchOS) assert(10.iota.randomSample(3, rnd2).equal([7, 8, 9])); // Cover all elements in an array in random order - version (X86_64) // Issue 15147 + version (X86_64) // https://issues.dlang.org/show_bug.cgi?id=15147 assert(10.iota.randomCover(rnd2).equal([7, 4, 2, 0, 1, 6, 8, 3, 9, 5])); // Shuffle an array - version (X86_64) // Issue 15147 + version (X86_64) // https://issues.dlang.org/show_bug.cgi?id=15147 assert([0, 1, 2, 4, 5].randomShuffle(rnd2).equal([2, 0, 4, 5, 1])); } @@ -283,7 +283,8 @@ template isUniformRNG(Rng) @safe unittest { - // Issue 19837: two-argument predicate should not require @property on `front`. + // two-argument predicate should not require @property on `front` + // https://issues.dlang.org/show_bug.cgi?id=19837 struct Rng { float front() {return 0;} @@ -709,7 +710,8 @@ alias MinstdRand = LinearCongruentialEngine!(uint, 48_271, 0, 2_147_483_647); {{ auto rnd1 = Type(123_456_789); rnd1.popFront(); - auto rnd2 = ((const ref Type a) => a.save())(rnd1); // Issue 15853. + // https://issues.dlang.org/show_bug.cgi?id=15853 + auto rnd2 = ((const ref Type a) => a.save())(rnd1); assert(rnd1 == rnd2); // Enable next test when RNGs are reference types version (none) { assert(rnd1 !is rnd2); } @@ -1158,7 +1160,8 @@ alias Mt19937_64 = MersenneTwisterEngine!(ulong, 64, 312, 156, 31, {{ auto gen1 = Type(123_456_789); gen1.popFront(); - auto gen2 = ((const ref Type a) => a.save())(gen1); // Issue 15853. + // https://issues.dlang.org/show_bug.cgi?id=15853 + auto gen2 = ((const ref Type a) => a.save())(gen1); assert(gen1 == gen2); // Danger, Will Robinson -- no opEquals for MT // Enable next test when RNGs are reference types version (none) { assert(gen1 !is gen2); } @@ -1167,7 +1170,8 @@ alias Mt19937_64 = MersenneTwisterEngine!(ulong, 64, 312, 156, 31, }} } -@safe @nogc pure nothrow unittest //11690 +// https://issues.dlang.org/show_bug.cgi?id=11690 +@safe @nogc pure nothrow unittest { alias MT(UIntType, uint w) = MersenneTwisterEngine!(UIntType, w, 624, 397, 31, 0x9908b0df, 11, 0xffffffff, 7, @@ -1596,7 +1600,8 @@ alias Xorshift = Xorshift128; /// ditto { auto rnd1 = Type(123_456_789); rnd1.popFront(); - auto rnd2 = ((const ref Type a) => a.save())(rnd1); // Issue 15853. + // https://issues.dlang.org/show_bug.cgi?id=15853 + auto rnd2 = ((const ref Type a) => a.save())(rnd1); assert(rnd1 == rnd2); // Enable next test when RNGs are reference types version (none) { assert(rnd1 !is rnd2); } @@ -1667,10 +1672,10 @@ else { private ulong bootstrapSeed() @nogc nothrow { - // Issue 19580 - previously used `ulong result = void` to start with - // an arbitary value but using an uninitialized variable's value is - // undefined behavior and enabled unwanted optimizations on non-DMD - // compilers. + // https://issues.dlang.org/show_bug.cgi?id=19580 + // previously used `ulong result = void` to start with an arbitary value + // but using an uninitialized variable's value is undefined behavior + // and enabled unwanted optimizations on non-DMD compilers. ulong result; enum ulong m = 0xc6a4_a793_5bd1_e995UL; // MurmurHash2_64A constant. void updateResult(ulong x) @@ -2380,7 +2385,7 @@ if (!is(T == enum) && (isIntegral!T || isSomeChar!T)) assert(rnd.uniform!ulong == 4838462006927449017); enum Fruit { apple, mango, pear } - version (X86_64) // Issue 15147 + version (X86_64) // https://issues.dlang.org/show_bug.cgi?id=15147 assert(rnd.uniform!Fruit == Fruit.mango); } @@ -2627,7 +2632,7 @@ auto ref choice(Range)(auto ref Range range) auto rnd = MinstdRand0(42); auto elem = [1, 2, 3, 4, 5].choice(rnd); - version (X86_64) // Issue 15147 + version (X86_64) // https://issues.dlang.org/show_bug.cgi?id=15147 assert(elem == 3); } @@ -2709,7 +2714,7 @@ if (isRandomAccessRange!Range) auto rnd = MinstdRand0(42); auto arr = [1, 2, 3, 4, 5].randomShuffle(rnd); - version (X86_64) // Issue 15147 + version (X86_64) // https://issues.dlang.org/show_bug.cgi?id=15147 assert(arr == [3, 5, 2, 4, 1]); } @@ -2736,13 +2741,15 @@ if (isRandomAccessRange!Range) auto gen1 = Xorshift(123_456_789); auto gen2 = gen1.save(); sa[] = sb[]; - // Issue 19156 - @nogc std.random.randomShuffle. + // @nogc std.random.randomShuffle. + // https://issues.dlang.org/show_bug.cgi?id=19156 () @nogc nothrow pure { randomShuffle(sa[], gen1); }(); partialShuffle(sb[], sb.length, gen2); assert(sa[] == sb[]); } -@safe unittest // bugzilla 18501 +// https://issues.dlang.org/show_bug.cgi?id=18501 +@safe unittest { import std.algorithm.comparison : among; auto r = randomShuffle([0,1]); @@ -2797,15 +2804,15 @@ if (isRandomAccessRange!Range) auto arr = [1, 2, 3, 4, 5, 6]; arr = arr.dup.partialShuffle(1, rnd); - version (X86_64) // Issue 15147 + version (X86_64) // https://issues.dlang.org/show_bug.cgi?id=15147 assert(arr == [2, 1, 3, 4, 5, 6]); // 1<->2 arr = arr.dup.partialShuffle(2, rnd); - version (X86_64) // Issue 15147 + version (X86_64) // https://issues.dlang.org/show_bug.cgi?id=15147 assert(arr == [1, 4, 3, 2, 5, 6]); // 1<->2, 2<->4 arr = arr.dup.partialShuffle(3, rnd); - version (X86_64) // Issue 15147 + version (X86_64) // https://issues.dlang.org/show_bug.cgi?id=15147 assert(arr == [5, 4, 6, 2, 1, 3]); // 1<->5, 2<->4, 3<->6 } @@ -3211,7 +3218,7 @@ if (isRandomAccessRange!Range) import std.range : iota; auto rnd = MinstdRand0(42); - version (X86_64) // Issue 15147 + version (X86_64) // https://issues.dlang.org/show_bug.cgi?id=15147 assert(10.iota.randomCover(rnd).equal([7, 4, 2, 0, 1, 6, 8, 3, 9, 5])); } @@ -3225,7 +3232,8 @@ if (isRandomAccessRange!Range) @nogc nothrow pure @safe unittest { - // Issue 14001 - Optionally @nogc std.random.randomCover + // Optionally @nogc std.random.randomCover + // https://issues.dlang.org/show_bug.cgi?id=14001 auto rng = Xorshift(123_456_789); int[5] sa = [1, 2, 3, 4, 5]; auto r = randomCover(sa[], rng); @@ -3277,13 +3285,13 @@ if (isRandomAccessRange!Range) @safe unittest { - // Bugzilla 12589 + // https://issues.dlang.org/show_bug.cgi?id=12589 int[] r = []; auto rc = randomCover(r); assert(rc.length == 0); assert(rc.empty); - // Bugzilla 16724 + // https://issues.dlang.org/show_bug.cgi?id=16724 import std.range : iota; auto range = iota(10); auto randy = range.randomCover; @@ -3805,7 +3813,8 @@ if (isInputRange!Range && hasLength!Range && isUniformRNG!UniformRNG) const(int)[] a = [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 ]; foreach (UniformRNG; PseudoRngTypes) - (){ // avoid workaround optimizations for large functions @@@BUG@@@ 2396 + (){ // avoid workaround optimizations for large functions + // https://issues.dlang.org/show_bug.cgi?id=2396 auto rng = UniformRNG(1234); /* First test the most general case: randomSample of input range, with and * without a specified random number generator. @@ -3989,7 +3998,7 @@ if (isInputRange!Range && hasLength!Range && isUniformRNG!UniformRNG) } /* Check that it also works if .index is called before .front. - * See: http://d.puremagic.com/issues/show_bug.cgi?id=10322 + * See: https://issues.dlang.org/show_bug.cgi?id=10322 */ auto sample3 = randomSample(TestInputRange(), 654, 654_321); for (; !sample3.empty; sample3.popFront()) @@ -4097,11 +4106,12 @@ if (isInputRange!Range && hasLength!Range && isUniformRNG!UniformRNG) static if (isForwardRange!UniformRNG) { auto sample1 = randomSample(a, 5, rng); - auto sample2 = ((const ref typeof(sample1) a) => a.save)(sample1); // Issue 15853. + // https://issues.dlang.org/show_bug.cgi?id=15853 + auto sample2 = ((const ref typeof(sample1) a) => a.save)(sample1); assert(sample1.array() == sample2.array()); } - // Bugzilla 8314 + // https://issues.dlang.org/show_bug.cgi?id=8314 { auto sample(RandomGen)(uint seed) { return randomSample(a, 1, RandomGen(seed)).front; } diff --git a/std/range/interfaces.d b/std/range/interfaces.d index c57265c66fb..4f8eba73278 100644 --- a/std/range/interfaces.d +++ b/std/range/interfaces.d @@ -251,9 +251,9 @@ interface OutputRange(E) { void put(E); } +// https://issues.dlang.org/show_bug.cgi?id=6973 @safe unittest { - // 6973 static assert(isOutputRange!(OutputRange!int, int)); } diff --git a/std/range/package.d b/std/range/package.d index 10b0235ecf1..97976c09539 100644 --- a/std/range/package.d +++ b/std/range/package.d @@ -473,7 +473,7 @@ pure @safe nothrow @nogc unittest assert(equal(r, excepted[])); } -// Issue 12662 +// https://issues.dlang.org/show_bug.cgi?id=12662 pure @safe nothrow @nogc unittest { int[3] src = [1,2,3]; @@ -714,7 +714,7 @@ debug pure nothrow @system unittest scope (success) assert(passed); import core.exception : AssertError; //std.exception.assertThrown won't do because it can't infer nothrow - // @@@BUG@@@ 12647 + // https://issues.dlang.org/show_bug.cgi?id=12647 try { auto unused = testArr[].stride(0); @@ -765,7 +765,7 @@ pure @safe nothrow unittest // assert(s2[$ .. $].empty); assert(s2[s2.opDollar .. s2.opDollar].empty); - // Test fix for Bug 5035 + // Test fix for https://issues.dlang.org/show_bug.cgi?id=5035 auto m = [1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4]; // 3 rows, 4 columns auto col = stride(m, 4); assert(equal(col, [1, 1, 1])); @@ -1323,7 +1323,8 @@ pure @safe nothrow unittest assert(c.moveAt(5) == 1); } - // Make sure bug 3311 is fixed. ChainImpl should compile even if not all + + // Make sure https://issues.dlang.org/show_bug.cgi?id=3311 is fixed. // elements are mutable. assert(equal(chain(iota(0, 3), iota(0, 3)), [0, 1, 2, 0, 1, 2])); @@ -1343,7 +1344,8 @@ pure @safe nothrow unittest // pair of DummyRange types, in either order. foreach (DummyType1; AllDummyRanges) - (){ // workaround slow optimizations for large functions @@@BUG@@@ 2396 + (){ // workaround slow optimizations for large functions + // https://issues.dlang.org/show_bug.cgi?id=2396 DummyType1 dummy1; foreach (DummyType2; AllDummyRanges) { @@ -1391,7 +1393,8 @@ pure @safe nothrow @nogc unittest assert(chain(a, b).empty); } -pure @safe unittest // issue 18657 +// https://issues.dlang.org/show_bug.cgi?id=18657 +pure @safe unittest { import std.algorithm.comparison : equal; string s = "foo"; @@ -1657,7 +1660,8 @@ private struct ChooseResult(R1, R2) } } -pure @safe unittest // issue 18657 +// https://issues.dlang.org/show_bug.cgi?id=18657 +pure @safe unittest { import std.algorithm.comparison : equal; string s = "foo"; @@ -1697,6 +1701,7 @@ pure @safe unittest // issue 18657 choose(true, [0], R()).save; choose(true, R(), [0]).save; } + @safe unittest // copy is @system { static struct R @@ -1711,6 +1716,7 @@ pure @safe unittest // issue 18657 static assert(!__traits(compiles, choose(true, [0], R()).save)); static assert(!__traits(compiles, choose(true, R(), [0]).save)); } + @system unittest // .save is @system { static struct R @@ -1724,6 +1730,7 @@ pure @safe unittest // issue 18657 choose(true, [0], R()).save; choose(true, R(), [0]).save; } + @safe unittest // .save is @system { static struct R @@ -1737,6 +1744,7 @@ pure @safe unittest // issue 18657 static assert(!__traits(compiles, choose(true, [0], R()).save)); static assert(!__traits(compiles, choose(true, R(), [0]).save)); } + //https://issues.dlang.org/show_bug.cgi?id=19738 @safe nothrow pure @nogc unittest { @@ -1761,7 +1769,8 @@ pure @safe unittest // issue 18657 } -@safe unittest // issue 20495 +// https://issues.dlang.org/show_bug.cgi?id=20495 +@safe unittest { static struct KillableRange { @@ -2278,7 +2287,8 @@ if (isInputRange!(Unqual!Range) && assert(!empty, "Attempting to assign to the front of an empty " ~ Take.stringof); - // This has to return auto instead of void because of Bug 4706. + // This has to return auto instead of void because of + // https://issues.dlang.org/show_bug.cgi?id=4706 source.front = v; } @@ -2363,7 +2373,8 @@ if (isInputRange!(Unqual!Range) && /// ditto @property void back(ElementType!R v) { - // This has to return auto instead of void because of Bug 4706. + // This has to return auto instead of void because of + // https://issues.dlang.org/show_bug.cgi?id=4706 assert(!empty, "Attempting to assign to the back of an empty " ~ Take.stringof); @@ -2528,7 +2539,8 @@ pure @safe nothrow @nogc unittest { // Check that one can declare variables of all Take types, // and that they match the return type of the corresponding - // take(). (See issue 4464.) + // take(). + // See https://issues.dlang.org/show_bug.cgi?id=4464 int[] r1; Take!(int[]) t1; t1 = take(r1, 1); @@ -2554,7 +2566,8 @@ pure @safe nothrow @nogc unittest static assert(isBidirectionalRange!TR2); } -pure @safe nothrow @nogc unittest //12731 +// https://issues.dlang.org/show_bug.cgi?id=12731 +pure @safe nothrow @nogc unittest { auto a = repeat(1); auto s = a[1 .. 5]; @@ -2564,7 +2577,8 @@ pure @safe nothrow @nogc unittest //12731 assert(s[1] == 1); } -pure @safe nothrow @nogc unittest //13151 +// https://issues.dlang.org/show_bug.cgi?id=13151 +pure @safe nothrow @nogc unittest { import std.algorithm.comparison : equal; @@ -2987,7 +3001,7 @@ pure @safe nothrow @nogc unittest assertThrown!AssertError(s.popBack); } -//guards against issue 16999 +// https://issues.dlang.org/show_bug.cgi?id=16999 pure @safe unittest { auto myIota = new class @@ -3046,7 +3060,7 @@ if (isInputRange!R) //member version if it's defined. static if (is(typeof(R.takeNone))) auto retval = range.takeNone(); - //@@@BUG@@@ 8339 + // https://issues.dlang.org/show_bug.cgi?id=8339 else static if (isDynamicArray!R)/+ || (is(R == struct) && __traits(compiles, {auto r = R.init;}) && R.init.empty))+/ { @@ -3058,7 +3072,8 @@ if (isInputRange!R) else auto retval = takeExactly(range, 0); - //@@@BUG@@@ 7892 prevents this from being done in an out block. + // https://issues.dlang.org/show_bug.cgi?id=7892 prevents this from being + // done in an out block. assert(retval.empty); return retval; } @@ -3159,8 +3174,8 @@ pure @safe nothrow unittest "hello world"w, "hello world"d, SliceStruct([1, 2, 3]), - //@@@BUG@@@ 8339 forces this to be takeExactly - //`InitStruct([1, 2, 3]), + // https://issues.dlang.org/show_bug.cgi?id=8339 + // forces this to be takeExactly `InitStruct([1, 2, 3]), TakeNoneStruct([1, 2, 3]))) { static assert(takeNone(range).empty, typeof(range).stringof); @@ -3191,7 +3206,8 @@ pure @safe nothrow unittest auto filtered = filter!"true"([1, 2, 3, 4, 5]); assert(takeNone(filtered).empty); - //@@@BUG@@@ 8339 and 5941 force this to be takeExactly + // https://issues.dlang.org/show_bug.cgi?id=8339 and + // https://issues.dlang.org/show_bug.cgi?id=5941 force this to be takeExactly //static assert(is(typeof(filtered) == typeof(takeNone(filtered))), typeof(filtered).stringof); } @@ -3271,7 +3287,7 @@ pure @safe nothrow unittest .assumeWontThrow); } -// @nogc prevented by @@@BUG@@@ 15408 +// @nogc prevented by https://issues.dlang.org/show_bug.cgi?id=15408 pure nothrow @safe /+@nogc+/ unittest { import std.algorithm.comparison : equal; @@ -3624,7 +3640,8 @@ pure @safe nothrow unittest assert(5.repeat(4).equal([5, 5, 5, 5])); } -pure @safe nothrow unittest //12007 +// https://issues.dlang.org/show_bug.cgi?id=12007 +pure @safe nothrow unittest { static class C{} Repeat!(immutable int) ri; @@ -4288,7 +4305,8 @@ if (isStaticArray!R) assert(cleS.front == 0); } -@system unittest //10845 +// https://issues.dlang.org/show_bug.cgi?id=10845 +@system unittest { import std.algorithm.comparison : equal; import std.algorithm.iteration : filter; @@ -4297,12 +4315,13 @@ if (isStaticArray!R) assert(equal(cycle(a).take(10), [0, 1, 2, 0, 1, 2, 0, 1, 2, 0])); } -@safe unittest // 12177 +// https://issues.dlang.org/show_bug.cgi?id=12177 +@safe unittest { static assert(__traits(compiles, recurrence!q{a[n - 1] ~ a[n - 2]}("1", "0"))); } -// Issue 13390 +// https://issues.dlang.org/show_bug.cgi?id=13390 @system unittest { import core.exception : AssertError; @@ -4310,7 +4329,8 @@ if (isStaticArray!R) assertThrown!AssertError(cycle([0, 1, 2][0 .. 0])); } -pure @safe unittest // issue 18657 +// https://issues.dlang.org/show_bug.cgi?id=18657 +pure @safe unittest { import std.algorithm.comparison : equal; string s = "foo"; @@ -5242,11 +5262,12 @@ pure @system unittest assert(zLongest.empty); } - // BUG 8900 + // https://issues.dlang.org/show_bug.cgi?id=8900 assert(zip([1, 2], repeat('a')).array == [tuple(1, 'a'), tuple(2, 'a')]); assert(zip(repeat('a'), [1, 2]).array == [tuple('a', 1), tuple('a', 2)]); - // Issue 18524 - moveBack instead performs moveFront + // https://issues.dlang.org/show_bug.cgi?id=18524 + // moveBack instead performs moveFront { auto r = zip([1,2,3]); assert(r.moveBack()[0] == 3); @@ -5320,7 +5341,7 @@ nothrow pure @safe unittest assert(equal(z2, [tuple(7, 0L)])); } -// Text for Issue 11196 +// Test for https://issues.dlang.org/show_bug.cgi?id=11196 @safe pure unittest { import std.exception : assertThrown; @@ -5331,7 +5352,8 @@ nothrow pure @safe unittest assertThrown(zip(StoppingPolicy.longest, cast(S[]) null, new int[1]).front); } -@nogc nothrow @safe pure unittest //12007 +// https://issues.dlang.org/show_bug.cgi?id=12007 +@nogc nothrow @safe pure unittest { static struct R { @@ -5643,7 +5665,8 @@ if (allSatisfy!(isInputRange, Ranges)) } } -@system unittest // Bugzilla 15860: foreach_reverse on lockstep +// https://issues.dlang.org/show_bug.cgi?id=15860: foreach_reverse on lockstep +@system unittest { auto arr1 = [0, 1, 2, 3]; auto arr2 = [4, 5, 6, 7]; @@ -5725,8 +5748,9 @@ if (allSatisfy!(isInputRange, Ranges)) assert(0); } catch (Exception) {} - // Just make sure 1-range case instantiates. This hangs the compiler - // when no explicit stopping policy is specified due to Bug 4652. + // Just make sure 1-range case instantiates. This hangs the compiler + // when no explicit stopping policy is specified due to + // https://issues.dlang.org/show_bug.cgi?id=4652 auto stuff = lockstep([1,2,3,4,5], StoppingPolicy.shortest); foreach (i, a; stuff) { @@ -6130,7 +6154,7 @@ pure @safe nothrow @nogc unittest assert(equal(odds.take(3), only(21, 23, 25))); } -// Issue 5036 +// https://issues.dlang.org/show_bug.cgi?id=5036 pure @safe nothrow unittest { auto s = sequence!((a, n) => new int)(0); @@ -6649,14 +6673,15 @@ pure @safe unittest assert(iota_of_longs_with_steps.length == 6); assert(equal(iota_of_longs_with_steps, [50L, 60L, 70L, 80L, 90L, 100L])); - // iota of unsigned zero length (issue 6222, actually trying to consume it - // is the only way to find something is wrong because the public - // properties are all correct) + // iota of unsigned zero length (https://issues.dlang.org/show_bug.cgi?id=6222) + // Actually trying to consume it is the only way to find something is wrong + // because the public properties are all correct. auto iota_zero_unsigned = iota(0, 0u, 3); assert(count(iota_zero_unsigned) == 0); - // unsigned reverse iota can be buggy if .length doesn't take them into - // account (issue 7982). + // https://issues.dlang.org/show_bug.cgi?id=7982 + // unsigned reverse iota can be buggy if `.length` doesn't + // take them into account assert(iota(10u, 0u, -1).length == 10); assert(iota(10u, 0u, -2).length == 5); assert(iota(uint.max, uint.max-10, -1).length == 10); @@ -6672,7 +6697,7 @@ pure @safe unittest assert(!(int.max in iota(20u, 10u, -1))); - // Issue 8920 + // https://issues.dlang.org/show_bug.cgi?id=8920 static foreach (Type; AliasSeq!(byte, ubyte, short, ushort, int, uint, long, ulong)) {{ @@ -7175,7 +7200,7 @@ pure @safe nothrow unittest } } -// Issue 16363 +// https://issues.dlang.org/show_bug.cgi?id=16363 pure @safe nothrow unittest { import std.algorithm.comparison : equal; @@ -7187,7 +7212,7 @@ pure @safe nothrow unittest static assert(isRandomAccessRange!(typeof(ft))); } -// Bugzilla 16442 +// https://issues.dlang.org/show_bug.cgi?id=16442 pure @safe nothrow unittest { int[][] arr = [[], []]; @@ -7601,7 +7626,7 @@ private: assert(transposed(ror).empty); } -// Issue 9507 +// https://issues.dlang.org/show_bug.cgi?id=9507 @safe unittest { import std.algorithm.comparison : equal; @@ -7613,7 +7638,7 @@ private: ])); } -// Issue 17742 +// https://issues.dlang.org/show_bug.cgi?id=17742 @safe unittest { import std.algorithm.iteration : map; @@ -7706,7 +7731,7 @@ if (isForwardRange!RangeOfRanges && } } -// Issue 8764 +// https://issues.dlang.org/show_bug.cgi?id=8764 @safe unittest { import std.algorithm.comparison : equal; @@ -9800,7 +9825,7 @@ private struct OnlyResult(T, size_t arity) private size_t frontIndex = 0; private size_t backIndex = 0; - // @@@BUG@@@ 10643 + // https://issues.dlang.org/show_bug.cgi?id=10643 version (none) { import std.traits : hasElaborateAssign; @@ -10035,7 +10060,7 @@ if (!is(CommonType!Values == void) || Values.length == 0) assert(imm.front == 1); assert(imm.back == 1); assert(!imm.empty); - assert(imm.init.empty); // Issue 13441 + assert(imm.init.empty); // https://issues.dlang.org/show_bug.cgi?id=13441 assert(imm.length == 1); assert(equal(imm, imm[])); assert(equal(imm, imm[0 .. 1])); @@ -10124,7 +10149,7 @@ if (!is(CommonType!Values == void) || Values.length == 0) alias Imm = typeof(imm); static assert(is(ElementType!Imm == immutable(int))); assert(!imm.empty); - assert(imm.init.empty); // Issue 13441 + assert(imm.init.empty); // https://issues.dlang.org/show_bug.cgi?id=13441 assert(imm.front == 42); imm.popFront(); assert(imm.front == 24); @@ -10464,7 +10489,8 @@ pure @safe unittest }} } -version (none) // @@@BUG@@@ 10939 +// https://issues.dlang.org/show_bug.cgi?id=10939 +version (none) { // Re-enable (or remove) if 10939 is resolved. /+pure+/ @safe unittest // Impure because of std.conv.to @@ -11144,7 +11170,7 @@ template SortedRange(Range, alias pred = "a < b", SortedRangeOptions opt = SortedRangeOptions.assumeSorted) if (isInstanceOf!(SortedRange, Range)) { - // Avoid nesting SortedRange types (see Issue 18933); + // Avoid nesting SortedRange types (see https://issues.dlang.org/show_bug.cgi?id=18933); alias SortedRange = SortedRange!(Unqual!(typeof(Range._input)), pred, opt); } @@ -11374,7 +11400,8 @@ if (isInputRange!(Unqual!R)) p = assumeSorted(a).upperBound(4.2); assert(equal(p, [ 5, 6 ])); - // Issue 18933 - don't create senselessly nested SortedRange types. + // https://issues.dlang.org/show_bug.cgi?id=18933 + // don't create senselessly nested SortedRange types. assert(is(typeof(assumeSorted(a)) == typeof(assumeSorted(assumeSorted(a))))); assert(is(typeof(assumeSorted(a)) == typeof(assumeSorted(assumeSorted!"a > b"(a))))); } @@ -11420,7 +11447,7 @@ if (isInputRange!(Unqual!R)) r = assumeSorted(a); } -// issue 15003 +// https://issues.dlang.org/show_bug.cgi?id=15003 @nogc @safe unittest { static immutable a = [1, 2, 3, 4]; @@ -11944,8 +11971,8 @@ private: } { - // Issue 16534 - opDollar should be defined if the - // wrapped range defines length. + // https://issues.dlang.org/show_bug.cgi?id=16534 + // opDollar should be defined if the wrapped range defines length. auto range = 10.iota.takeExactly(5); auto wrapper = refRange(&range); assert(wrapper.length == 5); @@ -12133,7 +12160,8 @@ private: assert(cWrapper is c); } -@system unittest // issue 14373 +// https://issues.dlang.org/show_bug.cgi?id=14373 +@system unittest { static struct R { @@ -12146,7 +12174,8 @@ private: assert(r.empty); } -@system unittest // issue 14575 +// https://issues.dlang.org/show_bug.cgi?id=14575 +@system unittest { struct R { @@ -12186,9 +12215,8 @@ if (isInputRange!R) return *range; } -/*****************************************************************************/ - -@safe unittest // bug 9060 +// https://issues.dlang.org/show_bug.cgi?id=9060 +@safe unittest { import std.algorithm.iteration : map, joiner, group; import std.algorithm.searching : until; @@ -13032,9 +13060,9 @@ if (is(typeof(fun) == void) || isSomeFunction!fun) }} } +// https://issues.dlang.org/show_bug.cgi?id=13483 @safe unittest { - // Issue 13483 static void func1(T)(T x) {} void func2(int x) {} @@ -13428,7 +13456,7 @@ pure @safe unittest assert(len == 6); } -// Issue 19042 +// https://issues.dlang.org/show_bug.cgi?id=19042 @safe pure unittest { import std.algorithm.comparison : equal; diff --git a/std/range/primitives.d b/std/range/primitives.d index 6179858c7ad..6006c1ee896 100644 --- a/std/range/primitives.d +++ b/std/range/primitives.d @@ -512,7 +512,7 @@ void put(R, E)(ref R r, E e) private void putChar(R, E)(ref R r, E e) if (isSomeChar!E) { - ////@@@9186@@@: Can't use (E[]).init + // https://issues.dlang.org/show_bug.cgi?id=9186: Can't use (E[]).init ref const( char)[] cstringInit(); ref const(wchar)[] wstringInit(); ref const(dchar)[] dstringInit(); @@ -802,18 +802,18 @@ pure @safe unittest put(c, "hello"d); } +// https://issues.dlang.org/show_bug.cgi?id=9823 @system unittest { - // issue 9823 const(char)[] r; void delegate(const(char)[]) dg = (s) { r = s; }; put(dg, ["ABC"]); assert(r == "ABC"); } +// https://issues.dlang.org/show_bug.cgi?id=10571 @safe unittest { - // issue 10571 import std.format; string buf; formattedWrite((scope const(char)[] s) { buf ~= s; }, "%s", "hello"); @@ -1319,7 +1319,8 @@ template ElementType(R) static assert(is(ElementType!(char[0]) == dchar)); } -@safe unittest //11336 +// https://issues.dlang.org/show_bug.cgi?id=11336 +@safe unittest { static struct S { @@ -1328,7 +1329,8 @@ template ElementType(R) static assert(is(ElementType!(S[]) == S)); } -@safe unittest // 11401 +// https://issues.dlang.org/show_bug.cgi?id=11401 +@safe unittest { // ElementType should also work for non-@propety 'front' struct E { ushort id; } @@ -2323,7 +2325,8 @@ if (isAutodecodableString!(C[]) && !isAggregateType!(C[])) static assert(checkCTFEW.empty); } -@safe unittest // issue 16090 +// https://issues.dlang.org/show_bug.cgi?id=16090 +@safe unittest { string s = "\u00E4"; assert(s.length == 2); diff --git a/std/regex/internal/ir.d b/std/regex/internal/ir.d index 4a5b790d0a5..856a268c663 100644 --- a/std/regex/internal/ir.d +++ b/std/regex/internal/ir.d @@ -30,7 +30,9 @@ CharMatcher[CodepointSet] matcherCache; //accessor with caching @trusted CharMatcher getMatcher(CodepointSet set) -{// @@@BUG@@@ 6357 almost all properties of AA are not @safe +{ + // almost all properties of AA are not @safe + // https://issues.dlang.org/show_bug.cgi?id=6357 if (__ctfe || maxCachedMatchers == 0) return CharMatcher(set); else @@ -251,8 +253,8 @@ struct Bytecode return t; } - //bit twiddling helpers - //0-arg template due to @@@BUG@@@ 10985 + // bit twiddling helpers + // 0-arg template due to https://issues.dlang.org/show_bug.cgi?id=10985 @property uint data()() const { return raw & 0x003f_ffff; } @property void data()(uint val) @@ -260,12 +262,12 @@ struct Bytecode raw = (raw & ~0x003f_ffff) | (val & 0x003f_ffff); } - //ditto - //0-arg template due to @@@BUG@@@ 10985 + // ditto + // 0-arg template due to https://issues.dlang.org/show_bug.cgi?id=10985 @property uint sequence()() const { return 2 + (raw >> 22 & 0x3); } - //ditto - //0-arg template due to @@@BUG@@@ 10985 + // ditto + // 0-arg template due to https://issues.dlang.org/show_bug.cgi?id=10985 @property IR code()() const { return cast(IR)(raw >> 24); } //ditto @@ -876,16 +878,15 @@ template BackLooper(E) return dict[fnd].group; } -//whether ch is one of unicode newline sequences -//0-arg template due to @@@BUG@@@ 10985 +// whether ch is one of unicode newline sequences +// 0-arg template due to https://issues.dlang.org/show_bug.cgi?id=10985 bool endOfLine()(dchar front, bool seenCr) { return ((front == '\n') ^ seenCr) || front == '\r' || front == NEL || front == LS || front == PS; } -// -//0-arg template due to @@@BUG@@@ 10985 +// 0-arg template due to https://issues.dlang.org/show_bug.cgi?id=10985 bool startOfLine()(dchar back, bool seenNl) { return ((back == '\r') ^ seenNl) || back == '\n' @@ -1154,4 +1155,4 @@ if (!hasElaborateDestructor!T) a = a; assert(a.big.refcount == 2); // a & c } -} \ No newline at end of file +} diff --git a/std/regex/internal/tests2.d b/std/regex/internal/tests2.d index 1bba66e90b3..01f8b0a255a 100644 --- a/std/regex/internal/tests2.d +++ b/std/regex/internal/tests2.d @@ -149,7 +149,7 @@ import std.uni : Escapables; // characters that need escaping import std.algorithm.iteration : map; void test_body(alias matchFn)() { - //issue 5857 + // https://issues.dlang.org/show_bug.cgi?id=5857 //matching goes out of control if ... in (...){x} has .*/.+ auto c = matchFn("axxxzayyyyyzd",regex("(a.*z){2}d")).captures; assert(c[0] == "axxxzayyyyyzd"); @@ -157,7 +157,7 @@ import std.uni : Escapables; // characters that need escaping auto c2 = matchFn("axxxayyyyyd",regex("(a.*){2}d")).captures; assert(c2[0] == "axxxayyyyyd"); assert(c2[1] == "ayyyyy"); - //issue 2108 + // https://issues.dlang.org/show_bug.cgi?id=2108 //greedy vs non-greedy auto nogreed = regex(""); assert(matchFn("texttext", nogreed).hit @@ -165,7 +165,7 @@ import std.uni : Escapables; // characters that need escaping auto greed = regex(""); assert(matchFn("texttext", greed).hit == "texttext"); - //issue 4574 + // https://issues.dlang.org/show_bug.cgi?id=4574 //empty successful match still advances the input string[] pres, posts, hits; foreach (m; matchFn("abcabc", regex("","g"))) @@ -195,7 +195,7 @@ import std.uni : Escapables; // characters that need escaping ]; assert(pres == array(retro(heads))); assert(posts == tails); - //issue 6076 + // https://issues.dlang.org/show_bug.cgi?id=6076 //regression on .* auto re = regex("c.*|d"); auto m = matchFn("mm", re); @@ -214,7 +214,7 @@ import std.uni : Escapables; // characters that need escaping assert(!match(to!string(ch),regex(`[^\`~ch~`]`))); assert(match(to!string(ch),regex(`[\`~ch~`-\`~ch~`]`))); } - //bugzilla 7718 + // https://issues.dlang.org/show_bug.cgi?id=7718 string strcmd = "./myApp.rb -os OSX -path \"/GIT/Ruby Apps/sec\" -conf 'notimer'"; auto reStrCmd = regex (`(".*")|('.*')`, "g"); assert(equal(map!"a[0]"(matchFn(strcmd, reStrCmd)), @@ -293,24 +293,29 @@ import std.uni : Escapables; // characters that need escaping assert(equal(split(s1, regex(", *")), w1[])); } +// https://issues.dlang.org/show_bug.cgi?id=7141 @safe unittest -{ // bugzilla 7141 +{ string pattern = `[a\--b]`; assert(match("-", pattern)); assert(match("b", pattern)); string pattern2 = `[&-z]`; assert(match("b", pattern2)); } + +// https://issues.dlang.org/show_bug.cgi?id=7111 @safe unittest -{//bugzilla 7111 +{ assert(match("", regex("^"))); } + +// https://issues.dlang.org/show_bug.cgi?id=7300 @safe unittest -{//bugzilla 7300 +{ assert(!match("a"d, "aa"d)); } -// bugzilla 7551 +// https://issues.dlang.org/show_bug.cgi?id=7551 @safe unittest { auto r = regex("[]abc]*"); @@ -320,14 +325,17 @@ import std.uni : Escapables; // characters that need escaping assert("]ac".matchFirst(r2).hit == "]"); } +// https://issues.dlang.org/show_bug.cgi?id=7674 @safe unittest -{//bugzilla 7674 +{ assert("1234".replace(regex("^"), "$$") == "$1234"); assert("hello?".replace(regex(r"\?", "g"), r"\?") == r"hello\?"); assert("hello?".replace(regex(r"\?", "g"), r"\\?") != r"hello\?"); } + +// https://issues.dlang.org/show_bug.cgi?id=7679 @safe unittest -{// bugzilla 7679 +{ import std.algorithm.comparison : equal; static foreach (S; AliasSeq!(string, wstring, dstring)) {{ @@ -337,8 +345,10 @@ import std.uni : Escapables; // characters that need escaping assert(split(str, re) == [to!S("a"), to!S("b")]); }} } + +// https://issues.dlang.org/show_bug.cgi?id=8203 @safe unittest -{//bugzilla 8203 +{ string data = " NAME = XPAW01_STA:STATION NAME = XPAW01_STA @@ -353,13 +363,15 @@ import std.uni : Escapables; // characters that need escaping auto r2 = regex(`([а-яА-Я\-_]+\s*)+(?<=[\s\.,\^])`); match("аллея Театральная", r2); } + +// https://issues.dlang.org/show_bug.cgi?id=8637 purity of enforce @safe unittest -{// bugzilla 8637 purity of enforce +{ auto m = match("hello world", regex("world")); enforce(m); } -// bugzilla 8725 +// https://issues.dlang.org/show_bug.cgi?id=8725 @safe unittest { static italic = regex( r"\* @@ -372,7 +384,7 @@ import std.uni : Escapables; // characters that need escaping "this * is* interesting, very interesting"); } -// bugzilla 8349 +// https://issues.dlang.org/show_bug.cgi?id=8349 @safe unittest { enum peakRegexStr = r"\>(wgEncode.*Tfbs.*\.(?:narrow)|(?:broad)Peak.gz)"; @@ -381,7 +393,7 @@ import std.uni : Escapables; // characters that need escaping assert(match(r"\>wgEncode-blah-Tfbs.narrow", peakRegex)); } -// bugzilla 9211 +// https://issues.dlang.org/show_bug.cgi?id=9211 @safe unittest { import std.algorithm.comparison : equal; @@ -393,7 +405,7 @@ import std.uni : Escapables; // characters that need escaping assert(equal(m2.front, ["1234", "3", "4"])); } -// bugzilla 9280 +// https://issues.dlang.org/show_bug.cgi?id=9280 @safe unittest { string tomatch = "a!b@c"; @@ -406,7 +418,7 @@ import std.uni : Escapables; // characters that need escaping } -// bugzilla 9579 +// https://issues.dlang.org/show_bug.cgi?id=9579 @safe unittest { char[] input = ['a', 'b', 'c']; @@ -417,14 +429,14 @@ import std.uni : Escapables; // characters that need escaping assert(r == "(a)bc"); } -// bugzilla 9634 +// https://issues.dlang.org/show_bug.cgi?id=9634 @safe unittest { auto re = ctRegex!"(?:a+)"; assert(match("aaaa", re).hit == "aaaa"); } -//bugzilla 10798 +// https://issues.dlang.org/show_bug.cgi?id=10798 @safe unittest { auto cr = ctRegex!("[abcd--c]*"); @@ -433,7 +445,7 @@ import std.uni : Escapables; // characters that need escaping assert(m.hit == "ab"); } -// bugzilla 10913 +// https://issues.dlang.org/show_bug.cgi?id=10913 @system unittest { @system static string foo(const(char)[] s) @@ -452,7 +464,7 @@ import std.uni : Escapables; // characters that need escaping }(); } -// bugzilla 11262 +// https://issues.dlang.org/show_bug.cgi?id=11262 @safe unittest { enum reg = ctRegex!(r",", "g"); @@ -461,13 +473,13 @@ import std.uni : Escapables; // characters that need escaping assert(str == "This-List"); } -// bugzilla 11775 +// https://issues.dlang.org/show_bug.cgi?id=11775 @safe unittest { assert(collectException(regex("a{1,0}"))); } -// bugzilla 11839 +// https://issues.dlang.org/show_bug.cgi?id=11839 @safe unittest { import std.algorithm.comparison : equal; @@ -478,7 +490,7 @@ import std.uni : Escapables; // characters that need escaping assert(regex(`(?P<я>\w+)`).namedCaptures.equal(["я"])); } -// bugzilla 12076 +// https://issues.dlang.org/show_bug.cgi?id=12076 @safe unittest { auto RE = ctRegex!(r"(?abc)`); assert(collectException("abc".matchFirst(r)["b"])); } -// bugzilla 12691 +// https://issues.dlang.org/show_bug.cgi?id=12691 @safe unittest { assert(bmatch("e@", "^([a-z]|)*$").empty); assert(bmatch("e@", ctRegex!`^([a-z]|)*$`).empty); } -//bugzilla 12713 +// https://issues.dlang.org/show_bug.cgi?id=12713 @safe unittest { assertThrown(regex("[[a-z]([a-z]|(([[a-z])))")); } -//bugzilla 12747 +// https://issues.dlang.org/show_bug.cgi?id=12747 @safe unittest { assertThrown(regex(`^x(\1)`)); @@ -538,7 +550,7 @@ import std.uni : Escapables; // characters that need escaping assertThrown(regex(`^((x)(?=\1))`)); } -// bugzilla 13532 +// https://issues.dlang.org/show_bug.cgi?id=13532 version (none) // TODO: revist once we have proper benchmark framework @safe unittest { @@ -568,14 +580,14 @@ version (none) // TODO: revist once we have proper benchmark framework "enum regex to static regex ratio "~to!string(ratio)); } -// bugzilla 14504 +// https://issues.dlang.org/show_bug.cgi?id=14504 @safe unittest { auto p = ctRegex!("a?a?a?a?a?a?a?a?a?a?a?a?a?a?a?a?a?a?a?a?a?a?a?a?a?a?a?a?a?a?" ~ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"); } -// bugzilla 14529 +// https://issues.dlang.org/show_bug.cgi?id=14529 @safe unittest { auto ctPat2 = regex(r"^[CDF]$", "i"); @@ -583,7 +595,7 @@ version (none) // TODO: revist once we have proper benchmark framework assert(matchAll(v, ctPat2).front.hit == v); } -// bugzilla 14615 +// https://issues.dlang.org/show_bug.cgi?id=14615 @safe unittest { import std.array : appender; @@ -602,14 +614,14 @@ version (none) // TODO: revist once we have proper benchmark framework assert(sink.data == "Hello, world!Hello, world!"); } -// bugzilla 15573 +// https://issues.dlang.org/show_bug.cgi?id=15573 @safe unittest { auto rx = regex("[c d]", "x"); assert("a b".matchFirst(rx)); } -// bugzilla 15864 +// https://issues.dlang.org/show_bug.cgi?id=15864 @safe unittest { regex(`((.+)`; @@ -631,14 +643,14 @@ version (none) // TODO: revist once we have proper benchmark framework assert(input.matchFirst(titleRegex).empty); } -// bugzilla 17212 +// https://issues.dlang.org/show_bug.cgi?id=17212 @safe unittest { auto r = regex(" [a] ", "x"); assert("a".matchFirst(r)); } -// bugzilla 17157 +// https://issues.dlang.org/show_bug.cgi?id=17157 @safe unittest { import std.algorithm.comparison : equal; @@ -655,7 +667,7 @@ version (none) // TODO: revist once we have proper benchmark framework assert(equal!equal(s.bmatch(r), outcomes)); } -// bugzilla 17667 +// https://issues.dlang.org/show_bug.cgi?id=17667 @safe unittest { import std.algorithm.searching : canFind; @@ -671,7 +683,7 @@ version (none) // TODO: revist once we have proper benchmark framework willThrow([r"\", r"123"], "invalid escape sequence"); } -// bugzilla 17668 +// https://issues.dlang.org/show_bug.cgi?id=17668 @safe unittest { import std.algorithm.searching; @@ -679,7 +691,7 @@ version (none) // TODO: revist once we have proper benchmark framework assert(e.msg.canFind("no operand for '^'"), e.msg); } -// bugzilla 17673 +// https://issues.dlang.org/show_bug.cgi?id=17673 @safe unittest { string str = `<">`; @@ -690,7 +702,7 @@ version (none) // TODO: revist once we have proper benchmark framework assert(c.whichPattern == 2); } -// bugzilla 18692 +// https://issues.dlang.org/show_bug.cgi?id=18692 @safe unittest { auto rx = regex("()()()"); @@ -698,4 +710,4 @@ version (none) // TODO: revist once we have proper benchmark framework auto ma2 = ma; ma = ma2; assert(ma[1] == ""); -} \ No newline at end of file +} diff --git a/std/regex/package.d b/std/regex/package.d index 500e61ac8eb..0b99df72001 100644 --- a/std/regex/package.d +++ b/std/regex/package.d @@ -706,7 +706,8 @@ public: || cast(bool)(c = matchFirst(s, regex("a")))); } -@system unittest // Issue 19979 +// https://issues.dlang.org/show_bug.cgi?id=19979 +@system unittest { auto c = matchFirst("bad", regex(`(^)(not )?bad($)`)); assert(c[0] && c[0].length == "bad".length); diff --git a/std/signals.d b/std/signals.d index e26a8534444..23639eb7692 100644 --- a/std/signals.d +++ b/std/signals.d @@ -651,7 +651,7 @@ void linkin() { } a.emit(); // should not raise segfault since &o.watch2 is no longer connected } -version (none) // Disabled because of dmd @@@BUG5028@@@ +version (none) // Disabled because of https://issues.dlang.org/show_bug.cgi?id=5028 @system unittest { class A diff --git a/std/socket.d b/std/socket.d index 78732710342..49e40873794 100644 --- a/std/socket.d +++ b/std/socket.d @@ -2551,7 +2551,9 @@ public: }); } -@safe unittest // Issue 14012, 14013 +// https://issues.dlang.org/show_bug.cgi?id=14012 +// https://issues.dlang.org/show_bug.cgi?id=14013 +@safe unittest { auto set = new SocketSet(1); assert(set.max >= 0); @@ -3592,7 +3594,7 @@ class UdpSocket: Socket } } -// Issue 16514 +// https://issues.dlang.org/show_bug.cgi?id=16514 @safe unittest { class TestSocket : Socket diff --git a/std/stdio.d b/std/stdio.d index a7cba90a90b..8af233ef493 100644 --- a/std/stdio.d +++ b/std/stdio.d @@ -489,7 +489,8 @@ file. return this; } - @safe unittest // bugzilla 20129 + // https://issues.dlang.org/show_bug.cgi?id=20129 + @safe unittest { File[int] aa; aa.require(0, File.init); @@ -508,7 +509,8 @@ Throws: `ErrnoException` in case of error. resetFile(name, stdioOpenmode, false); } - @system unittest // bugzilla 20585 + // https://issues.dlang.org/show_bug.cgi?id=20585 + @system unittest { File f; try @@ -850,7 +852,7 @@ the file handle. @safe unittest { - // Issue 12349 + // https://issues.dlang.org/show_bug.cgi?id=12349 static import std.file; auto deleteme = testFilename(); auto f = File(deleteme, "w"); @@ -952,7 +954,7 @@ Throws: `Exception` if the file is not opened or if the call to `fflush` fails. @safe unittest { - // Issue 12349 + // https://issues.dlang.org/show_bug.cgi?id=12349 import std.exception : assertThrown; static import std.file; @@ -1024,7 +1026,7 @@ Throws: `Exception` if `buffer` is empty. { import core.atomic : atomicOp; - // @@@BUG@@@ 4243 + // https://issues.dlang.org/show_bug.cgi?id=4243 immutable info = __fhnd_info[fd]; atomicOp!"&="(__fhnd_info[fd], ~FHND_TEXT); scope(exit) __fhnd_info[fd] = info; @@ -1080,7 +1082,7 @@ Throws: `ErrnoException` if the file is not opened or if the call to `fwrite` fa { import core.atomic : atomicOp; - // @@@BUG@@@ 4243 + // https://issues.dlang.org/show_bug.cgi?id=4243 immutable info = __fhnd_info[fd]; atomicOp!"&="(__fhnd_info[fd], ~FHND_TEXT); scope(exit) __fhnd_info[fd] = info; @@ -1847,7 +1849,8 @@ is recommended if you want to process a complete file. assert(buffer[beyond] == 'a'); } - @system unittest // bugzilla 15293 + // https://issues.dlang.org/show_bug.cgi?id=15293 + @system unittest { // @system due to readln static import std.file; @@ -2010,7 +2013,7 @@ $(CONSOLE f.readf("%s\n", &s); assert(s == "world", "["~s~"]"); - // Issue 11698 + // https://issues.dlang.org/show_bug.cgi?id=11698 bool b1, b2; f.readf("%s\n%s\n", &b1, &b2); assert(b1 == true && b2 == false); @@ -2031,13 +2034,14 @@ $(CONSOLE assert(s1 == "hello"); assert(s2 == "world"); - // Issue 11698 + // https://issues.dlang.org/show_bug.cgi?id=11698 bool b1, b2; f.readf("%s\n%s\n", &b1, b2); assert(b1 == true && b2 == false); } - // Issue 12260 - Nice error of std.stdio.readf with newlines + // Nice error of std.stdio.readf with newlines + // https://issues.dlang.org/show_bug.cgi?id=12260 @system unittest { static import std.file; @@ -2339,7 +2343,8 @@ the contents may well have changed). }} } - @system unittest // Issue 19980 + // https://issues.dlang.org/show_bug.cgi?id=19980 + @system unittest { static import std.file; auto deleteme = testFilename(); @@ -2530,7 +2535,7 @@ $(REF readText, std,file) } assert(i == witness.length, text(i, " != ", witness.length)); - // Issue 11830 + // https://issues.dlang.org/show_bug.cgi?id=11830 auto walkedLength = File(deleteme).byLine(kt, term).walkLength; assert(walkedLength == witness.length, text(walkedLength, " != ", witness.length)); @@ -2590,7 +2595,7 @@ $(REF readText, std,file) auto file = File.tmpfile(); file.write("1\n2\n3\n"); - // bug 9599 + // https://issues.dlang.org/show_bug.cgi?id=9599 file.rewind(); File.ByLineImpl!(char, char) fbl = file.byLine(); auto fbl2 = fbl; @@ -3137,7 +3142,7 @@ is empty, throws an `Exception`. In case of an I/O error throws { import core.atomic : atomicOp; - // @@@BUG@@@ 4243 + // https://issues.dlang.org/show_bug.cgi?id=4243 oldInfo = __fhnd_info[fd]; atomicOp!"&="(__fhnd_info[fd], ~FHND_TEXT); } @@ -3157,7 +3162,7 @@ is empty, throws an `Exception`. In case of an I/O error throws .fflush(fps); // before restoring translation mode version (DIGITAL_MARS_STDIO) { - // @@@BUG@@@ 4243 + // https://issues.dlang.org/show_bug.cgi?id=4243 __fhnd_info[fd] = oldInfo; } ._setmode(fd, oldMode); @@ -3503,8 +3508,10 @@ void main() writer.put("日本語"d); writer.put('日'); writer.put(chain(only('本'), only('語'))); - writer.put(repeat('#', 12)); // BUG 11945 - writer.put(cast(immutable(ubyte)[])"日本語"); // Bug 17229 + // https://issues.dlang.org/show_bug.cgi?id=11945 + writer.put(repeat('#', 12)); + // https://issues.dlang.org/show_bug.cgi?id=17229 + writer.put(cast(immutable(ubyte)[])"日本語"); } assert(File(deleteme).readln() == "日本語日本語日本語日本語############日本語"); } @@ -3563,7 +3570,7 @@ void main() version (StdStressTest) { - // issue 15768 + // https://issues.dlang.org/show_bug.cgi?id=15768 @system unittest { import std.parallelism : parallel; @@ -3698,7 +3705,8 @@ struct LockingTextReader assert(x == 3); } -@system unittest // bugzilla 13686 +// https://issues.dlang.org/show_bug.cgi?id=13686 +@system unittest { import std.algorithm.comparison : equal; static import std.file; @@ -3716,7 +3724,8 @@ struct LockingTextReader assert(equal(ltr, "Тест".byDchar)); } -@system unittest // bugzilla 12320 +// https://issues.dlang.org/show_bug.cgi?id=12320 +@system unittest { static import std.file; auto deleteme = testFilename(); @@ -3730,7 +3739,8 @@ struct LockingTextReader assert(ltr.empty); } -@system unittest // bugzilla 14861 +// https://issues.dlang.org/show_bug.cgi?id=14861 +@system unittest { // @system due to readf static import std.file; @@ -3896,11 +3906,11 @@ void writeln(T...)(T args) if (false) writeln("wyda"); - // bug 8040 + // https://issues.dlang.org/show_bug.cgi?id=8040 if (false) writeln(null); if (false) writeln(">", null, "<"); - // Bugzilla 14041 + // https://issues.dlang.org/show_bug.cgi?id=14041 if (false) { char[8] a; @@ -3942,9 +3952,9 @@ void writeln(T...)(T args) stdout.open(deleteme, "w"); writeln("Hello!"c); - writeln("Hello!"w); // bug 8386 - writeln("Hello!"d); // bug 8386 - writeln("embedded\0null"c); // bug 8730 + writeln("Hello!"w); // https://issues.dlang.org/show_bug.cgi?id=8386 + writeln("Hello!"d); // https://issues.dlang.org/show_bug.cgi?id=8386 + writeln("embedded\0null"c); // https://issues.dlang.org/show_bug.cgi?id=8730 stdout.close(); version (Windows) assert(cast(char[]) std.file.read(deleteme) == @@ -5450,7 +5460,8 @@ private size_t readlnImpl(FILE* fps, ref char[] buf, dchar terminator, File.Orie char[] t = ln[0 .. 2]; t ~= 't'; assert(t == "abt"); - assert(ln == "abcd\n"); // bug 13856: ln stomped to "abtd" + // https://issues.dlang.org/show_bug.cgi?id=13856: ln stomped to "abtd" + assert(ln == "abcd\n"); // it can also stomp the array length ln = new char[4]; @@ -5525,6 +5536,7 @@ version (StdUnittest) private string testFilename(string file = __FILE__, size_t import std.file : deleteme; import std.path : baseName; - // filename intentionally contains non-ASCII (Russian) characters for test Issue 7648 + // filename intentionally contains non-ASCII (Russian) characters for + // https://issues.dlang.org/show_bug.cgi?id=7648 return text(deleteme, "-детка.", baseName(file), ".", line); } diff --git a/std/string.d b/std/string.d index f341146cc3d..daacf4e6fd4 100644 --- a/std/string.d +++ b/std/string.d @@ -1501,7 +1501,8 @@ if (isSomeChar!Char1 && isSomeChar!Char2) }); } -@safe pure unittest // issue13529 +// https://issues.dlang.org/show_bug.cgi?id=13529 +@safe pure unittest { import std.conv : to; static foreach (S; AliasSeq!(string, wstring, dstring)) @@ -5234,7 +5235,8 @@ if (isSomeChar!C1 && isSomeChar!C2) assert(translate("hello world", transTable2) == "h5llorange worangerld"); } -@safe pure unittest // issue 13018 +// https://issues.dlang.org/show_bug.cgi?id=13018 +@safe pure unittest { immutable dchar[dchar] transTable1 = ['e' : '5', 'o' : '7', '5': 'q']; assert(translate("hello world", transTable1) == "h5ll7 w7rld"); @@ -5255,7 +5257,8 @@ if (isSomeChar!C1 && isSomeChar!C2) static foreach (S; AliasSeq!( char[], const( char)[], immutable( char)[], wchar[], const(wchar)[], immutable(wchar)[], dchar[], const(dchar)[], immutable(dchar)[])) - {(){ // workaround slow optimizations for large functions @@@BUG@@@ 2396 + {(){ // workaround slow optimizations for large functions + // https://issues.dlang.org/show_bug.cgi?id=2396 assert(translate(to!S("hello world"), cast(dchar[dchar])['h' : 'q', 'l' : '5']) == to!S("qe55o wor5d")); assert(translate(to!S("hello world"), cast(dchar[dchar])['o' : 'l', 'l' : '\U00010143']) == @@ -5269,7 +5272,8 @@ if (isSomeChar!C1 && isSomeChar!C2) static foreach (T; AliasSeq!( char[], const( char)[], immutable( char)[], wchar[], const(wchar)[], immutable(wchar)[], dchar[], const(dchar)[], immutable(dchar)[])) - (){ // workaround slow optimizations for large functions @@@BUG@@@ 2396 + (){ // workaround slow optimizations for large functions + // https://issues.dlang.org/show_bug.cgi?id=2396 static foreach (R; AliasSeq!(dchar[dchar], const dchar[dchar], immutable dchar[dchar])) {{ @@ -5313,7 +5317,8 @@ if (isSomeChar!C1 && isSomeString!S && isSomeChar!C2) static foreach (S; AliasSeq!( char[], const( char)[], immutable( char)[], wchar[], const(wchar)[], immutable(wchar)[], dchar[], const(dchar)[], immutable(dchar)[])) - {(){ // workaround slow optimizations for large functions @@@BUG@@@ 2396 + {(){ // workaround slow optimizations for large functions + // https://issues.dlang.org/show_bug.cgi?id=2396 assert(translate(to!S("hello world"), ['h' : "yellow", 'l' : "42"]) == to!S("yellowe4242o wor42d")); assert(translate(to!S("hello world"), ['o' : "owl", 'l' : "\U00010143\U00010143"]) == @@ -5331,8 +5336,8 @@ if (isSomeChar!C1 && isSomeString!S && isSomeChar!C2) static foreach (T; AliasSeq!( char[], const( char)[], immutable( char)[], wchar[], const(wchar)[], immutable(wchar)[], dchar[], const(dchar)[], immutable(dchar)[])) - (){ // workaround slow optimizations for large functions @@@BUG@@@ 2396 - + (){ // workaround slow optimizations for large functions + // https://issues.dlang.org/show_bug.cgi?id=2396 static foreach (R; AliasSeq!(string[dchar], const string[dchar], immutable string[dchar])) {{ @@ -5396,7 +5401,8 @@ if (isSomeChar!C1 && isSomeChar!C2 && isOutputRange!(Buffer, C1)) assert(buffer.data == "h5llorange worangerld"); } -@safe pure unittest // issue 13018 +// https://issues.dlang.org/show_bug.cgi?id=13018 +@safe pure unittest { import std.array : appender; immutable dchar[dchar] transTable1 = ['e' : '5', 'o' : '7', '5': 'q']; diff --git a/std/traits.d b/std/traits.d index 2f2656f6486..0de24ebf740 100644 --- a/std/traits.d +++ b/std/traits.d @@ -544,7 +544,8 @@ version (none) @safe unittest //Please uncomment me when changing packageName to static assert(packageName!moduleName == "std"); } -@safe unittest // issue 13741 +// https://issues.dlang.org/show_bug.cgi?id=13741 +@safe unittest { import std.ascii : isWhite; static assert(packageName!(isWhite) == "std"); @@ -607,7 +608,8 @@ template moduleName(alias T) static assert(moduleName!(X12287!int.i) == "std.traits"); } -@safe unittest // issue 13741 +// https://issues.dlang.org/show_bug.cgi?id=13741 +@safe unittest { import std.ascii : isWhite; static assert(moduleName!(isWhite) == "std.ascii"); @@ -1190,7 +1192,8 @@ if (func.length == 1 && isCallable!func && static assert(!__traits(compiles, arity!variadicFoo)); } -@safe unittest // issue 11389 +// https://issues.dlang.org/show_bug.cgi?id=11389 +@safe unittest { alias TheType = size_t function( string[] ); static assert(arity!TheType == 1); @@ -1355,14 +1358,14 @@ template extractParameterStorageClassFlags(Attribs...) static assert(dglit_pstc.length == 1); static assert(dglit_pstc[0] == STC.ref_); - // Bugzilla 9317 + // https://issues.dlang.org/show_bug.cgi?id=9317 static inout(int) func(inout int param) { return param; } static assert(ParameterStorageClassTuple!(typeof(func))[0] == STC.none); } @safe unittest { - // Bugzilla 14253 + // https://issues.dlang.org/show_bug.cgi?id=14253 static struct Foo { ref Foo opAssign(ref Foo rhs) return { return this; } } @@ -1422,7 +1425,7 @@ if (func.length == 1 && isCallable!func) static assert([ParameterIdentifierTuple!foo] == ["num", "name", ""]); } -// Issue 19456 +// https://issues.dlang.org/show_bug.cgi?id=19456 @safe unittest { struct SomeType {} @@ -1498,7 +1501,6 @@ if (func.length == 1 && isCallable!func) // like this. auto " ~ val ~ " = " ~ args ~ "[0]; auto " ~ ptr ~ " = &" ~ val ~ "; - // workaround Bugzilla 16582 return *" ~ ptr ~ "; }; "); @@ -1539,7 +1541,8 @@ if (func.length == 1 && isCallable!func) static assert( ParameterDefaults!foo[3] == 0); } -@safe unittest // issue 17192 +// https://issues.dlang.org/show_bug.cgi?id=17192 +@safe unittest { static void func(int i, int PT, int __pd_value, int __pd_val, int __args, int name, int args, int val, int ptr, int args_, int val_, int ptr_) @@ -1572,7 +1575,8 @@ alias ParameterDefaultValueTuple = ParameterDefaults; static assert( PDVT!baz[2] == "hello"); static assert(is(typeof(PDVT!baz) == typeof(AliasSeq!(void, 1, "hello")))); - // bug 10800 - property functions return empty string + // property functions return empty string + // https://issues.dlang.org/show_bug.cgi?id=10800 @property void foo(int x = 3) { } static assert(PDVT!foo.length == 1); static assert(PDVT!foo[0] == 3); @@ -1584,9 +1588,11 @@ alias ParameterDefaultValueTuple = ParameterDefaults; static immutable Colour white = Colour(255,255,255,255); } + // https://issues.dlang.org/show_bug.cgi?id=8106 void bug8106(Colour c = Colour.white) {} //pragma(msg, PDVT!bug8106); static assert(PDVT!bug8106[0] == Colour.white); + // https://issues.dlang.org/show_bug.cgi?id=16582 void bug16582(scope int* val = null) {} static assert(PDVT!bug16582[0] is null); } @@ -2868,7 +2874,7 @@ template RepresentationTypeTuple(T) alias R1 = RepresentationTypeTuple!C; static assert(R1.length == 2 && is(R1[0] == int) && is(R1[1] == float)); - /* Issue 6642 */ + /* https://issues.dlang.org/show_bug.cgi?id=6642 */ import std.typecons : Rebindable; struct S5 { int a; Rebindable!(immutable Object) b; } @@ -2945,7 +2951,7 @@ private template hasRawAliasing(T) static assert(!hasRawAliasing!S2); } -// Issue 19228 +// https://issues.dlang.org/show_bug.cgi?id=19228 @safe unittest { static struct C @@ -3434,7 +3440,8 @@ template hasIndirections(T) static assert( hasIndirections!S26); } -@safe unittest //12000 +// https://issues.dlang.org/show_bug.cgi?id=12000 +@safe unittest { static struct S(T) { @@ -3485,7 +3492,7 @@ template hasUnsharedAliasing(T...) @safe unittest { - /* Issue 6642 */ + /* https://issues.dlang.org/show_bug.cgi?id=6642 */ import std.typecons : Rebindable; struct S8 { int a; Rebindable!(immutable Object) b; } static assert(!hasUnsharedAliasing!S8); @@ -3532,7 +3539,7 @@ template hasUnsharedAliasing(T...) static assert(!hasUnsharedAliasing!(Rebindable!(shared Object))); static assert( hasUnsharedAliasing!(Rebindable!Object)); - /* Issue 6979 */ + /* https://issues.dlang.org/show_bug.cgi?id=6979 */ static assert(!hasUnsharedAliasing!(int, shared(int)*)); static assert( hasUnsharedAliasing!(int, int*)); static assert( hasUnsharedAliasing!(int, const(int)[])); @@ -3858,7 +3865,7 @@ enum hasMember(T, string name) = __traits(hasMember, T, name); @safe unittest { - // 8321 + // https://issues.dlang.org/show_bug.cgi?id=8321 struct S { int x; void f(){} @@ -4291,7 +4298,8 @@ Use EnumMembers to generate a switch statement using static foreach. static assert([ EnumMembers!A ] == [ A.a, A.b, A.c, A.d, A.e ]); } -@safe unittest // Bugzilla 14561: huge enums +// https://issues.dlang.org/show_bug.cgi?id=14561: huge enums +@safe unittest { string genEnum() { @@ -4415,7 +4423,8 @@ if (is(T == class)) static assert(is(BaseClassesTuple!C3 == AliasSeq!(C2, C1, Object))); } -@safe unittest // issue 17276 +// https://issues.dlang.org/show_bug.cgi?id=17276 +@safe unittest { extern (C++) static interface Ext { @@ -4668,7 +4677,8 @@ if (is(C == class) || is(C == interface)) static assert(__traits(isSame, foos[1], B.foo)); } -@safe unittest // Issue 15920 +// https://issues.dlang.org/show_bug.cgi?id=15920 +@safe unittest { import std.meta : AliasSeq; class A @@ -4687,7 +4697,8 @@ if (is(C == class) || is(C == interface)) assert(__traits(isSame, fs[1], bfs[0]) || __traits(isSame, fs[1], bfs[1])); } -@safe unittest // Issue 8388 +// https://issues.dlang.org/show_bug.cgi?id=8388 +@safe unittest { class C { @@ -4699,7 +4710,7 @@ if (is(C == class) || is(C == interface)) /* Commented out, because this causes a cyclic dependency between module constructors/destructors error. Might - be caused by issue 20529. */ + be caused by https://issues.dlang.org/show_bug.cgi?id=20529. */ // static this() {} ~this() {} @@ -5397,7 +5408,8 @@ if (is(F == function) && is(G == function) || } /* * Check for parameters: - * - require exact match for types (cf. bugzilla 3075) + * - require exact match for types + * (cf. https://issues.dlang.org/show_bug.cgi?id=3075) * - require exact match for in, out, ref and lazy * - overrider can add scope, but can't remove */ @@ -6117,7 +6129,8 @@ enum bool isIntegral(T) = is(IntegralTypeOf!T) && !isAggregateType!T; static assert(!isIntegral!float); enum EU : uint { a = 0, b = 1, c = 2 } // base type is unsigned - enum EI : int { a = -1, b = 0, c = 1 } // base type is signed (bug 7909) + // base type is signed (https://issues.dlang.org/show_bug.cgi?id=7909) + enum EI : int { a = -1, b = 0, c = 1 } static assert(isIntegral!EU && isUnsigned!EU && !isSigned!EU); static assert(isIntegral!EI && !isUnsigned!EI && isSigned!EI); } @@ -6667,7 +6680,8 @@ template isConvertibleToString(T) assert(!isConvertibleToString!(char[])); } -@safe unittest // Bugzilla 16573 +// https://issues.dlang.org/show_bug.cgi?id=16573 +@safe unittest { enum I : int { foo = 1 } enum S : string { foo = "foo" } @@ -7457,7 +7471,7 @@ template isNestedFunction(alias f) static assert(!isNestedFunction!f); } -// issue 18669 +// https://issues.dlang.org/show_bug.cgi?id=18669 @safe unittest { static class Outer @@ -8113,7 +8127,8 @@ version (StdUnittest) private void freeFunc(string); static assert(mangledName!mangledName == "3std6traits11mangledName"); static assert(mangledName!freeFunc == "_D3std6traits8freeFuncFAyaZv"); int x; - static if (is(typeof({ return x; }) : int delegate() pure)) // issue 9148 + // https://issues.dlang.org/show_bug.cgi?id=9148 + static if (is(typeof({ return x; }) : int delegate() pure)) static assert(mangledName!((int a) { return a+x; }) == "DFNaNbNiNfiZi"); // pure nothrow @safe @nogc else static assert(mangledName!((int a) { return a+x; }) == "DFNbNiNfiZi"); // nothrow @safe @nnogc @@ -8122,7 +8137,7 @@ version (StdUnittest) private void freeFunc(string); @system unittest { // @system due to demangle - // Test for bug 5718 + // Test for https://issues.dlang.org/show_bug.cgi?id=5718 import std.demangle : demangle; int foo; auto foo_demangled = demangle(mangledName!foo); @@ -8560,7 +8575,7 @@ template getSymbolsByUDA(alias symbol, alias attribute) static assert(getSymbolsByUDA!(D, UDA).length == 0); } -// Issue 18314 +// https://issues.dlang.org/show_bug.cgi?id=18314 @safe unittest { enum attr1; @@ -8570,7 +8585,7 @@ template getSymbolsByUDA(alias symbol, alias attribute) { @attr1 int n; - // Removed due to Issue 16206 + // Removed due to https://issues.dlang.org/show_bug.cgi?id=16206 //@attr1 //void foo()(string){} @attr1 @@ -8583,7 +8598,8 @@ template getSymbolsByUDA(alias symbol, alias attribute) static assert(getSymbolsByUDA!(A, attr2).length == 1); } -// #15335: getSymbolsByUDA fails if type has private members +// getSymbolsByUDA fails if type has private members +// https://issues.dlang.org/show_bug.cgi?id=15335 @safe unittest { // HasPrivateMembers has, well, private members, one of which has a UDA. @@ -8597,7 +8613,8 @@ template getSymbolsByUDA(alias symbol, alias attribute) static assert(hasUDA!(getSymbolsByUDA!(HasPrivateMembers, Attr)[0], Attr)); } -// #16387: getSymbolsByUDA works with structs but fails with classes +// getSymbolsByUDA works with structs but fails with classes +// https://issues.dlang.org/show_bug.cgi?id=16387 @safe unittest { enum Attr; @@ -8611,7 +8628,8 @@ template getSymbolsByUDA(alias symbol, alias attribute) static assert(res[0].stringof == "a"); } -// #18884: getSymbolsByUDA fails on AliasSeq members +// getSymbolsByUDA fails on AliasSeq members +// https://issues.dlang.org/show_bug.cgi?id=18884 @safe unittest { struct X @@ -8622,7 +8640,8 @@ template getSymbolsByUDA(alias symbol, alias attribute) static assert(is(getSymbolsByUDA!(X, X) == AliasSeq!())); } -// #18624: getSymbolsByUDA produces wrong result if one of the symbols having the UDA is a function +// getSymbolsByUDA produces wrong result if one of the symbols having the UDA is a function +// https://issues.dlang.org/show_bug.cgi?id=18624 @safe unittest { enum Attr; @@ -8637,7 +8656,8 @@ template getSymbolsByUDA(alias symbol, alias attribute) static assert(getSymbolsByUDA!(A, Attr).stringof == "tuple(a, a, c)"); } -// Issue 20054: getSymbolsByUDA no longer works on modules +// getSymbolsByUDA no longer works on modules +// https://issues.dlang.org/show_bug.cgi?id=20054 version (StdUnittest) { @("Issue20054") diff --git a/std/typecons.d b/std/typecons.d index 16bb6b6ceef..0db5818ad35 100644 --- a/std/typecons.d +++ b/std/typecons.d @@ -443,7 +443,7 @@ private enum bool distinctFieldNames(names...) = __traits(compiles, static assert(!distinctFieldNames!(string, "abc", string, "abc")); static assert(distinctFieldNames!(string, "abc", int, "abd")); static assert(!distinctFieldNames!(int, "abc", string, "abd", int, "abc")); - // Issue 19240 + // https://issues.dlang.org/show_bug.cgi?id=19240 static assert(!distinctFieldNames!(int, "int")); } @@ -940,7 +940,7 @@ if (distinctFieldNames!(Specs)) if (names.length == 0 || allSatisfy!(isSomeString, typeof(names))) { import std.algorithm.comparison : equal; - // to circumvent bug 16418 + // to circumvent https://issues.dlang.org/show_bug.cgi?id=16418 static if (names.length == 0 || equal([names], [fieldNames])) return this; else @@ -1158,7 +1158,8 @@ if (distinctFieldNames!(Specs)) static assert( (typeof(this).alignof % typeof(return).alignof == 0) && (expand[from].offsetof % typeof(return).alignof == 0), - "Slicing by reference is impossible because of an alignment mistmatch. (See Phobos issue #15645.)"); + "Slicing by reference is impossible because of an alignment mistmatch" ~ + " (See https://issues.dlang.org/show_bug.cgi?id=15645)."); return *cast(typeof(return)*) &(field[from]); } @@ -1173,7 +1174,7 @@ if (distinctFieldNames!(Specs)) static assert(is(typeof(s) == Tuple!(string, float))); assert(s[0] == "abc" && s[1] == 4.5); - // Phobos issue #15645 + // https://issues.dlang.org/show_bug.cgi?id=15645 Tuple!(int, short, bool, double) b; static assert(!__traits(compiles, b.slice!(2, 4))); } @@ -1409,9 +1410,9 @@ if (distinctFieldNames!(Specs)) assert(t.expand.only.sum == 3); } +// https://issues.dlang.org/show_bug.cgi?id=4582 @safe unittest { - // Bugzilla 4582 static assert(!__traits(compiles, Tuple!(string, "id", int, "id"))); static assert(!__traits(compiles, Tuple!(string, "str", int, "i", string, "str", float))); } @@ -1717,7 +1718,7 @@ private template ReverseTupleSpecs(T...) ssCopy[1] = ssCopy[0]; assert(ssCopy[1].count == 2); } - // bug 2800 + // https://issues.dlang.org/show_bug.cgi?id=2800 { static struct R { @@ -1737,7 +1738,7 @@ private template ReverseTupleSpecs(T...) { auto t1 = Tuple!(int, double)(1, 1); - // 8702 + // https://issues.dlang.org/show_bug.cgi?id=8702 auto t8702a = tuple(tuple(1)); auto t8702b = Tuple!(Tuple!(int))(Tuple!(int)(1)); } @@ -1752,19 +1753,19 @@ private template ReverseTupleSpecs(T...) // incompatible static assert(!__traits(compiles, Tuple!(int, int)(y))); } - // 6275 + // https://issues.dlang.org/show_bug.cgi?id=6275 { const int x = 1; auto t1 = tuple(x); alias T = Tuple!(const(int)); auto t2 = T(1); } - // 9431 + // https://issues.dlang.org/show_bug.cgi?id=9431 { alias T = Tuple!(int[1][]); auto t = T([[10]]); } - // 7666 + // https://issues.dlang.org/show_bug.cgi?id=7666 { auto tup = tuple(1, "2"); assert(tup.reverse == tuple("2", 1)); @@ -1803,8 +1804,9 @@ private template ReverseTupleSpecs(T...) static assert( is(typeof(tc2 == tm2))); static assert( is(typeof(tc2 == tc2))); + // https://issues.dlang.org/show_bug.cgi?id=8686 struct Equ3 { bool opEquals(T)(T) { return true; } } - auto tm3 = tuple(Equ3.init); // bugzilla 8686 + auto tm3 = tuple(Equ3.init); const tc3 = tuple(Equ3.init); static assert( is(typeof(tm3 == tm3))); static assert( is(typeof(tm3 == tc3))); @@ -1853,7 +1855,7 @@ private template ReverseTupleSpecs(T...) static assert( is(typeof(tc4 < tm4))); static assert( is(typeof(tc4 < tc4))); } - // Bugzilla 14890 + // https://issues.dlang.org/show_bug.cgi?id=14890 static void test14890(inout int[] dummy) { alias V = Tuple!(int, int); @@ -1895,7 +1897,7 @@ private template ReverseTupleSpecs(T...) } @safe unittest { - // Bugzilla 10686 + // https://issues.dlang.org/show_bug.cgi?id=10686 immutable Tuple!(int) t1; auto r1 = t1[0]; // OK immutable Tuple!(int, "x") t2; @@ -1905,7 +1907,7 @@ private template ReverseTupleSpecs(T...) { import std.exception : assertCTFEable; - // Bugzilla 10218 + // https://issues.dlang.org/show_bug.cgi?id=10218 assertCTFEable!( { auto t = tuple(1); @@ -1940,7 +1942,7 @@ private template ReverseTupleSpecs(T...) TISIS e = TISIS(ss); } -// Bugzilla #9819 +// https://issues.dlang.org/show_bug.cgi?id=9819 @safe unittest { alias T = Tuple!(int, "x", double, "foo"); @@ -1951,7 +1953,7 @@ private template ReverseTupleSpecs(T...) static assert(Fields.fieldNames == AliasSeq!("id", "", "")); } -// Bugzilla 13837 +// https://issues.dlang.org/show_bug.cgi?id=13837 @safe unittest { // New behaviour, named arguments. @@ -2009,7 +2011,7 @@ private template ReverseTupleSpecs(T...) //static assert(tupStr == `Tuple!(int, double)(1, 1)`); } -// Issue 17803, parte uno +// https://issues.dlang.org/show_bug.cgi?id=17803, parte uno @safe unittest { auto a = tuple(3, "foo"); @@ -2270,7 +2272,8 @@ if (is(T == class) || is(T == interface) || isDynamicArray!T || isAssociativeArr a = new Widget; } -@safe unittest // issue 16054 +// https://issues.dlang.org/show_bug.cgi?id=16054 +@safe unittest { Rebindable!(immutable Object) r; static assert(__traits(compiles, r.get())); @@ -2288,7 +2291,9 @@ if (is(T == class) || is(T == interface) || isDynamicArray!T || isAssociativeArr ~ " by forwarding to A.toHash()."); } -@system unittest // issue 18615: Rebindable!A should use A.opEquals +// https://issues.dlang.org/show_bug.cgi?id=18615 +// Rebindable!A should use A.opEqualsa +@system unittest { class CustomOpEq { @@ -2333,7 +2338,8 @@ if (is(T == class) || is(T == interface) || isDynamicArray!T || isAssociativeArr ~ " comparable against Object itself and use Object.opEquals."); } -@safe unittest // issue 18755 +// https://issues.dlang.org/show_bug.cgi?id=18755 +@safe unittest { static class Foo { @@ -2494,7 +2500,7 @@ Rebindable!T rebindable(T)(Rebindable!T obj) assert(rebindable(arr) == arr); assert(rebindable(arrConst) == arr); - // Issue 7654 + // https://issues.dlang.org/show_bug.cgi?id=7654 immutable(char[]) s7654; Rebindable!(typeof(s7654)) r7654 = s7654; @@ -2505,7 +2511,7 @@ Rebindable!T rebindable(T)(Rebindable!T obj) static assert(is(Rebindable!(T[]) == T[])); } - // Issue 12046 + // https://issues.dlang.org/show_bug.cgi?id=12046 static assert(!__traits(compiles, Rebindable!(int[1]))); static assert(!__traits(compiles, Rebindable!(const int[1]))); @@ -2637,13 +2643,13 @@ string alignForSize(E...)(const char[][] names...) enum passAbnormalX = x == "int[] x;\ndouble[5] w;\nshort z;\nchar[3] y;\n"; enum passAbnormalY = y == "Foo y;\ndouble z;\nubyte x;\n"; - // ^ blame http://d.puremagic.com/issues/show_bug.cgi?id=231 + // ^ blame https://issues.dlang.org/show_bug.cgi?id=231 static assert(passNormalX || passAbnormalX && double.alignof <= (int[]).alignof); static assert(passNormalY || passAbnormalY && double.alignof <= int.alignof); } -// Issue 12914 +// https://issues.dlang.org/show_bug.cgi?id=12914 @safe unittest { immutable string[] fieldNames = ["x", "y"]; @@ -2759,7 +2765,7 @@ Params: assert(a != Nullable!int(29)); } - // Issue 17482 + // https://issues.dlang.org/show_bug.cgi?id=17482 @system unittest { import std.variant : Variant; @@ -2853,7 +2859,7 @@ Returns: assert(!ni.isNull); } -// Issue 14940 +// https://issues.dlang.org/show_bug.cgi?id=14940 @safe unittest { import std.array : appender; @@ -2865,7 +2871,7 @@ Returns: assert(app.data == "1"); } -// Issue 19799 +// https://issues.dlang.org/show_bug.cgi?id=19799 @safe unittest { import std.format : format; @@ -3161,9 +3167,10 @@ deprecated( s.nullify(); assert(s.isNull); } + +// https://issues.dlang.org/show_bug.cgi?id=9404 @safe unittest { - // Bugzilla 9404 alias N = Nullable!int; void foo(N a) @@ -3259,9 +3266,10 @@ deprecated( c = a; }} } + +// https://issues.dlang.org/show_bug.cgi?id=10268 @system unittest { - // Bugzilla 10268 import std.json; JSONValue value = null; auto na = Nullable!JSONValue(value); @@ -3310,18 +3318,20 @@ deprecated( assert(*x4.get.val == 10); } } + +// https://issues.dlang.org/show_bug.cgi?id=10357 @safe unittest { - // Bugzila 10357 import std.datetime; Nullable!SysTime time = SysTime(0); } + +// https://issues.dlang.org/show_bug.cgi?id=10915 @system unittest { import std.conv : to; import std.array; - // Bugzilla 10915 Appender!string buffer; Nullable!int ni; @@ -3360,7 +3370,7 @@ deprecated( assert(ntts.to!string() == "2.5"); } -// Bugzilla 14477 +// https://issues.dlang.org/show_bug.cgi?id=14477 @safe unittest { static struct DisabledDefaultConstructor @@ -3373,7 +3383,7 @@ deprecated( var.nullify; } -// Issue 17440 +// https://issues.dlang.org/show_bug.cgi?id=17440 @system unittest { static interface I { } @@ -3398,7 +3408,7 @@ deprecated( assert(c.canary == 0xA71FE); } -// bugzilla issue 19037 +// https://issues.dlang.org/show_bug.cgi?id=19037 @safe unittest { import std.datetime : SysTime; @@ -3541,7 +3551,7 @@ Params: template toString() { import std.format : FormatSpec, formatValue; - // Needs to be a template because of DMD @@BUG@@ 13737. + // Needs to be a template because of https://issues.dlang.org/show_bug.cgi?id=13737. void toString()(scope void delegate(const(char)[]) sink, scope const ref FormatSpec!char fmt) { if (isNull) @@ -3776,7 +3786,8 @@ if (is (typeof(nullValue) == T)) @nogc nothrow pure @safe unittest { - // issue 19226 - fully handle non-self-equal nullValue + // https://issues.dlang.org/show_bug.cgi?id=19226 + // fully handle non-self-equal nullValue static struct Fraction { int denominator; @@ -3867,7 +3878,7 @@ if (is (typeof(nullValue) == T)) { import std.conv : to; - // Bugzilla 10915 + // https://issues.dlang.org/show_bug.cgi?id=10915 Nullable!(int, 1) ni = 1; assert(ni.to!string() == "Nullable.null"); @@ -4022,7 +4033,7 @@ Params: template toString() { import std.format : FormatSpec, formatValue; - // Needs to be a template because of DMD @@BUG@@ 13737. + // Needs to be a template because of https://issues.dlang.org/show_bug.cgi?id=13737. void toString()(scope void delegate(const(char)[]) sink, scope const ref FormatSpec!char fmt) { if (isNull) @@ -4269,11 +4280,12 @@ auto nullableRef(T)(T* t) c = a; }} } + +// https://issues.dlang.org/show_bug.cgi?id=10915 @system unittest { import std.conv : to; - // Bugzilla 10915 NullableRef!int nri; assert(nri.to!string() == "Nullable.null"); @@ -4375,7 +4387,7 @@ alias BlackHole(Base) = AutoImplement!(Base, generateEmptyFunction, isAbstractFu c.doSomething(); } - // Bugzilla 12058 + // https://issues.dlang.org/show_bug.cgi?id=12058 interface Foo { inout(Object) foo() inout; @@ -4685,7 +4697,7 @@ private static: //::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::// // Add a non-final check to the cherrypickMethod. - enum bool canonicalPicker(fun.../+[BUG 4217]+/) = + enum bool canonicalPicker(fun.../+[https://issues.dlang.org/show_bug.cgi?id=4217]+/) = !__traits(isFinalFunction, fun[0]) && cherrypickMethod!(fun); /* @@ -4787,7 +4799,7 @@ private static: mixin CommonGeneratingPolicy; /* Generates constructor body. Just forward to the base class' one. */ - string generateFunctionBody(ctor.../+[BUG 4217]+/)() @property + string generateFunctionBody(ctor.../+[https://issues.dlang.org/show_bug.cgi?id=4217]+/)() @property { enum varstyle = variadicFunctionStyle!(typeof(&ctor[0])); @@ -4808,7 +4820,7 @@ private static: mixin CommonGeneratingPolicy; /* Geneartes method body. */ - string generateFunctionBody(func.../+[BUG 4217]+/)() @property + string generateFunctionBody(func.../+[https://issues.dlang.org/show_bug.cgi?id=4217]+/)() @property { return generateMethodBody!(Base, func); // given } @@ -4939,7 +4951,8 @@ private static: } /+ // deep inheritance { - // XXX [BUG 2525,3525] + // https://issues.dlang.org/show_bug.cgi?id=2525 + // https://issues.dlang.org/show_bug.cgi?id=3525 // NOTE: [r494] func.c(504-571) FuncDeclaration::semantic() interface I { void foo(); } interface J : I {} @@ -4949,7 +4962,9 @@ private static: }+/ } -// Issue 17177 - AutoImplement fails on function overload sets with "cannot infer type from overloaded function symbol" +// https://issues.dlang.org/show_bug.cgi?id=17177 +// AutoImplement fails on function overload sets with +// "cannot infer type from overloaded function symbol" @system unittest { static class Issue17177 @@ -4993,8 +5008,9 @@ private static: version (StdUnittest) { - // Issue 10647 - // Add prefix "issue10647_" as a workaround for issue 1238 + // https://issues.dlang.org/show_bug.cgi?id=10647 + // Add prefix "issue10647_" as a workaround for + // https://issues.dlang.org/show_bug.cgi?id=1238 private string issue10647_generateDoNothing(C, alias fun)() @property { string stmt; @@ -5146,7 +5162,8 @@ private static: // declaration here to reveal possible hidden functions. code ~= format("alias %s = %s.%s;\n", oset.name, - Policy.BASE_CLASS_ID, // [BUG 2540] super. + // super: https://issues.dlang.org/show_bug.cgi?id=2540 + Policy.BASE_CLASS_ID, oset.name); } } @@ -5352,7 +5369,7 @@ private static: Predefined how-policies for `AutoImplement`. These templates are also used by `BlackHole` and `WhiteHole`, respectively. */ -template generateEmptyFunction(C, func.../+[BUG 4217]+/) +template generateEmptyFunction(C, func.../+[https://issues.dlang.org/show_bug.cgi?id=4217]+/) { static if (is(ReturnType!(func) == void)) enum string generateEmptyFunction = q{ @@ -5502,7 +5519,7 @@ if (Targets.length >= 1 && allSatisfy!(isMutable, Targets)) alias type = F; } - // issue 12064: Remove NVI members + // https://issues.dlang.org/show_bug.cgi?id=12064: Remove NVI members template OnlyVirtual(members...) { enum notFinal(alias T) = !__traits(isFinalFunction, T); @@ -5837,9 +5854,10 @@ private interface Structural assert(d.draw(10) == 10); } } + +// https://issues.dlang.org/show_bug.cgi?id=10377 @system unittest { - // Bugzilla 10377 import std.range, std.algorithm; interface MyInputRange(T) @@ -5854,9 +5872,10 @@ private interface Structural auto r = iota(0,10,1).inputRangeObject().wrap!(MyInputRange!int)(); assert(equal(r, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9])); } + +// https://issues.dlang.org/show_bug.cgi?id=10536 @system unittest { - // Bugzilla 10536 interface Interface { int foo(); @@ -5888,7 +5907,8 @@ private interface Structural assert(i.bar(10) == 100); } -@system unittest // issue 12064 +// https://issues.dlang.org/show_bug.cgi?id=12064 +@system unittest { interface I { @@ -6249,7 +6269,8 @@ if (!is(T == class) && !(is(T == interface))) private enum enableGCScan = hasIndirections!T; } - extern(C) private pure nothrow @nogc static // TODO remove pure when https://issues.dlang.org/show_bug.cgi?id=15862 has been fixed + // TODO remove pure when https://issues.dlang.org/show_bug.cgi?id=15862 has been fixed + extern(C) private pure nothrow @nogc static { pragma(mangle, "free") void pureFree( void *ptr ); static if (enableGCScan) @@ -6523,7 +6544,8 @@ pure @system unittest } auto a = A(4); auto b = a.copy(); - assert(a.x._refCounted._store._count == 2, "BUG 4356 still unfixed"); + assert(a.x._refCounted._store._count == 2, + "https://issues.dlang.org/show_bug.cgi?id=4356 still unfixed"); } @betterC pure @system nothrow @nogc unittest @@ -6534,7 +6556,7 @@ pure @system unittest swap(p1, p2); } -// 6606 +// https://issues.dlang.org/show_bug.cgi?id=6606 @betterC @safe pure nothrow @nogc unittest { union U { @@ -6549,7 +6571,7 @@ pure @system unittest alias SRC = RefCounted!S; } -// 6436 +// https://issues.dlang.org/show_bug.cgi?id=6436 @betterC @system pure unittest { struct S { this(ref int val) { assert(val == 3); ++val; } } @@ -7105,7 +7127,7 @@ mixin template Proxy(alias a) h.ifti2(4); h.ifti3!int(4, 3); - // bug5896 test + // https://issues.dlang.org/show_bug.cgi?id=5896 test assert(h.opCast!int() == 0); assert(cast(int) h == 0); const ih = new const Hoge(new Foo()); @@ -7266,9 +7288,10 @@ mixin template Proxy(alias a) MyFoo2 f2; f2 = f2; } + +// https://issues.dlang.org/show_bug.cgi?id=8613 @safe unittest { - // bug8613 static struct Name { mixin Proxy!val; @@ -7291,7 +7314,8 @@ private enum isDIP1000 = __traits(compiles, () @safe { static if (isDIP1000) {} else @system unittest { - // bug14213, using function for the payload + // https://issues.dlang.org/show_bug.cgi?id=14213 + // using function for the payload static struct S { int foo() { return 12; } @@ -7314,7 +7338,7 @@ static if (isDIP1000) {} else // Check all floating point comparisons for both Proxy and Typedef, // also against int and a Typedef!int, to be as regression-proof -// as possible. bug 15561 +// as possible. https://issues.dlang.org/show_bug.cgi?id=15561 @safe unittest { static struct MyFloatImpl @@ -7379,7 +7403,8 @@ struct Typedef(T, T init = T.init, string cookie=null) { private T Typedef_payload = init; - // issue 18415 : prevent default construction if original type does too. + // https://issues.dlang.org/show_bug.cgi?id=18415 + // prevent default construction if original type does too. static if ((is(T == struct) || is(T == union)) && !is(typeof({T t;}))) { @disable this(); @@ -7514,7 +7539,7 @@ struct Typedef(T, T init = T.init, string cookie=null) static assert(!is(MoneyEuros == MoneyDollars)); } -// issue 12461 +// https://issues.dlang.org/show_bug.cgi?id=12461 @safe unittest { alias Int = Typedef!int; @@ -7623,7 +7648,8 @@ template TypedefType(T) assert(drange3[$] == 123); } -@safe @nogc pure nothrow unittest // Bugzilla 18415 +// https://issues.dlang.org/show_bug.cgi?id=18415 +@safe @nogc pure nothrow unittest { struct NoDefCtorS{@disable this();} union NoDefCtorU{@disable this();} @@ -7631,7 +7657,8 @@ template TypedefType(T) static assert(!is(typeof({Typedef!NoDefCtorU u;}))); } -@safe @nogc pure nothrow unittest // Bugzilla 11703 +// https://issues.dlang.org/show_bug.cgi?id=11703 +@safe @nogc pure nothrow unittest { alias I = Typedef!int; static assert(is(typeof(I.min) == I)); @@ -7648,7 +7675,7 @@ template TypedefType(T) @safe unittest { - // bug8655 + // https://issues.dlang.org/show_bug.cgi?id=8655 import std.typecons; import std.bitmanip; static import core.stdc.config; @@ -7664,7 +7691,8 @@ template TypedefType(T) } } -@safe unittest // Issue 12596 +// https://issues.dlang.org/show_bug.cgi?id=12596 +@safe unittest { import std.typecons; alias TD = Typedef!int; @@ -7953,7 +7981,8 @@ if (alignment > 0 && !((alignment - 1) & alignment)) return (n + badEnd) & ~badEnd; } -@system unittest // Issue 6580 testcase +// https://issues.dlang.org/show_bug.cgi?id=6580 testcase +@system unittest { enum alignment = (void*).alignof; @@ -8016,7 +8045,8 @@ if (alignment > 0 && !((alignment - 1) & alignment)) } } -@system unittest // Original Issue 6580 testcase +// Original https://issues.dlang.org/show_bug.cgi?id=6580 testcase +@system unittest { class C { int i; byte b; } @@ -8069,7 +8099,8 @@ if (alignment > 0 && !((alignment - 1) & alignment)) assert(A.dead, "asdasd"); } -@system unittest // Issue 8039 testcase +// https://issues.dlang.org/show_bug.cgi?id=8039 testcase +@system unittest { static int dels; static struct S { ~this(){ ++dels; } } @@ -8094,7 +8125,7 @@ if (alignment > 0 && !((alignment - 1) & alignment)) @system unittest { - // bug4500 + // https://issues.dlang.org/show_bug.cgi?id=4500 class A { this() { a = this; } @@ -8834,7 +8865,8 @@ template ReplaceTypeUnless(alias pred, From, To, T...) alias ReplaceTypeUnless = U!(staticMap!(replaceTemplateArgs, V)); } else static if (is(T[0] == struct)) - // don't match with alias this struct below (Issue 15168) + // don't match with alias this struct below + // https://issues.dlang.org/show_bug.cgi?id=15168 alias ReplaceTypeUnless = T[0]; else static if (is(T[0] == U[], U)) alias ReplaceTypeUnless = ReplaceTypeUnless!(pred, From, To, U)[]; @@ -9030,7 +9062,7 @@ private template replaceTypeInFunctionTypeUnless(alias pred, From, To, fun) string[3] function(string[] arr, string[2] ...) pure @trusted, ); - // Bugzilla 15168 + // https://issues.dlang.org/show_bug.cgi?id=15168 static struct T1 { string s; alias s this; } static struct T2 { char[10] s; alias s this; } static struct T3 { string[string] s; alias s this; } @@ -9041,7 +9073,8 @@ private template replaceTypeInFunctionTypeUnless(alias pred, From, To, fun) ); } -@safe unittest // Bugzilla 17116 +// https://issues.dlang.org/show_bug.cgi?id=17116 +@safe unittest { alias ConstDg = void delegate(float) const; alias B = void delegate(int) const; @@ -9049,22 +9082,24 @@ private template replaceTypeInFunctionTypeUnless(alias pred, From, To, fun) static assert(is(B == A)); } - -@safe unittest // Bugzilla 19696 + // https://issues.dlang.org/show_bug.cgi?id=19696 +@safe unittest { static struct T(U) {} static struct S { T!int t; alias t this; } static assert(is(ReplaceType!(float, float, S) == S)); } -@safe unittest // Bugzilla 19697 + // https://issues.dlang.org/show_bug.cgi?id=19697 +@safe unittest { class D(T) {} class C : D!C {} static assert(is(ReplaceType!(float, float, C))); } -@safe unittest // Bugzilla 16132 +// https://issues.dlang.org/show_bug.cgi?id=16132 +@safe unittest { interface I(T) {} class C : I!int {} diff --git a/std/uni.d b/std/uni.d index 46a1de119fb..ff4db891342 100644 --- a/std/uni.d +++ b/std/uni.d @@ -2877,7 +2877,8 @@ private: alias Ival = CodepointInterval; //intervals wrapper for a _range_ over packed array auto ivals = Intervals!(typeof(data[]))(data[]); - //@@@BUG@@@ can't use "a.a < b.a" see issue 12265 + //@@@BUG@@@ can't use "a.a < b.a" see + // https://issues.dlang.org/show_bug.cgi?id=12265 sort!((a,b) => a.a < b.a, SwapStrategy.stable)(ivals); // what follows is a variation on stable remove // differences: @@ -3733,7 +3734,7 @@ pure @safe unittest// iteration & opIndex [tuple(cast(uint)'A', cast(uint)'N'), tuple(cast(uint)'a', cast(uint)'n')] ), text(a.byInterval)); - // same @@@BUG as in issue 8949 ? + // same @@@BUG as in https://issues.dlang.org/show_bug.cgi?id=8949 ? version (bug8949) { import std.range : retro; @@ -8098,12 +8099,12 @@ if (isForwardRange!S1 && isSomeChar!(ElementEncodingType!S1) assert(icmp("ᾩ -> \u1F70\u03B9", "\u1F61\u03B9 -> ᾲ") == 0); assert(icmp("ΐ"w, "\u03B9\u0308\u0301") == 0); assert(sicmp("ΐ", "\u03B9\u0308\u0301") != 0); - //bugzilla 11057 + // https://issues.dlang.org/show_bug.cgi?id=11057 assert( icmp("K", "L") < 0 ); }); } -// issue 17372 +// https://issues.dlang.org/show_bug.cgi?id=17372 @safe pure unittest { import std.algorithm.iteration : joiner, map; @@ -8869,7 +8870,8 @@ else { import std.internal.unicode_tables; // : toLowerTable, toTitleTable, toUpperTable; // generated file - // hide template instances behind functions (Bugzilla 13232) + // hide template instances behind functions + // https://issues.dlang.org/show_bug.cgi?id=13232 ushort toLowerIndex(dchar c) { return toLowerIndexTrie[c]; } ushort toLowerSimpleIndex(dchar c) { return toLowerSimpleIndexTrie[c]; } dchar toLowerTab(size_t idx) { return toLowerTable[idx]; } @@ -9043,7 +9045,8 @@ if (isSomeString!S || (isRandomAccessRange!S && hasLength!S && hasSlicing!S && i return s.array; } -@safe unittest //12428 +// https://issues.dlang.org/show_bug.cgi?id=12428 +@safe unittest { import std.array : replicate; auto s = "abcdefghij".replicate(300); @@ -9054,7 +9057,8 @@ if (isSomeString!S || (isRandomAccessRange!S && hasLength!S && hasSlicing!S && i assert(s == "abcdefghij"); } -@safe unittest // 18993 +// https://issues.dlang.org/show_bug.cgi?id=18993 +@safe unittest { static assert(`몬스터/A`.toLower.length == `몬스터/a`.toLower.length); } @@ -9877,7 +9881,7 @@ if (isSomeString!S || (isRandomAccessRange!S && hasLength!S && hasSlicing!S && i assert("\u00df".toUpper == "SS"); } -//bugzilla 9629 +// https://issues.dlang.org/show_bug.cgi?id=9629 @safe unittest { wchar[] test = "hello þ world"w.dup; @@ -9927,11 +9931,12 @@ if (isSomeString!S || (isRandomAccessRange!S && hasLength!S && hasSlicing!S && i assert(toLower("Some String"w) == "some string"w); assert(toLower("Some String"d) == "some string"d); - // bugzilla 12455 + // https://issues.dlang.org/show_bug.cgi?id=12455 dchar c = 'İ'; // '\U0130' LATIN CAPITAL LETTER I WITH DOT ABOVE assert(isUpper(c)); assert(toLower(c) == 'i'); - // extend on 12455 reprot - check simple-case toUpper too + // extends on https://issues.dlang.org/show_bug.cgi?id=12455 report + // check simple-case toUpper too c = '\u1f87'; assert(isLower(c)); assert(toUpper(c) == '\u1F8F'); diff --git a/std/utf.d b/std/utf.d index 72c791c7b93..1dea9f7723e 100644 --- a/std/utf.d +++ b/std/utf.d @@ -91,7 +91,8 @@ class UTFException : UnicodeException return this; } - // FIXME: Use std.exception.basicExceptionCtors here once bug #11500 is fixed + // FIXME: Use std.exception.basicExceptionCtors here once + // https://issues.dlang.org/show_bug.cgi?id=11500 is fixed /** Standard exception constructors. @@ -1215,9 +1216,11 @@ do } else { - //@@@BUG@@@ 14447 forces canIndex to be done outside of decodeImpl, which - //is undesirable, since not all overloads of decodeImpl need it. So, it - //should be moved back into decodeImpl once bug# 8521 has been fixed. + // https://issues.dlang.org/show_bug.cgi?id=14447 forces canIndex to be + // done outside of decodeImpl, which is undesirable, since not all + // overloads of decodeImpl need it. So, it should be moved back into + // decodeImpl once https://issues.dlang.org/show_bug.cgi?id=8521 + // has been fixed. enum canIndex = isRandomAccessRange!S && hasSlicing!S && hasLength!S; immutable retval = decodeImpl!(canIndex, useReplacementDchar)(cast(TypeForDecode!S) str, numCodeUnits); @@ -1472,7 +1475,8 @@ if ( else alias pstr = str; - //@@@BUG@@@ 14447 forces this to be done outside of decodeImpl + // https://issues.dlang.org/show_bug.cgi?id=14447 forces this to be done + // outside of decodeImpl //enum canIndex = is(S : const char[]) || (isRandomAccessRange!S && hasSlicing!S && hasLength!S); static if (canIndex) @@ -1688,7 +1692,8 @@ if (is(S : const wchar[]) || (isInputRange!S && is(Unqual!(ElementEncodingType!S else alias pstr = str; - //@@@BUG@@@ 14447 forces this to be done outside of decodeImpl + // https://issues.dlang.org/show_bug.cgi?id=14447 forces this to be done + // outside of decodeImpl //enum canIndex = is(S : const wchar[]) || (isRandomAccessRange!S && hasSlicing!S && hasLength!S); static if (canIndex) @@ -2900,7 +2905,8 @@ if (isSomeString!S) assertThrown!UTFException(validate(a)); } -@safe unittest // bugzilla 12923 +// https://issues.dlang.org/show_bug.cgi?id=12923 +@safe unittest { import std.exception; assertThrown((){ diff --git a/std/variant.d b/std/variant.d index a53ac441723..b6ccf2cfea8 100644 --- a/std/variant.d +++ b/std/variant.d @@ -1279,7 +1279,7 @@ public: assert(v[42] == 5); } -// opIndex with static arrays, issue 12771 +// opIndex with static arrays, https://issues.dlang.org/show_bug.cgi?id=12771 @system unittest { int[4] elements = [0, 1, 2, 3]; @@ -1310,7 +1310,7 @@ public: assertThrown!VariantException(v[1] = Variant(null)); } -//Issue# 10879 +// https://issues.dlang.org/show_bug.cgi?id=10879 @system unittest { int[10] arr = [1,2,3,4,5,6,7,8,9,10]; @@ -1336,7 +1336,7 @@ public: assert(v3 == ls); } -//Issue# 8195 +// https://issues.dlang.org/show_bug.cgi?id=8195 @system unittest { struct S @@ -1356,7 +1356,7 @@ public: assert(v == S.init); } -// Issue #10961 +// https://issues.dlang.org/show_bug.cgi?id=10961 @system unittest { // Primarily test that we can assign a void[] to a Variant. @@ -1366,7 +1366,7 @@ public: assert(returned == elements); } -// Issue #13352 +// https://issues.dlang.org/show_bug.cgi?id=13352 @system unittest { alias TP = Algebraic!(long); @@ -1382,7 +1382,7 @@ public: assert(a + c == 4L); } -// Issue #13354 +// https://issues.dlang.org/show_bug.cgi?id=13354 @system unittest { alias A = Algebraic!(string[]); @@ -1400,14 +1400,14 @@ public: assert(aa["b"] == 3); } -// Issue #14198 +// https://issues.dlang.org/show_bug.cgi?id=14198 @system unittest { Variant a = true; assert(a.type == typeid(bool)); } -// Issue #14233 +// https://issues.dlang.org/show_bug.cgi?id=14233 @system unittest { alias Atom = Algebraic!(string, This[]); @@ -1424,7 +1424,7 @@ pure nothrow @nogc a = 1.0; } -// Issue 14457 +// https://issues.dlang.org/show_bug.cgi?id=14457 @system unittest { alias A = Algebraic!(int, float, double); @@ -1438,7 +1438,7 @@ pure nothrow @nogc assert(a.get!float == 6f); } -// Issue 14585 +// https://issues.dlang.org/show_bug.cgi?id=14585 @system unittest { static struct S @@ -1449,7 +1449,7 @@ pure nothrow @nogc Variant(S()).get!S; } -// Issue 14586 +// https://issues.dlang.org/show_bug.cgi?id=14586 @system unittest { const Variant v = new immutable Object; @@ -1466,7 +1466,7 @@ pure nothrow @nogc v.get!S; } -// issue 13262 +// https://issues.dlang.org/show_bug.cgi?id=13262 @system unittest { static void fun(T)(Variant v){ @@ -1528,7 +1528,7 @@ pure nothrow @nogc Algebraic!(SafeS) y; } -// issue 19986 +// https://issues.dlang.org/show_bug.cgi?id=19986 @system unittest { VariantN!32 v; @@ -2000,9 +2000,9 @@ deprecated static assert(!__traits(compiles, {v > null;})); } +// https://issues.dlang.org/show_bug.cgi?id=1558 @system unittest { - // bug 1558 Variant va=1; Variant vb=-2; assert((va+vb).get!(int) == -1); @@ -2067,7 +2067,7 @@ deprecated assert(v.convertsTo!(char[])); } -// http://d.puremagic.com/issues/show_bug.cgi?id=5424 +// https://issues.dlang.org/show_bug.cgi?id=5424 @system unittest { interface A { @@ -2083,14 +2083,14 @@ deprecated Variant b = Variant(a); } +// https://issues.dlang.org/show_bug.cgi?id=7070 @system unittest { - // bug 7070 Variant v; v = null; } -// Class and interface opEquals, issue 12157 +// Class and interface opEquals, https://issues.dlang.org/show_bug.cgi?id=12157 @system unittest { class Foo { } @@ -2108,7 +2108,7 @@ deprecated assert(v2 == f2); } -// Const parameters with opCall, issue 11361. +// Const parameters with opCall, https://issues.dlang.org/show_bug.cgi?id=11361 @system unittest { static string t1(string c) { @@ -2139,7 +2139,7 @@ deprecated assert(v3(4).type == typeid(char[])); } -// issue 12071 +// https://issues.dlang.org/show_bug.cgi?id=12071 @system unittest { static struct Structure { int data; } @@ -2156,7 +2156,8 @@ deprecated assert(called); } -// Ordering comparisons of incompatible types, e.g. issue 7990. +// Ordering comparisons of incompatible types +// e.g. https://issues.dlang.org/show_bug.cgi?id=7990 @system unittest { import std.exception : assertThrown; @@ -2168,7 +2169,8 @@ deprecated assertThrown!VariantException(Variant(3) < Variant.init); } -// Handling of unordered types, e.g. issue 9043. +// Handling of unordered types +// https://issues.dlang.org/show_bug.cgi?id=9043 @system unittest { import std.exception : assertThrown; @@ -2181,7 +2183,8 @@ deprecated assertThrown!VariantException(Variant(A(3)) < Variant(A(4))); } -// Handling of empty types and arrays, e.g. issue 10958 +// Handling of empty types and arrays +// https://issues.dlang.org/show_bug.cgi?id=10958 @system unittest { class EmptyClass { } @@ -2212,7 +2215,8 @@ deprecated assert(a.get!EmptyArray == arr); } -// Handling of void function pointers / delegates, e.g. issue 11360 +// Handling of void function pointers / delegates +// https://issues.dlang.org/show_bug.cgi?id=11360 @system unittest { static void t1() { } @@ -2224,7 +2228,8 @@ deprecated assert(v2() == 3); } -// Using peek for large structs, issue 8580 +// Using peek for large structs +// https://issues.dlang.org/show_bug.cgi?id=8580 @system unittest { struct TestStruct(bool pad) @@ -2630,9 +2635,9 @@ if (isAlgebraic!VariantType && Handler.length > 0) assert(depth(fb) == 3); } +// https://issues.dlang.org/show_bug.cgi?id=16383 @system unittest { - // https://issues.dlang.org/show_bug.cgi?id=16383 class Foo {this() immutable {}} alias V = Algebraic!(immutable Foo); @@ -2642,9 +2647,9 @@ if (isAlgebraic!VariantType && Handler.length > 0) assert(x == 3); } +// https://issues.dlang.org/show_bug.cgi?id=5310 @system unittest { - // http://d.puremagic.com/issues/show_bug.cgi?id=5310 const Variant a; assert(a == a); Variant b; @@ -2658,9 +2663,9 @@ if (isAlgebraic!VariantType && Handler.length > 0) assert(a[0] == 2); } +// https://issues.dlang.org/show_bug.cgi?id=10017 @system unittest { - // http://d.puremagic.com/issues/show_bug.cgi?id=10017 static struct S { ubyte[Variant.size + 1] s; @@ -2671,10 +2676,11 @@ if (isAlgebraic!VariantType && Handler.length > 0) v2 = v1; // AssertError: target must be non-null assert(v1 == v2); } + +// https://issues.dlang.org/show_bug.cgi?id=7069 @system unittest { import std.exception : assertThrown; - // http://d.puremagic.com/issues/show_bug.cgi?id=7069 Variant v; int i = 10; @@ -2833,11 +2839,11 @@ if (isAlgebraic!VariantType && Handler.length > 0) } } +// https://issues.dlang.org/show_bug.cgi?id=12540 @system unittest { static struct DummyScope { - // https://d.puremagic.com/issues/show_bug.cgi?id=12540 alias Alias12540 = Algebraic!Class12540; static class Class12540 @@ -2895,7 +2901,7 @@ if (isAlgebraic!VariantType && Handler.length > 0) @system unittest { - // Bugzilla 13300 + // https://issues.dlang.org/show_bug.cgi?id=13300 static struct S { this(this) {} @@ -2923,9 +2929,9 @@ if (isAlgebraic!VariantType && Handler.length > 0) auto a = appender!(T[]); } +// https://issues.dlang.org/show_bug.cgi?id=13871 @system unittest { - // Bugzilla 13871 alias A = Algebraic!(int, typeof(null)); static struct B { A value; } alias C = std.variant.Algebraic!B; @@ -2962,9 +2968,9 @@ if (isAlgebraic!VariantType && Handler.length > 0) assertThrown!VariantException(v.length); } +// https://issues.dlang.org/show_bug.cgi?id=13534 @system unittest { - // Bugzilla 13534 static assert(!__traits(compiles, () @safe { auto foo() @system { return 3; } auto v = Variant(&foo); @@ -2972,9 +2978,9 @@ if (isAlgebraic!VariantType && Handler.length > 0) })); } +// https://issues.dlang.org/show_bug.cgi?id=15039 @system unittest { - // Bugzilla 15039 import std.typecons; import std.variant; @@ -2990,9 +2996,9 @@ if (isAlgebraic!VariantType && Handler.length > 0) ); } +// https://issues.dlang.org/show_bug.cgi?id=15791 @system unittest { - // Bugzilla 15791 int n = 3; struct NS1 { int foo() { return n + 10; } } struct NS2 { int foo() { return n * 10; } } @@ -3004,16 +3010,16 @@ if (isAlgebraic!VariantType && Handler.length > 0) assert(v.get!NS2.foo() == 30); } +// https://issues.dlang.org/show_bug.cgi?id=15827 @system unittest { - // Bugzilla 15827 static struct Foo15827 { Variant v; this(Foo15827 v) {} } Variant v = Foo15827.init; } +// https://issues.dlang.org/show_bug.cgi?id=18934 @system unittest { - // Bugzilla 18934 static struct S { const int x; @@ -3029,9 +3035,9 @@ if (isAlgebraic!VariantType && Handler.length > 0) assert(v.get!S.x == 2); } +// https://issues.dlang.org/show_bug.cgi?id=19200 @system unittest { - // Bugzilla 19200 static struct S { static int opBinaryRight(string op : "|", T)(T rhs) @@ -3046,9 +3052,9 @@ if (isAlgebraic!VariantType && Handler.length > 0) assert(b == 3); } +// https://issues.dlang.org/show_bug.cgi?id=11061 @system unittest { - // Bugzilla 11061 int[4] el = [0, 1, 2, 3]; int[3] nl = [0, 1, 2]; Variant v1 = el; @@ -3062,9 +3068,9 @@ if (isAlgebraic!VariantType && Handler.length > 0) assert(v1 == [0, 1] ~ [2, 3]); // Compare Var(dynamic) to dynamic } +// https://issues.dlang.org/show_bug.cgi?id=15940 @system unittest { - // Bugzilla 15940 class C { } struct S { @@ -3089,9 +3095,9 @@ if (isAlgebraic!VariantType && Handler.length > 0) assert(v == [0,1]); } +// https://issues.dlang.org/show_bug.cgi?id=19994 @safe unittest { - // Bugzilla 19994 alias Inner = Algebraic!(This*); alias Outer = Algebraic!(Inner, This*); diff --git a/std/windows/registry.d b/std/windows/registry.d index d43827559d5..cdf37c11cf6 100644 --- a/std/windows/registry.d +++ b/std/windows/registry.d @@ -524,7 +524,7 @@ do REG_VALUE_TYPE type; - // See bugzilla 961 on this + // See https://issues.dlang.org/show_bug.cgi?id=961 on this union U { uint dw; diff --git a/std/xml.d b/std/xml.d index 389a299a9a2..413e475b013 100644 --- a/std/xml.d +++ b/std/xml.d @@ -1319,7 +1319,8 @@ class Comment : Item override @property @safe @nogc pure nothrow scope bool isEmptyXML() const { return false; } /// Returns false always } -@safe unittest // issue 16241 +// https://issues.dlang.org/show_bug.cgi?id=16241 +@safe unittest { import std.exception : assertThrown; auto c = new Comment("=="); @@ -2097,8 +2098,8 @@ class ElementParser { Tag startTag = new Tag(tag_.name); - // FIX by hed010gy, for bug 2979 - // http://d.puremagic.com/issues/show_bug.cgi?id=2979 + // FIX by hed010gy + // https://issues.dlang.org/show_bug.cgi?id=2979 if (tag_.attr.length > 0) foreach (tn,tv; tag_.attr) startTag.attr[tn]=tv; // END FIX diff --git a/std/zip.d b/std/zip.d index b7c1a14f1f0..4d7422bdd1c 100644 --- a/std/zip.d +++ b/std/zip.d @@ -611,7 +611,7 @@ public: _directory.remove(de.name); } - // issue 20398 + // https://issues.dlang.org/show_bug.cgi?id=20398 @safe unittest { import std.string : representation; @@ -1609,7 +1609,8 @@ the quick brown fox jumps over the lazy dog\r @system unittest { - // issue #20239: chameleon file, containing two valid end of central directory entries + // https://issues.dlang.org/show_bug.cgi?id=20239 + // chameleon file, containing two valid end of central directory entries auto file = "\x50\x4B\x03\x04\x0A\x00\x00\x00\x00\x00\x89\x36\x39\x4F\x04\x6A\xB3\xA3\x01\x00"~ "\x00\x00\x01\x00\x00\x00\x0D\x00\x1C\x00\x62\x65\x73\x74\x5F\x6C\x61\x6E\x67\x75"~ @@ -1636,7 +1637,8 @@ the quick brown fox jumps over the lazy dog\r @system unittest { - // issue #20287: check for correct compressed data + // https://issues.dlang.org/show_bug.cgi?id=20287 + // check for correct compressed data auto file = "\x50\x4b\x03\x04\x0a\x00\x00\x00\x00\x00\x8f\x72\x4a\x4f\x86\xa6"~ "\x10\x36\x05\x00\x00\x00\x05\x00\x00\x00\x04\x00\x1c\x00\x66\x69"~ @@ -1654,7 +1656,7 @@ the quick brown fox jumps over the lazy dog\r assert(za.directory["file"].compressedData == [104, 101, 108, 108, 111]); } -// issue #20027 +// https://issues.dlang.org/show_bug.cgi?id=20027 @system unittest { // central file header overlaps end of central directory @@ -1694,7 +1696,8 @@ the quick brown fox jumps over the lazy dog\r @system unittest { - // issue #20295: zip64 with 0xff bytes in end of central dir record do not work + // https://issues.dlang.org/show_bug.cgi?id=20295 + // zip64 with 0xff bytes in end of central dir record do not work // minimum (empty zip64) archive should pass auto file = "\x50\x4b\x06\x06\x2c\x00\x00\x00\x00\x00\x00\x00\x1e\x03\x2d\x00"~ diff --git a/std/zlib.d b/std/zlib.d index bd2fe37ebec..beb280f891d 100644 --- a/std/zlib.d +++ b/std/zlib.d @@ -664,7 +664,8 @@ class UnCompress return destbuf; } - // Test for issues 3191 and 9505 + // Test for https://issues.dlang.org/show_bug.cgi?id=3191 and + // https://issues.dlang.org/show_bug.cgi?id=9505 @system unittest { import std.algorithm.comparison; @@ -880,7 +881,8 @@ import std.stdio; assert( output[] == input[] ); } +// https://issues.dlang.org/show_bug.cgi?id=15457 @system unittest { - static assert(__traits(compiles, etc.c.zlib.gzclose(null))); // bugzilla 15457 + static assert(__traits(compiles, etc.c.zlib.gzclose(null))); }