mirror of
https://github.com/boostorg/contract.git
synced 2026-02-27 04:52:22 +00:00
finshed a first round of test, starting examples
This commit is contained in:
19
test/set/post_pre_post-error.cpp
Normal file
19
test/set/post_pre_post-error.cpp
Normal file
@@ -0,0 +1,19 @@
|
||||
|
||||
// Test multi post around pre error (for free func, but same for all contracts).
|
||||
|
||||
#include <boost/contract/free_function.hpp>
|
||||
#include <boost/contract/scoped.hpp>
|
||||
|
||||
void f() {
|
||||
boost::contract::scoped c = boost::contract::free_function()
|
||||
.postcondition([] {})
|
||||
.precondition([] {})
|
||||
.postcondition([] {}) // Error (multiple post around pre).
|
||||
;
|
||||
}
|
||||
|
||||
int main() {
|
||||
f();
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user