mirror of
https://github.com/facebook/sapling.git
synced 2024-12-29 16:12:23 +03:00
467f4aef45
Summary: Ran ./run-tests.py --json and used the following script: import json import subprocess with open("report.json", "r") as f: tests = json.load(f) for name, t in tests.items(): if t["result"] == "success": print("%s successful" % name) subprocess.run("sed -i '/#require py2/d' %s" % name, shell=True) subprocess.run("sed -i '/require.*py2/d' %s" % name, shell=True) Reviewed By: singhsrb Differential Revision: D19664298 fbshipit-source-id: fa67c7c7abd110c9f0df9345daf09f2792aacd44
42 lines
1.1 KiB
Python
42 lines
1.1 KiB
Python
from __future__ import absolute_import
|
|
|
|
import unittest
|
|
|
|
from edenscm.mercurial import encoding
|
|
from hghave import require
|
|
|
|
|
|
class IsasciistrTest(unittest.TestCase):
|
|
asciistrs = [b"a", b"ab", b"abc", b"abcd", b"abcde", b"abcdefghi", b"abcd\0fghi"]
|
|
|
|
def testascii(self):
|
|
for s in self.asciistrs:
|
|
self.assertTrue(encoding.isasciistr(s))
|
|
|
|
def testnonasciichar(self):
|
|
for s in self.asciistrs:
|
|
for i in range(len(s)):
|
|
t = bytearray(s)
|
|
t[i] |= 0x80
|
|
self.assertFalse(encoding.isasciistr(bytes(t)))
|
|
|
|
|
|
class LocalEncodingTest(unittest.TestCase):
|
|
def testasciifastpath(self):
|
|
s = b"\0" * 100
|
|
self.assertTrue(s is encoding.tolocal(s))
|
|
self.assertTrue(s is encoding.fromlocal(s))
|
|
|
|
|
|
class Utf8bEncodingTest(unittest.TestCase):
|
|
def testasciifastpath(self):
|
|
s = b"\0" * 100
|
|
self.assertTrue(s is encoding.toutf8b(s))
|
|
self.assertTrue(s is encoding.fromutf8b(s))
|
|
|
|
|
|
if __name__ == "__main__":
|
|
import silenttestrunner
|
|
|
|
silenttestrunner.main(__name__)
|