mirror of
https://github.com/dlang/phobos.git
synced 2025-04-26 21:22:20 +03:00
This commit is contained in:
parent
b41bcd93df
commit
c64232d813
1 changed files with 17 additions and 0 deletions
|
@ -296,6 +296,8 @@ if (is(Unqual!Char == Char))
|
||||||
}
|
}
|
||||||
|
|
||||||
width = 0;
|
width = 0;
|
||||||
|
indexStart = 0;
|
||||||
|
indexEnd = 0;
|
||||||
precision = UNSPECIFIED;
|
precision = UNSPECIFIED;
|
||||||
nested = null;
|
nested = null;
|
||||||
// Parse the spec (we assume we're past '%' already)
|
// Parse the spec (we assume we're past '%' already)
|
||||||
|
@ -834,6 +836,21 @@ if (is(Unqual!Char == Char))
|
||||||
== "$ expected after '*10' in format string");
|
== "$ expected after '*10' in format string");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// https://github.com/dlang/phobos/issues/10713
|
||||||
|
@safe pure unittest
|
||||||
|
{
|
||||||
|
import std.array : appender;
|
||||||
|
auto f = FormatSpec!char("%3$d%d");
|
||||||
|
|
||||||
|
auto w = appender!(char[])();
|
||||||
|
f.writeUpToNextSpec(w);
|
||||||
|
assert(f.indexStart == 3);
|
||||||
|
|
||||||
|
f.writeUpToNextSpec(w);
|
||||||
|
assert(w.data.length == 0);
|
||||||
|
assert(f.indexStart == 0);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Helper function that returns a `FormatSpec` for a single format specifier.
|
Helper function that returns a `FormatSpec` for a single format specifier.
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue