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

Add r_dyn_raw_push_back() and r_dyn_chr_push_back() #1699

Merged
merged 3 commits into from
Apr 5, 2024

Conversation

DavisVaughan
Copy link
Member

Added 2 missing push-back helpers.

In #1542 I optimized the push-back API by separating it from the generic r_dyn_push_back() helper. This was nice, but it left the typed push back API untested. In addition to adding those 2 missing helpers, this PR also adds the missing tests for the typed API.

Comment on lines 1007 to 1013
arr <- new_dyn_vector("logical", 3)
dyn_push_back(arr, TRUE)
dyn_lgl_push_back(arr, TRUE)
expect_equal(dyn_lgl_get(arr, 0L), TRUE)
expect_equal(dyn_lgl_get(arr, 1L), TRUE)
dyn_lgl_poke(arr, 0L, FALSE)
expect_equal(dyn_lgl_get(arr, 0L), FALSE)
Copy link
Member Author

Choose a reason for hiding this comment

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

Each test here tested the generic push API, the poke API, and the get API for each type. I've just extended these tests to also test the typed push API

@DavisVaughan DavisVaughan requested a review from lionel- March 28, 2024 20:13
@DavisVaughan
Copy link
Member Author

Test failures seem unrelated but definitely worth taking a look at, as it seems important?

Copy link
Member

@lionel- lionel- left a comment

Choose a reason for hiding this comment

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

I've fixed the failures on main!

@DavisVaughan DavisVaughan force-pushed the feature/dyn-chr-push branch from b542de6 to 6172b94 Compare April 5, 2024 14:13
@DavisVaughan DavisVaughan merged commit 65018f9 into r-lib:main Apr 5, 2024
12 checks passed
@DavisVaughan DavisVaughan deleted the feature/dyn-chr-push branch April 5, 2024 14:58
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