-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
delete for NamedTuples #27725
delete for NamedTuples #27725
Changes from 9 commits
e747501
fdd3a98
a239411
36af455
e33cea2
fc46f7a
0338959
0bc6e80
354d543
cf160bb
ec186c5
524bc8b
65aac32
db79715
14dbfd2
292d88e
619fe4c
3606bec
d43cf81
99a3d20
be15cc1
a4abb90
2f37e71
308deb6
e1ae2de
86a4b12
5226c03
ea3aeae
4704588
2202264
b10fced
6f6f25b
993cc2b
54198b3
14d0b46
5559d8e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -482,6 +482,7 @@ export | |
firstindex, | ||
collect, | ||
count, | ||
delete, | ||
delete!, | ||
deleteat!, | ||
eltype, | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -201,6 +201,15 @@ end | |
abstr_nt_22194_3() | ||
@test Base.return_types(abstr_nt_22194_3, ()) == Any[Any] | ||
|
||
@test Base.delete((a=1, b=2), (:b,)) == (a=1,) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think I read that the result here should be inferrable? If so, should these test also check that? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How do I test that? Guessed this for that. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also |
||
@test Base.delete((a=1, b=2), (:a,)) == (b=2,) | ||
@test Base.delete((a=1, b=2, z=20), (:b,)) == (a=1, z=20) | ||
@test Base.delete((a=1, b=2, z=20), (:b, :q, :z)) == (a=1,) | ||
@test Base.delete((a=1, b=2, z=20), (:b, :q, :z, :a)) == NamedTuple() | ||
@test Base.delete((a=1, b=2), :b) == (a=1,) | ||
@test Base.delete((a=1, b=2), :a) == (b=2,) | ||
@test Base.delete((a=1, b=2), :z) == (a=1, b=2) | ||
|
||
@test Base.structdiff((a=1, b=2), (b=3,)) == (a=1,) | ||
@test Base.structdiff((a=1, b=2, z=20), (b=3,)) == (a=1, z=20) | ||
@test Base.structdiff((a=1, b=2, z=20), (b=3, q=20, z=1)) == (a=1,) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps
copy
doesn't have to be mentioned since tuples are immutable?