On 04/11/2017 11:01 PM, Szabo Bogdan wrote:

    should.not.throwAnyException({
      throw new Exception("test");
    });

what do you mean, they are not documented? there is a md file fith some
examples here:
https://github.com/gedaiu/fluent-asserts/blob/v0.3.0/api/exceptions.md

What do you think I can do to have the exception asserts to fit the style?

The expression comes first in the other use cases. The following is not very pretty but seems to work with my proof of concept below:

    ({
        throw new Exception("test");
    }()).should.not.throwAnyException();

I checked the syntax with the following code:

struct Should {
    Should not() {
        return this;
    }

    Should throwAnyException() {
        return this;
    }
}

Should should(E)(lazy E expr) {
    return Should();
}

void main() {
    ({
        throw new Exception("test");
    }()).should.not.throwAnyException();
}

Ali

Reply via email to