Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
self.assertEqual([3, 4], diff([1, 2], [3, 4]))
self.assertEqual((3, 4), diff((1, 2), (3, 4)))
self.assertEqual({3, 4}, diff({1, 2}, {3, 4}))
self.assertEqual({replace: {'c': 3, 'd': 4}}, diff({'a': 1, 'b': 2}, {'c': 3, 'd': 4}))
self.assertEqual({replace: {'c': 3, 'd': 4}}, diff([1, 2], {'c': 3, 'd': 4}))
self.assertEqual(123, diff({'a': 1, 'b': 2}, 123))
self.assertEqual({delete: ['b']}, diff({'a': 1, 'b': 2}, {'a': 1}))
self.assertEqual({'b': 3}, diff({'a': 1, 'b': 2}, {'a': 1, 'b': 3}))
self.assertEqual({'c': 3}, diff({'a': 1, 'b': 2}, {'a': 1, 'b': 2, 'c': 3}))
self.assertEqual({delete: ['b'], 'c': 3}, diff({'a': 1, 'b': 2}, {'a': 1, 'c': 3}))
self.assertEqual({add: {3}}, diff({1, 2}, {1, 2, 3}))
self.assertEqual({add: {3}, discard: {4}}, diff({1, 2, 4}, {1, 2, 3}))
self.assertEqual({discard: {4}}, diff({1, 2, 4}, {1, 2}))
self.assertEqual({insert: [(1, 'b')]}, diff(['a', 'c'], ['a', 'b', 'c']))
self.assertEqual({insert: [(1, 'b')], delete: [3, 0]}, diff(['x', 'a', 'c', 'x'], ['a', 'b', 'c']))
self.assertEqual(
{insert: [(2, 'b')], delete: [4, 0], 1: {'v': 20}},
diff(['x', 'a', {'v': 11}, 'c', 'x'], ['a', {'v': 20}, 'b', 'c'])
)
self.assertEqual(
{insert: [(2, 'b')], delete: [4, 0], 1: {'v': 20}},
diff(['x', 'a', {'u': 10, 'v': 11}, 'c', 'x'], ['a', {'u': 10, 'v': 20}, 'b', 'c'])
)