Skip to content

Commit

Permalink
Test computation of added and removed entries
Browse files Browse the repository at this point in the history
  • Loading branch information
laschuet committed May 11, 2020
1 parent 82e2324 commit 41cc4e3
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions test/namedtuple.jl
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,15 @@
a = (x=1,)
b = (x=(s=1, t=2),)
c = (x=[1 2],)
d = (x=2, y=1)
# e = (x=[1, 2],)

@test diff(a, a) == ((x=0,), NamedTuple(), NamedTuple())
@test diff(b, b) == ((x=((s=0, t=0), NamedTuple(), NamedTuple()),),
NamedTuple(), NamedTuple())
@test diff(c, c) == ((x=([0 0], [], []),), NamedTuple(), NamedTuple())

@test diff(a, d) == ((x=-1,), (y=1,), NamedTuple())
@test diff(d, a) == ((x=1,), NamedTuple(), (y=1,))
end
end

0 comments on commit 41cc4e3

Please sign in to comment.