diff options
| author | Lexi Winter <lexi@le-fay.org> | 2025-06-22 18:18:44 +0100 |
|---|---|---|
| committer | Lexi Winter <lexi@le-fay.org> | 2025-06-22 18:18:44 +0100 |
| commit | 639b270eed81f7c2627d810057d188e2e8ee67f9 (patch) | |
| tree | 7b8f7628b799dba307f06cf813583d42bdc1838a /nihil.ucl/tests/array.cc | |
| parent | 09b7a494bd5de24f380095003fb7da4939de43e5 (diff) | |
| download | nihil-639b270eed81f7c2627d810057d188e2e8ee67f9.tar.gz nihil-639b270eed81f7c2627d810057d188e2e8ee67f9.tar.bz2 | |
nihil.ucl: improve construction and comparison
Diffstat (limited to 'nihil.ucl/tests/array.cc')
| -rw-r--r-- | nihil.ucl/tests/array.cc | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/nihil.ucl/tests/array.cc b/nihil.ucl/tests/array.cc index a4f26b6..ce86058 100644 --- a/nihil.ucl/tests/array.cc +++ b/nihil.ucl/tests/array.cc @@ -31,9 +31,9 @@ TEST_CASE("ucl: array: push_back", "[ucl]") arr.push_back(integer(666)); REQUIRE(arr.size() == 3); - REQUIRE(arr[0].value() == 1); - REQUIRE(arr[1].value() == 42); - REQUIRE(arr[2].value() == 666); + REQUIRE(arr[0] == 1); + REQUIRE(arr[1] == 42); + REQUIRE(arr[2] == 666); REQUIRE_THROWS_AS(arr[3], std::out_of_range); @@ -46,22 +46,22 @@ TEST_CASE("ucl: array: compare", "[ucl]") using namespace nihil::ucl; auto arr = array<integer>(); - arr.push_back(1); - arr.push_back(42); - arr.push_back(666); + arr.push_back(integer(1)); + arr.push_back(integer(42)); + arr.push_back(integer(666)); auto arr2 = array<integer>(); REQUIRE(arr != arr2); - arr2.push_back(1); - arr2.push_back(42); - arr2.push_back(666); + arr2.push_back(integer(1)); + arr2.push_back(integer(42)); + arr2.push_back(integer(666)); REQUIRE(arr == arr2); auto arr3 = array<integer>(); - arr3.push_back(1); - arr3.push_back(1); - arr3.push_back(1); + arr3.push_back(integer(1)); + arr3.push_back(integer(1)); + arr3.push_back(integer(1)); REQUIRE(arr != arr3); } @@ -69,7 +69,7 @@ TEST_CASE("ucl: array: iterator", "[ucl]") { using namespace nihil::ucl; - auto arr = array<integer>{1, 42, 666}; + auto arr = array<integer>{integer(1), integer(42), integer(666)}; auto it = arr.begin(); REQUIRE(*it == 1); @@ -129,7 +129,7 @@ TEST_CASE("ucl: array is a sized_range", "[ucl]") { using namespace nihil::ucl; - auto arr = array<integer>{1, 42, 666}; + auto arr = array<integer>{integer(1), integer(42), integer(666)}; static_assert(std::ranges::sized_range<decltype(arr)>); auto size = std::ranges::size(arr); |
