cmoon::test::assert_sequence_equal
Defined in module
<cmoon.test>
|
(1) |
|
(2) |
Throws an assert_exception
if the two seqences are not equal.
Parameters
begin1 | - | Iterator to the beginning of the first sequence |
end1 | - | Iterator to end of the first sequence |
begin2 | - | Iterator to the beginning of the second sequence |
r1 | - | First sequence |
r2 | - | Second sequence |
pred | - | Function called for comparison |
proj1 | - | Function to change an element of r1 before comparing |
proj2 | - | Function to change an element of r2 before comparing |
message | - | Extra information to be added to the error message |
location | - | Information about where in the file this assertion was ran |
Return value
(none)
Example
import <vector>;
import cmoon.test;
class example_test : public cmoon::test::test_case
{
public:
example_test()
: cmoon::test::test_case{"example test"} {}
void operator()() override
{
const std::vector<int> expected {1, 2, 3};
std::vector<int> values {1, 2, 3};
cmoon::test::assert_sequence_equal(std::begin(values), std::end(values), std::begin(expected));
cmoon::test::assert_sequence_equal(values, expected);
}
};