digitalmars.D.ide - use format int unittest
- okeyes (16/16) Mar 18 2017 visual studio 2013,visuald0.44.1 dmd2.073.2
- Rainer Schuetze (12/28) Mar 19 2017 I guess what you are seeing is a program stop at an Exception in
- okeyes (15/31) Apr 15 2017 int main(string[] argv)
- Rainer Schuetze (3/40) Apr 15 2017 That's the same issue, it doesn't matter where std.format is
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
Mar 18 2017
On 18.03.2017 14:54, 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 OKI guess what you are seeing is a program stop at an Exception in std.format that is expected to be thrown by std.format unittests. These are compiled into your executable due to the way they are defined as part of a template. The simplest workaround is to sigh and press "Continue". Alternatively, you can disable stopping on exceptions when they are thrown (unhandled exceptions will still be shown). For Mago, that is done by unchecking "D Exceptions" in the Exceptions window (Ctrl+Alt+E). The Visual Studio debugger treats it as a "Win32 Exception", uncheck "D Exception" below that entry. The downside is that the debugger will also not break for exceptions that you want to debug.
Mar 19 2017
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 OKint 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.
Apr 15 2017
On 15.04.2017 09:28, okeyes wrote:On Saturday, 18 March 2017 at 13:54:22 UTC, okeyes wrote:That's the same issue, it doesn't matter where std.format is instantiated. Being a template its unittests are still compiled in.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 OKint 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.
Apr 15 2017