o
    9|äa	X  ã                   @   sL   d dl Z d dlZG dd„ de jƒZG dd„ de jƒZedkr$e  ¡  dS dS )é    Nc                   @   sL  e Zd Zdd„ Zdd„ Zdd„ Zdd„ Zd	d
„ Zdd„ Zdd„ Z	dd„ Z
dd„ Zdd„ Zdd„ Zdd„ Zdd„ Zdd„ Zdd„ Zdd „ Zd!d"„ Zd#d$„ Zd%d&„ Zd'd(„ Zd)d*„ Zd+d,„ Zd-d.„ Zd/d0„ Zd1d2„ Zd3d4„ Zd5d6„ Zd7d8„ Zd9d:„ Zd;d<„ Z d=d>„ Z!d?d@„ Z"dAdB„ Z#dCdD„ Z$dEdF„ Z%dGdH„ Z&dIdJ„ Z'dKdL„ Z(dMdN„ Z)dOdP„ Z*dQdR„ Z+dSdT„ Z,dUdV„ Z-dWdX„ Z.dYdZ„ Z/d[d\„ Z0d]d^„ Z1d_d`„ Z2dadb„ Z3dcdd„ Z4dedf„ Z5dgdh„ Z6didj„ Z7dkdl„ Z8dmdn„ Z9dodp„ Z:dqdr„ Z;dsdt„ Z<dudv„ Z=dwdx„ Z>dydz„ Z?d{d|„ Z@d}d~„ ZAdd€„ ZBd�d‚„ ZCdƒd„„ ZDd…d†„ ZEd‡dˆ„ ZFd‰dŠ„ ZGd‹dŒ„ ZHd�dŽ„ ZId�d�„ ZJd‘S )’ÚJsTestsc                 C   s
   t   |¡S )N©Újsmin©ÚselfÚjs© r   ú</var/www/html/env/lib/python3.10/site-packages/jsmin/test.pyÚ_minify!   s   
zJsTests._minifyc                 C   s"   ||krt t|ƒt|ƒƒ t‚dS )NT)ÚprintÚreprÚAssertionError)r   Úthing1Úthing2r   r   r	   ÚassertEqual$   s   zJsTests.assertEqualc                 K   s.   t j |fi |¤Ž}||ksJ d||f ƒ‚d S )Nz
got: %r
exp: %rr   )r   Újs_inputÚexpectedÚkwargsÚminifiedr   r   r	   ÚassertMinified*   s   zJsTests.assertMinifiedc                 C   ó   d}d}|   ||¡ d S )Na\  
        Object.extend(String, {
          interpret: function(value) {
            return value == null ? '' : String(value);
          },
          specialChar: {
            '\b': '\\b',
            '\t': '\\t',
            '\n': '\\n',
            '\f': '\\f',
            '\r': '\\r',
            '\\': '\\\\'
          }
        });

        z©Object.extend(String,{interpret:function(value){return value==null?'':String(value);},specialChar:{'\b':'\\b','\t':'\\t','\n':'\\n','\f':'\\f','\r':'\\r','\\':'\\\\'}});©r   ©r   r   r   r   r   r	   Ú
testQuoted.   s   zJsTests.testQuotedc                 C   r   )Na½  // use native browser JS 1.6 implementation if available
        if (Object.isFunction(Array.prototype.forEach))
          Array.prototype._each = Array.prototype.forEach;

        if (!Array.prototype.indexOf) Array.prototype.indexOf = function(item, i) {

        // hey there
        function() {// testing comment
        foo;
        //something something

        location = 'http://foo.com;';   // goodbye
        }
        //bye
        zÍif(Object.isFunction(Array.prototype.forEach))
Array.prototype._each=Array.prototype.forEach;if(!Array.prototype.indexOf)Array.prototype.indexOf=function(item,i){function(){foo;location='http://foo.com;';}r   r   r   r   r	   ÚtestSingleCommentB   s   zJsTests.testSingleCommentc                 C   s@   |   dd¡ |   dd¡ |   dd¡ |   dd¡ |   dd¡ d S )NÚ ú Ú
z
ú	r   ©r   r   r   r	   Ú	testEmptyV   s
   zJsTests.testEmptyc                 C   r   )Na.  
        function foo() {
            print('hey');
        }
        /*
        if(this.options.zindex) {
          this.originalZ = parseInt(Element.getStyle(this.element,'z-index') || 0);
          this.element.style.zIndex = this.options.zindex;
        }
        */
        another thing;
        z,function foo(){print('hey');}
another thing;r   r   r   r   r	   ÚtestMultiComment^   s   zJsTests.testMultiCommentc                 C   r   )Nz�/* here is a comment at the top
        
        it ends here */
        function foo() {
            alert('crud');
        }
        
        zfunction foo(){alert('crud');}r   r   r   r   r	   ÚtestLeadingCommento   s   zJsTests.testLeadingCommentc                 C   ó   |   dd¡ d S )NzA; /*/ comment */ BúA;Br   r   r   r   r	   Ú!testBlockCommentStartingWithSlash{   ó   z)JsTests.testBlockCommentStartingWithSlashc                 C   r#   )NzA; /* comment /*/ Br$   r   r   r   r   r	   ÚtestBlockCommentEndingWithSlash~   r&   z'JsTests.testBlockCommentEndingWithSlashc                 C   r#   )Nz/*/ comment */ AÚAr   r   r   r   r	   Ú(testLeadingBlockCommentStartingWithSlash�   r&   z0JsTests.testLeadingBlockCommentStartingWithSlashc                 C   r#   )Nz/* comment /*/ Ar(   r   r   r   r   r	   Ú&testLeadingBlockCommentEndingWithSlash„   r&   z.JsTests.testLeadingBlockCommentEndingWithSlashc                 C   r#   )Nz/**/ Ar(   r   r   r   r   r	   ÚtestEmptyBlockComment‡   r&   zJsTests.testEmptyBlockCommentc                 C   r#   )Nz/* A /* B */ CÚCr   r   r   r   r	   ÚtestBlockCommentMultipleOpenŠ   r&   z$JsTests.testBlockCommentMultipleOpenc                 C   r#   )Nz     // a commentr   r   r   r   r   r	   ÚtestJustAComment�   r&   zJsTests.testJustACommentc                 C   r   )Nz\
        files = [{name: value.replace(/^.*\\/, '')}];
        // comment
        A
        z*files=[{name:value.replace(/^.*\\/,'')}];Ar   r   r   r   r	   Útest_issue_bitbucket_10�   ó   zJsTests.test_issue_bitbucket_10c                 C   r   )Nz[
        files = [{name: value.replace(/^.*\\/, '')}]
        // comment
        A
        z*files=[{name:value.replace(/^.*\\/,'')}]
Ar   r   r   r   r	   Ú)test_issue_bitbucket_10_without_semicolon™   r0   z1JsTests.test_issue_bitbucket_10_without_semicolonc                 C   r   )Nzœ  
        var str = this.replace(/\\./g, '@').replace(/"[^"\\\n\r]*"/g, '');
        return (/^[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]*$/).test(str);
        });zzvar str=this.replace(/\\./g,'@').replace(/"[^"\\\n\r]*"/g,'');return(/^[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]*$/).test(str);});r   r   r   r   r	   ÚtestRe¢   ó   zJsTests.testRec                 C   r   )Na0  
        var options_for_droppable = {
          overlap:     options.overlap,
          containment: options.containment,
          tree:        options.tree,
          hoverclass:  options.hoverclass,
          onHover:     Sortable.onHover
        }

        var options_for_tree = {
          onHover:      Sortable.onEmptyHover,
          overlap:      options.overlap,
          containment:  options.containment,
          hoverclass:   options.hoverclass
        }

        // fix for gecko engine   
        Element.cleanWhitespace(element); 
        aI  var options_for_droppable={overlap:options.overlap,containment:options.containment,tree:options.tree,hoverclass:options.hoverclass,onHover:Sortable.onHover}
var options_for_tree={onHover:Sortable.onEmptyHover,overlap:options.overlap,containment:options.containment,hoverclass:options.hoverclass}
Element.cleanWhitespace(element);r   r   r   r   r	   ÚtestIgnoreCommentª   s   zJsTests.testIgnoreCommentc                 C   r   )Na”  
        inspect: function(useDoubleQuotes) {
          var escapedString = this.gsub(/[\x00-\x1f\\]/, function(match) {
            var character = String.specialChar[match[0]];
            return character ? character : '\\u00' + match[0].charCodeAt().toPaddedString(2, 16);
          });
          if (useDoubleQuotes) return '"' + escapedString.replace(/"/g, '\\"') + '"';
          return "'" + escapedString.replace(/'/g, '\\\'') + "'";
        },

        toJSON: function() {
          return this.inspect(true);
        },

        unfilterJSON: function(filter) {
          return this.sub(filter || Prototype.JSONFilter, '#{1}');
        },
        aÓ  inspect:function(useDoubleQuotes){var escapedString=this.gsub(/[\x00-\x1f\\]/,function(match){var character=String.specialChar[match[0]];return character?character:'\\u00'+match[0].charCodeAt().toPaddedString(2,16);});if(useDoubleQuotes)return'"'+escapedString.replace(/"/g,'\\"')+'"';return"'"+escapedString.replace(/'/g,'\\\'')+"'";},toJSON:function(){return this.inspect(true);},unfilterJSON:function(filter){return this.sub(filter||Prototype.JSONFilter,'#{1}');},r   r   r   r   r	   ÚtestHairyReÃ   s   zJsTests.testHairyRec                 C   ó,   d}d}|   ||¡ d}d}|   ||¡ d S )NzJ
        myString.replace(/\\/g, '/');
        console.log("hi");
        z.myString.replace(/\\/g,'/');console.log("hi");zn return /^data:image\//i.test(url) || 
        /^(https?|ftp|file|about|chrome|resource):/.test(url);
        zYreturn /^data:image\//i.test(url)||/^(https?|ftp|file|about|chrome|resource):/.test(url);r   r   r   r   r	   ÚtestLiteralReÙ   s   zJsTests.testLiteralRec                 C   s(   d}d}|   ||¡ d}|   ||¡ d S )Na’  
        onSuccess: function(transport) {
            var js = transport.responseText.strip();
            if (!/^\[.*\]$/.test(js)) // TODO: improve sanity check
              throw 'Server returned an invalid collection representation.';
            this._collection = eval(js);
            this.checkForExternalText();
          }.bind(this),
          onFailure: this.onFailure
        });
        zøonSuccess:function(transport){var js=transport.responseText.strip();if(!/^\[.*\]$/.test(js))
throw'Server returned an invalid collection representation.';this._collection=eval(js);this.checkForExternalText();}.bind(this),onFailure:this.onFailure});at  
        onSuccess: function(transport) {
            var js = transport.responseText.strip();
            if (!/^\[.*\]$/.test(js))
              throw 'Server returned an invalid collection representation.';
            this._collection = eval(js);
            this.checkForExternalText();
          }.bind(this),
          onFailure: this.onFailure
        });
        r   )r   r   r   Újs_without_commentr   r   r	   ÚtestNoBracesWithCommentç   s
   zJsTests.testNoBracesWithCommentc                 C   ó   d}|   |d¡ d S )Nz-
        num = num.replace(/ /g,'');
        znum=num.replace(/ /g,'');r   r   r   r   r	   ÚtestSpaceInRe  ó   zJsTests.testSpaceInRec                 C   r:   )Nz7
        function foo('') {
        
        }
        úfunction foo(''){}r   r   r   r   r	   ÚtestEmptyString	  s   zJsTests.testEmptyStringc                 C   r:   )Nz
var  foo    =  "hey";
        zvar foo="hey";r   r   r   r   r	   ÚtestDoubleSpace  r<   zJsTests.testDoubleSpacec                 C   s   d}|   || ¡ ¡ d S )Nz/[d]+/g    )r   Ústripr   r   r   r	   ÚtestLeadingRegex  ó   zJsTests.testLeadingRegexc                 C   r:   )Nz5'a string in the middle of nowhere'; // and a commentz$'a string in the middle of nowhere';r   r   r   r   r	   ÚtestLeadingString  ó   zJsTests.testLeadingStringc                 C   r:   )Nz// a comment\nr   r   r   r   r   r	   ÚtestSingleCommentEnd  rD   zJsTests.testSingleCommentEndc                 C   sj   zddl m } W n ty   ddlm } Y nw |dƒ}|ƒ }t ¡ }| ||¡ | ¡ }|dks3J ‚d S )Nr   )ÚStringIOz;
            function foo('') {

            }
            r=   )rF   ÚImportErrorÚior   ÚJavascriptMinifyÚminifyÚgetvalue)r   rF   ÚinsÚoutsÚmÚoutputr   r   r	   ÚtestInputStream#  s   ÿzJsTests.testInputStreamc                 C   s"   d}d}t   |¡}|  ||¡ d S )Nu	   ä€€ //foou   ä€€)r   r   )r   Úinstrr   rO   r   r   r	   ÚtestUnicode4  s   
zJsTests.testUnicodec                 C   r#   )Nz//test
r   r   r   r   r   r	   ÚtestCommentBeforeEOF:  r&   zJsTests.testCommentBeforeEOFc                 C   r#   )Nz+{ 
            a: 1,//comment
            }z{a:1,}r   r   r   r   r	   ÚtestCommentInObj=  s   þzJsTests.testCommentInObjc                 C   r#   )Nz{a: 1//comment
}z{a:1}r   r   r   r   r	   ÚtestCommentInObj2B  r&   zJsTests.testCommentInObj2c                 C   ó   |   dd¡ d S )Núreturn
ar   r   r   r   r	   ÚtestImplicitSemicolonE  s   zJsTests.testImplicitSemicolonc                 C   r#   )Nzreturn;//comment
azreturn;ar   r   r   r   r	   Útest_explicit_semicolonJ  r&   zJsTests.test_explicit_semicolonc                 C   r#   )Nzreturn//comment...
arz	return
arr   r   r   r   r	   ÚtestImplicitSemicolon2M  r&   zJsTests.testImplicitSemicolon2c                 C   r#   )Nzreturn//comment...
arW   r   r   r   r   r	   ÚtestImplicitSemicolon3P  r&   zJsTests.testImplicitSemicolon3c                 C   r#   )Nz*x.replace(/\//, "_")// slash to underscorezx.replace(/\//,"_")r   r   r   r   r	   ÚtestSingleComment2S  s   ÿzJsTests.testSingleComment2c                 C   r   )Nz2
        { a: n / 2, }
        // comment
        z{a:n/2,}r   ©r   Úoriginalr   r   r   r	   ÚtestSlashesNearCommentsW  r3   zJsTests.testSlashesNearCommentsc                 C   r6   )Nz1
        return foo;//comment
        return bar;zreturn foo;return bar;z'
        return foo
        return bar;zreturn foo
return bar;r   r]   r   r   r	   Ú
testReturn_  s   zJsTests.testReturnc                 C   r   )Nz"s" + ++e + "s"z"s"+ ++e+"s"r   r]   r   r   r	   Útest_space_plusk  ó   zJsTests.test_space_plusc                 C   s   d}d}|   ||¡ d S )Nz"s"r   r]   r   r   r	   Útest_no_final_newlinep  rb   zJsTests.test_no_final_newlinec                 C   ó   d}|   ||¡ d S )Nz%/(NaN| {2}|^$)/.test(a)&&(a="M 0 0");r   ©r   r^   r   r   r	   Útest_space_with_regex_repeatsu  rD   z%JsTests.test_space_with_regex_repeatsc                 C   rd   )Nz)aaa;/(NaN| {2}|^$)/.test(a)&&(a="M 0 0");r   re   r   r   r	   Ú*test_space_with_regex_repeats_not_at_starty  rD   z2JsTests.test_space_with_regex_repeats_not_at_startc                 C   rd   )Nz/a (a)/.test("a")r   re   r   r   r	   Útest_space_in_regex}  rD   zJsTests.test_space_in_regexc                 C   r   )Nzfunction a() { /\//.test("a") }zfunction a(){/\//.test("a")}r   r]   r   r   r	   Ú"test_brackets_around_slashed_regex�  rb   z*JsTests.test_brackets_around_slashed_regexc                 C   s    d}t   |¡}|  d|v ¡ d S )NzÁvar /** holds major version number for IE or NaN for real browsers */
                      msie,
                      jqLite,           // delay binding since jQuery could be loaded after us.zvar
msie)r   Ú
assertTrue)r   r^   r   r   r   r	   Útest_angular_1†  s   
zJsTests.test_angular_1c                 C   r   )Nzvar/* comment */msie;ú	var msie;r   r]   r   r   r	   Útest_angular_2�  rb   zJsTests.test_angular_2c                 C   r   )Nzvar /* comment */msie;rl   r   r]   r   r   r	   Útest_angular_3’  rb   zJsTests.test_angular_3c                 C   r   )Nzvar /* comment */ msie;rl   r   r]   r   r   r	   Útest_angular_4—  rb   zJsTests.test_angular_4c                 C   rd   )Nza/br   re   r   r   r	   Útest_angular_5œ  rD   zJsTests.test_angular_5c                 C   sl   d}| j ||dd� d}| j ||dd� d}| j ||dd� d}| j ||dd� d}d}| j ||dd� d S )	Nz`test`ú'"`©Úquote_charsz` test with leading whitespace`z `test with trailing whitespace `z`test
with a new line`ad  dumpAvStats: function(stats) {
        var statsString = "";
        if (stats.mozAvSyncDelay) {
          statsString += `A/V sync: ${stats.mozAvSyncDelay} ms `;
        }
        if (stats.mozJitterBufferDelay) {
          statsString += `Jitter-buffer delay: ${stats.mozJitterBufferDelay} ms`;
        }

        return React.DOM.div(null, statsString);a  dumpAvStats:function(stats){var statsString="";if(stats.mozAvSyncDelay){statsString+=`A/V sync: ${stats.mozAvSyncDelay} ms `;}
if(stats.mozJitterBufferDelay){statsString+=`Jitter-buffer delay: ${stats.mozJitterBufferDelay} ms`;}
return React.DOM.div(null,statsString);r   r]   r   r   r	   ÚtestBackticks   s   
zJsTests.testBackticksc                 C   s,   d}| j ||dd� d}| j ||dd� d S )Nz+`Fifteen is ${a + b} and not ${2 * a + b}.`rq   rr   z-`Fifteen is ${a +
b} and not ${2 * a + "b"}.`r   re   r   r   r	   ÚtestBackticksExpressions»  s   z JsTests.testBackticksExpressionsc                 C   s   d}| j ||dd� d S )Nz&tag`Hello ${ a + b } world ${ a * b}`;rq   rr   r   re   r   r   r	   ÚtestBackticksTaggedÃ  rB   zJsTests.testBackticksTaggedc                 C   r:   )Nzr
            f = function() {
                return /DataTree\/(.*)\//.exec(this._url)[1];
            }
        z;f=function(){return /DataTree\/(.*)\//.exec(this._url)[1];}r   re   r   r   r	   Útest_issue_bitbucket_16Ç  s
   þzJsTests.test_issue_bitbucket_16c                 C   r:   )Nz+// hi
/^(get|post|head|put)$/i.test('POST')z%/^(get|post|head|put)$/i.test('POST')r   re   r   r   r	   Útest_issue_bitbucket_17Ñ  s   ÿzJsTests.test_issue_bitbucket_17c                 C   s(   d}|  dd¡  dd¡}|  ||¡ d S )Nz”
            respond.regex = {
                comments: /\/\*[^*]*\*+([^/][^*]*\*+)*\//gi,
                urls: 'whatever'
            };
        r   r   r   )Úreplacer   r]   r   r   r	   Útest_issue_6Ö  s   zJsTests.test_issue_6c                 C   s8   d  g d¢¡}d  g d¢¡}|  ||¡ |  ||¡ d S )Nr   )z!var a = 'hi' // this is a commentz*var a = 'hi' /* this is also a  comment */z#console.log(1) // this is a commentz+console.log(1) /* this is also a comment */z1 // this is a commentz1 /* this is also a comment */z{} // this is a commentz{} /* this is also a comment */z"YOLO" /* this is a comment */z"YOLO" // this is a commentz(1 + 2) // commentz(1 + 2) /* yup still comment */úvar b)ú
var a='hi'r|   úconsole.log(1)r}   Ú1r~   ú{}r   ú"YOLO"r€   ú(1+2)r�   r{   )Újoinr   r]   r   r   r	   Útest_issue_9à  s   zJsTests.test_issue_9c                 C   rV   )Nz"yolo"
"loyo"r   r   r   r   r	   Útest_newline_between_strings  r&   z$JsTests.test_newline_between_stringsc                 C   r#   )Nzvar/* comment */azvar ar   r   r   r   r	   Ú%test_issue_10_comments_between_tokens  r&   z-JsTests.test_issue_10_comments_between_tokensc                 C   r#   )Nzvar s = "s"z	var s="s"r   r   r   r   r	   Útest_ends_with_string  r&   zJsTests.test_ends_with_stringc                 C   r#   )Nza;/**/búa;br   r   r   r   r	   Útest_short_comment  r&   zJsTests.test_short_commentc                 C   r#   )Nza;/*/*/br‡   r   r   r   r   r	   Útest_shorter_comment  r&   zJsTests.test_shorter_commentc                 C   r#   )Nza;/**/
br‡   r   r   r   r   r	   Ú!test_block_comment_with_semicolon  r&   z)JsTests.test_block_comment_with_semicolonc                 C   r#   )Nza/**/
var bza
var br   r   r   r   r	   Ú*test_block_comment_With_implicit_semicolon  r&   z2JsTests.test_block_comment_With_implicit_semicolonc                 C   r:   )Nz_
            var a = "hello" // this is a comment
                       a += " world"
        úvar a="hello"
a+=" world"r   re   r   r   r	   Útest_issue_9_single_comments  ó   z$JsTests.test_issue_9_single_commentsc                 C   r:   )Nzb
            var a = "hello" /* this is a comment */
                       a += " world"
        rŒ   r   re   r   r   r	   Útest_issue_9_multi_comments  rŽ   z#JsTests.test_issue_9_multi_commentsc                 C   r:   )NzD
            var re = /\d{4}/
            if (1) { console.log(2); }z%var re=/\d{4}/
if(1){console.log(2);}r   re   r   r   r	   Útest_issue_12_re_nl_if%  s   ÿzJsTests.test_issue_12_re_nl_ifc                 C   r:   )Nz0
            var re = /\d{4}/
            g = 10zvar re=/\d{4}/
g=10r   re   r   r   r	   Útest_issue_12_re_nl_other,  r<   z!JsTests.test_issue_12_re_nl_otherc                 C   r   )Na  
            function this() {
                /*! Copyright year person */
                console.log('hello!');
            }

            /*! Copyright blah blah
             *
             *  Some other text
             */

            var a;
        z¢function this(){/*! Copyright year person */
console.log('hello!');}/*! Copyright blah blah
             *
             *  Some other text
             */

var a;r   r]   r   r   r	   Útest_preserve_copyright2  s   zJsTests.test_preserve_copyrightc                 C   r:   )Nzreturn x / 1;zreturn x/1;r   re   r   r   r	   Útest_issue_14G  rD   zJsTests.test_issue_14c                 C   r:   )Nzreturn r / 1;zreturn r/1;r   re   r   r   r	   Ú#test_issue_14_with_char_from_returnK  rD   z+JsTests.test_issue_14_with_char_from_returnN)KÚ__name__Ú
__module__Ú__qualname__r
   r   r   r   r   r    r!   r"   r%   r'   r)   r*   r+   r-   r.   r/   r1   r2   r4   r5   r7   r9   r;   r>   r?   rA   rC   rE   rP   rR   rS   rT   rU   rX   rY   rZ   r[   r\   r_   r`   ra   rc   rf   rg   rh   ri   rk   rm   rn   ro   rp   rt   ru   rv   rw   rx   rz   rƒ   r„   r…   r†   rˆ   r‰   rŠ   r‹   r�   r�   r�   r‘   r’   r“   r”   r   r   r   r	   r       s’    		

"r   c                   @   sT   e Zd Zdd„ Zdd„ Zdd„ Zdd„ Zd	d
„ Zdd„ Zdd„ Z	dd„ Z
dd„ ZdS )Ú
RegexTestsc                 C   sB   t jj}||dd … ƒ}|ƒ }t  ||¡ |d |d ¡ | ¡ S )Né   r   é   )r   rH   rF   rI   Úregex_literalrK   )r   r   ÚklassrL   rM   r   r   r	   Úregex_recogniseR  s
   zRegexTests.regex_recognisec                 C   s8   |d dksJ ‚|   |¡}||ksJ d|||f ƒ‚d S )Nr   ú/z
 in: %r
got: %r
exp: %r)r�   )r   r   r   Ú
recognisedr   r   r	   Úassert_regexY  s   
zRegexTests.assert_regexc                 C   r#   )Nz/123/gz/123/©r    r   r   r   r	   Útest_simple^  r&   zRegexTests.test_simplec                 C   r#   )Nz
/a[0-9]b/gz	/a[0-9]b/r¡   r   r   r   r	   Útest_character_classa  r&   zRegexTests.test_character_classc                 C   r#   )Nz/a[/]b/gz/a[/]b/r¡   r   r   r   r	   Útest_character_class_with_slashd  r&   z*RegexTests.test_character_class_with_slashc                 C   r#   )Nz/a\/b/gz/a\/b/r¡   r   r   r   r	   Útest_escaped_forward_slashg  r&   z%RegexTests.test_escaped_forward_slashc                 C   r#   )Nz/a\\/gz/a\\/r¡   r   r   r   r	   Útest_escaped_back_slashj  r&   z"RegexTests.test_escaped_back_slashc                 C   r#   )Nz	/a[]/]b/gz/a[]/]b/r¡   r   r   r   r	   Útest_empty_character_classm  s   z%RegexTests.test_empty_character_classc                 C   s   |   dd¡ |   dd¡ d S )Nz
/a([)])b/gz	/a([)])b/z/a[(]b/gz/a[(]b/r¡   r   r   r   r	   Útest_precedence_of_parenst  s   z$RegexTests.test_precedence_of_parensN)r•   r–   r—   r�   r    r¢   r£   r¤   r¥   r¦   r§   r¨   r   r   r   r	   r˜   P  s    r˜   Ú__main__)Úunittestr   ÚTestCaser   r˜   r•   Úmainr   r   r   r	   Ú<module>   s       4+ÿ