Skip to content

Commit 613850c

Browse files
authored
Merge pull request #8773 from FeepingCreature/fix/issue-23976
Fix issue 23976: std.range.slide fails in dmd-2.104.0
2 parents f22cc26 + 1d2b992 commit 613850c

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

std/range/package.d

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9115,7 +9115,7 @@ public:
91159115
{
91169116
static if (needsEndTracker)
91179117
{
9118-
if (poppedElems < windowSize)
9118+
if (nextSource.empty)
91199119
hasShownPartialBefore = true;
91209120
}
91219121
else
@@ -10095,6 +10095,15 @@ public:
1009510095
assert("ab cd".splitter(' ').slide!(No.withPartial)(2).equal!equal([["ab", "cd"]]));
1009610096
}
1009710097

10098+
// https://issues.dlang.org/show_bug.cgi?id=23976
10099+
@safe unittest
10100+
{
10101+
import std.algorithm.comparison : equal;
10102+
import std.algorithm.iteration : splitter;
10103+
10104+
assert("1<2".splitter('<').slide(2).equal!equal([["1", "2"]]));
10105+
}
10106+
1009810107
private struct OnlyResult(Values...)
1009910108
if (Values.length > 1)
1010010109
{

0 commit comments

Comments
 (0)