.Init__same__rng(0,255)// clear everything and set to do-not-encode
.Init__encode_hex(Byte_ascii.Angle_bgn,Byte_ascii.Angle_end)// NOTE: should not be encoded, but will break existings tests; EX:{{#tag:pre|a|id='<br/>'}}; DATE:2019-05-12
@TestpublicvoidId__syms(){fxt.Encoder_id().Test__encode("!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~",".21.22.23.24.25.26.27.28.29.2A.2B.2C-..2F:.3B.3C.3D.3E.3F.40.5B.5C.5D.5E_.60.7B.7C.7D.7E");}// NOTE: not reversible since "." is encode_marker but not encoded
fxt.Encoder_id().Test__encode("a b","a.C2.A0b");// NOTE: not just .A0 (160) but utf8-encoded .C2.A0
fxt.Encoder_id().Test__decode("a.C2.A0b","ab");// WS is nbsp
}
@TestpublicvoidId__err(){
byte[]raw=Bry_.new_a7("0%.jpg");
Bry_bfrtmp_bfr=Bry_bfr_.New();
@ -39,7 +55,7 @@ public class Gfo_url_encoder_tst {
fxt.Encoder_href().Test__encode("a b","a_b");
}
@TestpublicvoidHref__special_and_anchor(){// PURPOSE: MediaWiki encodes with % for ttls, but . for anchors; REF:Title.php!(before-anchor)getLocalUrl;wfUrlencode (after-anchor)escapeFragmentForURL
fxt.Encoder_href().Test__bicode("^#^","%5E#.5E");
fxt.Encoder_href().Test__bicode("^#^","%5E#^");
fxt.Encoder_href().Test__encode("A#","A#");
}
@TestpublicvoidHref__invalid(){// PURPOSE: check that invalid url decodings are rendered literally; DATE:2014-04-10
@TestpublicvoidFile_in_tbl(){// PURPOSE: two issues (a) don't show file if in tbl; (b) if v2, file inside tbl fails; PAGE:en.w:Holmes County,_Mississippi; DATE:2014-06-22
@TestpublicvoidAnch_w_slash(){// PURPOSE: A/b#c/d was not parsing correctly; PAGE:en.w:Enlightenment_Spain#Enlightened_despotism_.281759%E2%80%931788.29
@TestpublicvoidVal_empty(){fxt.Test_html_full_str("{{#tag:pre|a|id=}}","<pre>a</pre>");}// PURPOSE: ignore atrs with no val; EX:{{#ref||group=}} PAGE:ru.w:Колчак,_Александр_Васильевич; DATE:2014-07-03
@TestpublicvoidVal_multiple(){fxt.Test_html_full_str("{{#tag:pre|c|id='a'b'}}","<pre id=\"a.27b\">c</pre>");}// PURPOSE: multiple quotes should use 1st and nth; DATE:2018-12-24
@TestpublicvoidVal_quote_w_apos(){fxt.Test_html_full_str("{{#tag:pre|c|id=\"a'b\"}}","<pre id=\"a.27b\">c</pre>");}// PURPOSE.fix: tag was not handling apos within quotes; PAGE:en.s:The_formative_period_in_Colby%27s_history DATE:2016-06-23
@TestpublicvoidVal_multiple(){fxt.Test_html_full_str("{{#tag:pre|c|id='a'b'}}","<pre id=\"a'b\">c</pre>");}// PURPOSE: multiple quotes should use 1st and nth; DATE:2018-12-24 // ISSUE#:462; DATE:2019-05-12
@TestpublicvoidVal_quote_w_apos(){fxt.Test_html_full_str("{{#tag:pre|c|id=\"a'b\"}}","<pre id=\"a'b\">c</pre>");}// PURPOSE.fix: tag was not handling apos within quotes; PAGE:en.s:The_formative_period_in_Colby%27s_history DATE:2016-06-23; // ISSUE#:462; DATE:2019-05-12
@TestpublicvoidTmpl(){fxt.Test_html_full_str("{{#tag:pre|a|{{#switch:a|a=id}}=c}}","<pre id=\"c\">a</pre>");}// PURPOSE: args must be evaluated
@TestpublicvoidWs_all(){fxt.Test_html_full_str("{{#tag:pre|a| id = b }}","<pre id=\"b\">a</pre>");}
@TestpublicvoidWs_quoted(){fxt.Test_html_full_str("{{#tag:pre|a| id = ' b ' }}","<pre id=\"_b_\">a</pre>");}
@TestpublicvoidErr_bad_key(){fxt.Test_html_full_str("{{#tag:pre|a|id=val|b}}","<pre id=\"val\">a</pre>");}// PURPOSE: b was failing b/c id was larger and key_end set to 4 (whereas b was len=1)
@TestpublicvoidHtml_is_escaped(){fxt.Test_html_full_str("{{#tag:pre|a|id='<br/>'}}","<pre id=\".3Cbr.2F.3E\">a</pre>");}// PURPOSE: escape html in atrs; PAGE:fr.w:France; DATE:2017-06-01
@TestpublicvoidErr_bad_key(){fxt.Test_html_full_str("{{#tag:pre|a|id=val|b}}","<pre id=\"val\">a</pre>");}// PURPOSE: b was failing b/c id was larger and key_end set to 4 (whereas b was len=1)
@TestpublicvoidHtml_is_escaped(){fxt.Test_html_full_str("{{#tag:pre|a|id='<br/>'}}","<pre id=\".3Cbr/.3E\">a</pre>");}// PURPOSE: escape html in atrs; PAGE:fr.w:France; DATE:2017-06-01; // ISSUE#:462; DATE:2019-05-12
@TestpublicvoidNested_tmpl(){// PURPOSE: nested template must get re-evaluated; EX:de.wikipedia.org/wiki/Freiburg_im_Breisgau; DATE:2013-12-18;