samedi 16 juin 2018

Is there a way of detecting whether code is being called from tests in Rust?

I'd like to be able to check within my code itself whether or not it is running from a test. It would be ideal to do this, for example, to interface with test databases, web services, etc. A simple bool would suffice.

Does Rust have an existing API for this?

Aucun commentaire:

Enregistrer un commentaire