Skip to content

Commit 5c6be15

Browse files
cmcainembauman
andauthored
Update test/namedtuple.jl
Co-Authored-By: Matt Bauman <[email protected]>
1 parent 71ad192 commit 5c6be15

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

test/namedtuple.jl

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,14 @@
2525
@test (x=4, y=5, z=6)[1:2] == (x=4, y=5)
2626
@test (x=4, y=5, z=6)[[1,3]] == (x=4, z=6)
2727
@test (x=4, y=5, z=6)[[:x,:y]] == (x=4, y=5)
28+
@test (x=4, y=5, z=6)[[true, true, false]] == (x=4, y=5)
29+
@test (x=4, y=5, z=6)[[true, true, true]] == (x=4, y=5, z=6)
30+
@test (x=4, y=5, z=6)[[false, false, false]] == NamedTuple()
31+
@test (x=4, y=5, z=6)[Int[]] == NamedTuple()
32+
@test_throws BoundsError (x=4, y=5, z=6)[[true, true]]
33+
@test_throws ArgumentError (x=4, y=5, z=6)[true]
34+
@test (x=4, y=5, z=6)[0x01] == (x=4, y=5, z=6)[Int16(1)] == 4
35+
@test (x=4, y=5, z=6)[0x01:0x01] == (x=4, y=5, z=6)[[Int16(1)]] == (x=4,)
2836
@test_throws ErrorException (x=4, y=5, z=6).a
2937
@test_throws BoundsError (a=2,)[0]
3038
@test_throws BoundsError (a=2,)[2]

0 commit comments

Comments
 (0)