aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFelix Morgner <felix.morgner@gmail.com>2020-01-02 13:32:50 +0100
committerFelix Morgner <felix.morgner@gmail.com>2020-01-02 13:32:50 +0100
commit6193bb8546f743f43dfc2b0fd1014a72ab356e4d (patch)
tree8449ee4f7cceec0621c5e0e82628889933ab4f2d
parent9a5d11d4c5701c8ad2e6aa1213cc9fd2937ccbc4 (diff)
downloadnewtype-6193bb8546f743f43dfc2b0fd1014a72ab356e4d.tar.xz
newtype-6193bb8546f743f43dfc2b0fd1014a72ab356e4d.zip
new_type: fix compound-add unit tests
-rw-r--r--test/src/arithmetic_suite.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/test/src/arithmetic_suite.cpp b/test/src/arithmetic_suite.cpp
index 5d760d2..7de76d6 100644
--- a/test/src/arithmetic_suite.cpp
+++ b/test/src/arithmetic_suite.cpp
@@ -215,10 +215,10 @@ inline namespace compound_addition
-> void
{
using type_alias = nt::new_type<int, struct tag, deriving(nt::Arithmetic)>;
- auto lhs = type_alias{24};
- auto rhs = type_alias{18};
auto elhs = 42;
auto erhs = 18;
+ auto lhs = type_alias{elhs};
+ auto rhs = type_alias{erhs};
ASSERT_EQUAL(elhs += erhs, (lhs += rhs).decay());
}
@@ -259,6 +259,11 @@ auto arithmetic_suite() -> std::pair<cute::suite, std::string>
KAWAII(a_new__type_deriving_arithmetic_is_dividable_with_instances_of_itself_if_the_base_type_is_dividable<dividable_type>),
KAWAII(division_of_two_instances_of_a_new__type_deriving_arithmetic_produces_an_instance_of_the_same_new__type),
KAWAII(division_of_two_instances_of_a_new__type_deriving_arithmetic_produces_the_correct_value_with_respect_to_the_base_type),
+
+ /// Compound Addition Tests
+ KAWAII(addition_assignment_of_two_instances_of_a_new__type_deriving_arithmetic_produces_an_instance_of_the_same_new__type),
+ KAWAII(
+ addition_assignment_of_two_instances_of_a_new__type_deriving_arithmetic_produces_the_correct_value_with_respect_to_the_base_type),
},
"Arithmetic Operators Tests"};
} \ No newline at end of file