Utility class useful in scenarios where actual testing code is reused in different contexts and file+line information is not enough to uniquely identify failed case.
Exception class to be thrown from unot tests blocks.
Effectively partial specialization alias: test = enforceImpl!(TestException)
Verifies that call to expr does not allocate GC memory
Verifies that given expression throws exception instance of expected type.
Boost Software License Version 1.0. See LICENSE_BOOST.txt for details. Alternatively, this file may be distributed under the terms of the Tango 3-Clause BSD License (see LICENSE_BSD.txt for details).
Copyright (c) 2009-2016 dunnhumby Germany GmbH. All rights reserved.
Defines base exception class thrown by test checks and set of helper functions to define actual test cases. These helpers are supposed to be used in unittest blocks instead of asserts.
There were three reasons why dedicated function got introduced:
1) Bultin assert throws an Error, which makes implementing test runner that doesn't stop on first failure illegal by language specification. 2) These test functions can provide more informational formatting compared to plain assert, for example test!("==")(a, b) will print a and b values on failure. 3) Having dedicated exception type for test failures makes possible to distinguish in test runners between contract failures and test failures.