Progress.
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
#include <doctest/doctest.h>
|
||||
|
||||
#include <hdk/grid/PrimitiveWrapper.hpp>
|
||||
|
||||
TEST_CASE("PrimitiveWrapper stores and exposes primitive values") {
|
||||
hdk::grid::PrimitiveWrapper<int> wrapped(7);
|
||||
CHECK(static_cast<int>(wrapped) == 7);
|
||||
|
||||
wrapped = 42;
|
||||
CHECK(static_cast<int>(wrapped) == 42);
|
||||
}
|
||||
|
||||
TEST_CASE("PrimitiveWrapper assignment returns self for chaining") {
|
||||
hdk::grid::PrimitiveWrapper<int> wrapped(1);
|
||||
auto& ref = (wrapped = 9);
|
||||
CHECK(&ref == &wrapped);
|
||||
CHECK(static_cast<int>(wrapped) == 9);
|
||||
}
|
||||
Reference in New Issue
Block a user