You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Part of #41. Depends on #43. Write GoogleTest tests for every page in: docs/examples/algorithms, ranges, iterators, utilities, concepts.
One tests/<area>/<page>_test.cpp per page; test names reference the page section (TEST(Vector, ReserveDoesNotChangeSize)).
Every concrete claim on the page becomes an assertion: documented output (capture and EXPECT_EQ), values in comments, static_assert for type/trait claims, EXPECT_THROW for documented exceptions, invalidation and complexity claims where observable.
Implementation-defined behaviour: assert per toolchain or GTEST_SKIP with the reason. Missing library features: skip via feature-test macros, never silently drop.
If a test shows a page is wrong, fix the page in the same PR and list each fix.
Run on GCC 15 and Clang 22 + libc++; C++26 tests on Docker GCC 16.
Acceptance: every page in these folders has a test file; all presets green or skipped with reasons; page fixes listed in the PR.
tests/algorithms/: new tests for execution-and-ranges, modifying, non-modifying, numeric and partition-heap-minmax. sorting-searching_test.cpp is extended from 4 to 11 tests. They cover:
results on each page's own inputs
complexity, by counting comparisons: nth_element is linear, lower_bound logarithmic, make_heap at most 3n
stability of stable_sort and stable_partition
the dangling and projection claims
"won't compile" claims, as negated concepts
a death test showing that an exception thrown from an element op terminates
tests/ranges/: new tests for factories and range-concepts. views_test.cpp is extended from 3 to 13 tests and covers laziness, filter_view caching begin(), and the C++23 adaptors.
tests/iterators/: new tests for adaptors and categories. operations_test.cpp is extended from 5 to 8 tests; the new ones check how many steps advance takes per category and that stream iterators consume their input.
tests/concepts/standard-concepts_test.cpp is extended from 3 to 9 tests.
tests/utilities/: new tests for any, bitset, expected, functional, pair, tuple, utility and variant. optional_test.cpp is extended from 5 to 9 tests.
Page fixes:
algorithms/execution-and-ranges.md: an exception thrown from an element op calls std::terminate under every standard policy, seq included, not only the parallel ones.
algorithms/sorting-searching.md: partial_sort sorts the 10 smallest, not the "top 10".
ranges/views.md: the Gotchas bullet now names the C++23 adaptors that libc++ in Clang 22 still lacks.
utilities/bitset.md: the to_string() comment had a wrong value. It is now "11100101".
Why
This covers the whole issue: every page in the five folders has a test file, and every concrete claim is an assertion. That includes the observable stability and complexity claims.
Run with tools/run_tests.sh after rebasing on origin/main. On gcc-15, clang-22 and gcc-16 (Docker) the summary line was 100% tests passed, 0 tests failed out of 270.
On clang-22 / libc++, features the library lacks skip and name the macro: __cpp_lib_execution, __cpp_lib_parallel_algorithm, __cpp_lib_move_only_function, and __cpp_lib_ranges_{enumerate,chunk,stride,as_const}.
The snippet checker against the baseline exits 0.
Still open
Some claims are hard compile errors that a requires expression can't detect: get<T> with a repeated type, a visitor that doesn't handle every alternative, and std::function from a move-only callable. I checked them by hand only.
Toolchain-dependent claims are not asserted: floating-point reordering by reduce, small-buffer and allocation behaviour, and the parallel backend.
Activity
homer6 commentedon Oct 31, 2026
Delivered in #67.
What changed
tests/algorithms/: new tests forexecution-and-ranges,modifying,non-modifying,numericandpartition-heap-minmax.sorting-searching_test.cppis extended from 4 to 11 tests. They cover:nth_elementis linear,lower_boundlogarithmic,make_heapat most 3nstable_sortandstable_partitiondanglingand projection claimstests/ranges/: new tests forfactoriesandrange-concepts.views_test.cppis extended from 3 to 13 tests and covers laziness,filter_viewcachingbegin(), and the C++23 adaptors.tests/iterators/: new tests foradaptorsandcategories.operations_test.cppis extended from 5 to 8 tests; the new ones check how many stepsadvancetakes per category and that stream iterators consume their input.tests/concepts/standard-concepts_test.cppis extended from 3 to 9 tests.tests/utilities/: new tests forany,bitset,expected,functional,pair,tuple,utilityandvariant.optional_test.cppis extended from 5 to 9 tests.algorithms/execution-and-ranges.md: an exception thrown from an element op callsstd::terminateunder every standard policy,seqincluded, not only the parallel ones.algorithms/sorting-searching.md:partial_sortsorts the 10 smallest, not the "top 10".ranges/views.md: the Gotchas bullet now names the C++23 adaptors that libc++ in Clang 22 still lacks.utilities/bitset.md: theto_string()comment had a wrong value. It is now"11100101".Why
tools/run_tests.shafter rebasing onorigin/main. On gcc-15, clang-22 and gcc-16 (Docker) the summary line was100% tests passed, 0 tests failed out of 270.__cpp_lib_execution,__cpp_lib_parallel_algorithm,__cpp_lib_move_only_function, and__cpp_lib_ranges_{enumerate,chunk,stride,as_const}.Still open
requiresexpression can't detect:get<T>with a repeated type, a visitor that doesn't handle every alternative, andstd::functionfrom a move-only callable. I checked them by hand only.reduce, small-buffer and allocation behaviour, and the parallel backend.bitset.md,pair.mdandany.md. Their tests may need updating after it lands.homer6 commentedon Oct 31, 2026
Merged in #67 (d98d733) on the owner's approval.
What changed
main. No other changes.Why
Still open