Skip to content

Commit

Permalink
test suggestions from jw3126
Browse files Browse the repository at this point in the history
  • Loading branch information
kescobo committed Jan 13, 2021
1 parent 6978d68 commit 0539fbb
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions test/namedtuple.jl
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,16 @@
# or keep separate, eg:
@test (x=4, y=5, z=6)[[:x, :y]] == (x=4, y=5)
@test (x=4, y=5, z=6)[[:x]] == (x=4,)
@test (x=4, y=5, z=6)[()] == NamedTuple()
@test NamedTuple()[()] == NamedTuple()
@test_throws ErrorException (x=4, y=5, z=6).a
@test_throws BoundsError (a=2,)[0]
@test_throws BoundsError (a=2,)[2]
@test_throws ErrorException (x=4, y=5, z=6)[(:a,)]
@test_throws ErrorException (x=4, y=5, z=6)[(:x, :a)]
@test_throws ErrorException (x=4, y=5, z=6)[[:a]]
@test_throws ErrorException (x=4, y=5, z=6)[[:x, :a]]
@test_throws ErrorException (x=4, y=5, z=6)[(:x, :x)]

@test length(NamedTuple()) == 0
@test length((a=1,)) == 1
Expand Down

0 comments on commit 0539fbb

Please sign in to comment.