use format int unittest

Rainer Schuetze via Digitalmars-d-ide digitalmars-d-ide at puremagic.com
Sat Apr 15 06:02:56 PDT 2017



On 15.04.2017 09:28, okeyes wrote:
> On Saturday, 18 March 2017 at 13:54:22 UTC, okeyes wrote:
>> visual studio 2013,visuald0.44.1 dmd2.073.2
>>
>> code like this
>>
>> import std.stdio;
>> import std.string;
>>
>> int main(string[] argv)
>> {
>>     writeln("Hello D-World!");
>>     return 0;
>> }
>>
>> unittest
>> {
>>     string str=format("test format %d",1);
>>     writeln(str);
>> }
>>
>>
>> when debugger ,getting wrong.
>>
>> when change Debugger"Mago" to "Visual Studio",is OK
>
>
> int main(string[] argv)
> {
>     writeln("Hello D-World!");
>     string str=format("test format %d",1);
>     return 0;
> }
>
>
> unittest
> {
> }
>
> get this err.
>
> First-chance exception: D Exception Unterminated format specifier: "%"
> at C:\D\dmd2\windows\bin\..\..\src\phobos\std\format.d(1103)
>
> using format and using unittest.

That's the same issue, it doesn't matter where std.format is 
instantiated. Being a template its unittests are still compiled in.


More information about the Digitalmars-d-ide mailing list