Are exceptions caught in unittests?

Ferhat Kurtulmuş aferust at gmail.com
Fri Feb 16 07:57:08 UTC 2024


On Friday, 16 February 2024 at 07:54:01 UTC, Richard (Rikki) 
Andrew Cattermole wrote:
> This should be working.
>
> I don't know what is going on.
>
> All I can suggest is to use a debugger to see if it is indeed 
> throwing and then catching.

A test code like this works, but unittest doesn't. This is crazy:

```d
import std.stdio;
import evalex;

     void main(){
         string text = "2 + * 3";
         try {
             auto evaluator = new Eval!double(text);
             auto result = evaluator.result;
             writeln(result);
         }catch (ParserException e){
             writeln(e.msg);
         }

     }
     ```


More information about the Digitalmars-d-learn mailing list