Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/std23 repeat #42

Merged
merged 7 commits into from
Sep 2, 2024
Merged

Feature/std23 repeat #42

merged 7 commits into from
Sep 2, 2024

Conversation

joewpeterson
Copy link
Contributor

No description provided.

CHECK(RepeatedInt.size() == boundLimit);
for (int i : RepeatedInt){
CHECK(i == repeated);
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would like to see tests for the concepts that the view needs to satisfy:

        CHECK( std20::ranges::viewable_range< Range > );

        CHECK( std20::ranges::range< Range > );
        CHECK( std20::ranges::view< Range > );
        CHECK( std20::ranges::sized_range< Range > );
        CHECK( std20::ranges::forward_range< Range > );
        CHECK( std20::ranges::bidirectional_range< Range > );
        CHECK( std20::ranges::random_access_range< Range > );
        CHECK( ! std20::ranges::contiguous_range< Range > );
        CHECK( std20::ranges::common_range< Range > );

and tests for the remainder of the view interface. like this:

        CHECK( 5 == chunk.size() );

        CHECK( false == chunk.empty() );
        CHECK( true == bool( chunk ) );

        CHECK( std20::ranges::equal( equal, chunk ) );

        CHECK( equal[0] == chunk.front() );
        CHECK( equal[4] == chunk.back() );

        CHECK( 1 == chunk[0] );
        CHECK( 3 == chunk[1] );
        CHECK( 5 == chunk[2] );
        CHECK( 7 == chunk[3] );
        CHECK( 9 == chunk[4] );

All other views have tests like these to ensure the views function appropriately.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Random access issue is fixed with inclusion of >= and <= operators. Pushing this shortly.

Size Checks are already being done with bound limits with lines like
CHECK(RepeatedInt.size() == boundLimit);
and with unbound limits with
CHECK( std20::same_as<std::remove_cv_t<decltype(std20::unreachable_sentinel)>, decltype(RepeatedInt.end())>);

Adding to use case test an unbound example as well. Pushing shortly:

@whaeck
Copy link
Member

whaeck commented Aug 26, 2024

I added a use case in the use case test and it seems repeat is not a random access range. I believe it should be.

Adding >= and <= operators to make repeat random access. Adding unbound
float type test to use case test. Removing enabled borrow range
Copy link
Member

@whaeck whaeck left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The random access issue is fixed. I'll do a follow up to clean up and add the missing concept tests and view_interface function tests, as well as moving the zip and zip_transform out of production code. After that, we can look at releasing a new version and update ENDFtk.

@whaeck whaeck merged commit 194d3b7 into develop Sep 2, 2024
8 checks passed
@whaeck whaeck deleted the feature/std23-repeat branch September 2, 2024 16:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants