403Webshell
Server IP : 123.56.80.60  /  Your IP : 216.73.216.78
Web Server : Apache/2.4.54 (Win32) OpenSSL/1.1.1s PHP/7.4.33 mod_fcgid/2.3.10-dev
System : Windows NT iZhx3sob14hnz7Z 10.0 build 14393 (Windows Server 2016) i586
User : SYSTEM ( 0)
PHP Version : 7.4.33
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  C:/Program Files/python/Lib/site-packages/Cython/Build/Tests/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : C:/Program Files/python/Lib/site-packages/Cython/Build/Tests//TestStripLiterals.py
from Cython.Build.Dependencies import strip_string_literals

from Cython.TestUtils import CythonTest

class TestStripLiterals(CythonTest):

    def t(self, before, expected):
        actual, literals = strip_string_literals(before, prefix="_L")
        self.assertEqual(expected, actual)
        for key, value in literals.items():
            actual = actual.replace(key, value)
        self.assertEqual(before, actual)

    def test_empty(self):
        self.t("", "")

    def test_single_quote(self):
        self.t("'x'", "'_L1_'")

    def test_double_quote(self):
        self.t('"x"', '"_L1_"')

    def test_nested_quotes(self):
        self.t(""" '"' "'" """, """ '_L1_' "_L2_" """)

    def test_triple_quote(self):
        self.t(" '''a\n''' ", " '''_L1_''' ")

    def test_backslash(self):
        self.t(r"'a\'b'", "'_L1_'")
        self.t(r"'a\\'", "'_L1_'")
        self.t(r"'a\\\'b'", "'_L1_'")

    def test_unicode(self):
        self.t("u'abc'", "u'_L1_'")

    def test_raw(self):
        self.t(r"r'abc\\'", "r'_L1_'")

    def test_raw_unicode(self):
        self.t(r"ru'abc\\'", "ru'_L1_'")

    def test_comment(self):
        self.t("abc # foo", "abc #_L1_")

    def test_comment_and_quote(self):
        self.t("abc # 'x'", "abc #_L1_")
        self.t("'abc#'", "'_L1_'")

    def test_include(self):
        self.t("include 'a.pxi' # something here",
               "include '_L1_' #_L2_")

    def test_extern(self):
        self.t("cdef extern from 'a.h': # comment",
               "cdef extern from '_L1_': #_L2_")


Youez - 2016 - github.com/yon3zu
LinuXploit