@@ -1848,11 +1848,19 @@ def test_merge(self):
18481848 frozendict ({'x' : 1 , 'y' : 2 }))
18491849 self .assertEqual (frozendict (x = 1 , y = 2 ) | frozendict (y = 5 ),
18501850 frozendict ({'x' : 1 , 'y' : 5 }))
1851+ self .assertEqual (FrozenDict (x = 1 , y = 2 ) | FrozenDict (y = 5 ),
1852+ frozendict ({'x' : 1 , 'y' : 5 }))
1853+
18511854 fd = frozendict (x = 1 , y = 2 )
18521855 self .assertIs (fd | frozendict (), fd )
18531856 self .assertIs (fd | {}, fd )
18541857 self .assertIs (frozendict () | fd , fd )
18551858
1859+ fd = FrozenDict (x = 1 , y = 2 )
1860+ self .assertEqual (fd | frozendict (), fd )
1861+ self .assertEqual (fd | {}, fd )
1862+ self .assertEqual (frozendict () | fd , fd )
1863+
18561864 def test_update (self ):
18571865 # test "a |= b" operator
18581866 d = frozendict (x = 1 )
@@ -1863,6 +1871,11 @@ def test_update(self):
18631871 self .assertEqual (d , frozendict ({'x' : 1 , 'y' : 2 }))
18641872 self .assertEqual (copy , frozendict ({'x' : 1 }))
18651873
1874+ def test_items_xor (self ):
1875+ # test "a ^ b" operator on items views
1876+ res = frozendict (a = 1 , b = 2 ).items () ^ frozendict (b = 2 , c = 3 ).items ()
1877+ self .assertEqual (res , {('a' , 1 ), ('c' , 3 )})
1878+
18661879 def test_repr (self ):
18671880 d = frozendict ()
18681881 self .assertEqual (repr (d ), "frozendict()" )
0 commit comments