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

test() ignores S4-ness of columns #6185

Open
MichaelChirico opened this issue Jun 16, 2024 · 0 comments
Open

test() ignores S4-ness of columns #6185

MichaelChirico opened this issue Jun 16, 2024 · 0 comments
Labels
non-atomic column e.g. list columns, S4 vector columns tests

Comments

@MichaelChirico
Copy link
Member

Seen during testing of #6183

test(1, 1:10, asS4(1:10)) # passes
cat(sprintf("%s; %s\n", isS4(1:10), isS4(asS4(1:10))))
# FALSE; TRUE

Not sure we should do anything about it; in particular, we're getting this behavior from base itself:

all.equal(1:10, asS4(1:10))
# [1] TRUE

And while it's easy to do isS4() ourselves on a non-recursive object, recursively checking isS4() (e.g. on all data.table columns, or on nested list inputs) seems more trouble than it's worth.

Filing here in case others feel strongly one way or the other.

@MichaelChirico MichaelChirico added tests non-atomic column e.g. list columns, S4 vector columns labels Jun 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
non-atomic column e.g. list columns, S4 vector columns tests
Projects
None yet
Development

No branches or pull requests

1 participant