Skip to content

Commit

Permalink
Add xtd::array unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
gammasoft71 committed Sep 10, 2024
1 parent e4038a1 commit 8d9ab37
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tests/xtd.core.unit_tests/src/xtd/tests/array_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -494,6 +494,12 @@ namespace xtd::tests {
assert::are_equal(5, items.get_value(array_ {4_z}), csf_);
assert::throws<index_out_of_range_exception>([&]{[[maybe_unused]] auto i = items.get_value(array_ {5_z});}, csf_);
}

void test_method_(index_of_with_value_type) {
auto items = array_ {84, 42, 21, 42};
assert::are_equal(1_z, items.index_of(42), csf_);
assert::are_equal(items.npos, items.index_of(0), csf_);
}

void test_method_(resize) {
auto items = array_<int> {};
Expand Down

0 comments on commit 8d9ab37

Please sign in to comment.