mirror of
https://github.com/facebook/sapling.git
synced 2024-10-12 01:39:21 +03:00
ae0a81f2c2
Summary: Move all Rust bindings to a single python extension, `bindings`. This should improve compilation time and make things simpler. Reviewed By: quark-zju Differential Revision: D13923866 fbshipit-source-id: 560592b5a6c0c4f1b836c755ef123666a1059164
25 lines
568 B
Python
25 lines
568 B
Python
from __future__ import absolute_import
|
|
|
|
import os
|
|
import unittest
|
|
|
|
import silenttestrunner
|
|
from edenscm.mercurial.rust.bindings import zstd
|
|
|
|
|
|
class testzstd(unittest.TestCase):
|
|
def testdelta(self):
|
|
base = os.urandom(100000)
|
|
data = base[:1000] + "x" + base[1000:90000] + base[90500:]
|
|
delta = zstd.diff(base, data)
|
|
|
|
# The delta is tiny
|
|
self.assertLess(len(delta), 100)
|
|
|
|
# The delta can be applied
|
|
self.assertEqual(zstd.apply(base, delta), data)
|
|
|
|
|
|
if __name__ == "__main__":
|
|
silenttestrunner.main(__name__)
|