Edge Rewrite
// HTMLRewriter · presentation

This page was redesigned at the edge.

Cloudflare fetched the original article and streamed it through HTMLRewriter to apply an entirely new visual system without rebuilding the source page.

// request.cf · coarse context

A page that knows where it met you.

Only coarse request metadata is shown. This demo does not display or persist visitor IP addresses.

Country
US
Cloudflare location
CMH
Connection
HTTP/2
Language
Not provided

Ray ID: a21cb3cf9f8a8cc1

Jump to content

Module talk:Text/testcases

Page contents not supported in other languages.
Add topic
From Wikipedia, the free encyclopedia

All 250 tests passed.

testChar

testChar
TestExpectedActual
checkY
checkY {65,104,97} Aha Aha
checkY {"65",104,97} Aha Aha
checkY {98,108,97},2 blabla blabla
checkY {"something"} error error
checkY "something",1,true
checkY {7,8,9} error error
checkY {{#invoke:Text|char|65 104 97}} Aha Aha
checkY {{#invoke:Text|char|98 108 97|*=2}} blabla blabla
checkY {{#invoke:Text|char|something|errors=0}}

testCharSandbox

testCharSandbox
TestExpectedActual
checkY
checkY {65,104,97} Aha Aha
checkY {"65",104,97} Aha Aha
checkY {98,108,97},2 blabla blabla
checkY {"something"} error error
checkY "something",1,true
checkY {7,8,9} error error
checkY {{#invoke:Text/sandbox|char|65 104 97}} Aha Aha
checkY {{#invoke:Text/sandbox|char|98 108 97|*=2}} blabla blabla
checkY {{#invoke:Text/sandbox|char|something|errors=0}}

testConcatParams

testConcatParams
TestExpectedActual
checkY
checkY {}
checkY A A A
checkY {"A"} A A
checkY {"A","B","C"} A|B|C A|B|C
checkY {"A","B","C"},"-" A-B-C A-B-C
checkY {"1","2","3"},nil,"%.2f" 1.00|2.00|3.00 1.00|2.00|3.00
checkY {{#invoke:Text|concatParams|1|2|3|separator=:|format=%.2f}} 1.00:2.00:3.00 1.00:2.00:3.00

testConcatParamsSandbox

testConcatParamsSandbox
TestExpectedActual
checkY
checkY {}
checkY A A A
checkY {"A"} A A
checkY {"A","B","C"} A|B|C A|B|C
checkY {"A","B","C"},"-" A-B-C A-B-C
checkY {"1","2","3"},nil,"%.2f" 1.00|2.00|3.00 1.00|2.00|3.00
checkY {{#invoke:Text/sandbox|concatParams|1|2|3|separator=:|format=%.2f}} 1.00:2.00:3.00 1.00:2.00:3.00

testListToText

testListToText
TestExpectedActual
checkY
checkY {}
checkY A A A
checkY {"A"} A A
checkY {"A","B","C"} A, B and C A, B and C
checkY {"1","2","3"},"%.2f" 1.00, 2.00 and 3.00 1.00, 2.00 and 3.00
checkY {{#invoke:Text|listToText|1|2|3|format=%.2f}} 1.00, 2.00 and 3.00 1.00, 2.00 and 3.00

testListToTextSandbox

testListToTextSandbox
TestExpectedActual
checkY
checkY {}
checkY A A A
checkY {"A"} A A
checkY {"A","B","C"} A, B and C A, B and C
checkY {"1","2","3"},"%.2f" 1.00, 2.00 and 3.00 1.00, 2.00 and 3.00
checkY {{#invoke:Text/sandbox|listToText|1|2|3|format=%.2f}} 1.00, 2.00 and 3.00 1.00, 2.00 and 3.00

testContainsCJK

testContainsCJK
TestExpectedActual
checkY false false
checkY Draco Dormiens Nunquam Titillandus false false
checkY Никогда не щекочи спящего дракона false false
checkY सोए शेर को न जगाओ false false
checkY 永远不要惊醒卧龙 true true
checkY 眠っているドラゴンをくすぐることはありません true true
checkY 잠자는 용을 간지럽히지 마십시오 true true

testContainsCJKSandbox

testContainsCJKSandbox
TestExpectedActual
checkY false false
checkY Draco Dormiens Nunquam Titillandus false false
checkY Никогда не щекочи спящего дракона false false
checkY सोए शेर को न जगाओ false false
checkY 永远不要惊醒卧龙 true true
checkY 眠っているドラゴンをくすぐることはありません true true
checkY 잠자는 용을 간지럽히지 마십시오 true true

testGetPlain

testGetPlain
TestExpectedActual
checkY a and b a and b a and b
checkY a<!--comment-->b ab ab
checkY <!--comment-->hello, world<!--comment 2--> hello, world hello, world
checkY a <nowiki>b c</nowiki> a b c a b c
checkY '''a''' a a
checkY ''b'' b b
checkY '''a''' and ''b'' a and b a and b
checkY a and b a and b a and b
checkY '''a'' and '''b'' a and b a and b
checkY a<!--I am an unclosed comment a a
checkY '''unclosed bold unclosed bold unclosed bold
checkY <!-- hello -- -->'''a''' <!--world-->''<nowiki>b</nowiki> a b a b
checkY <b>a</b> '''b'''<!-- hello -- world -->, <div style='font-size:100%;'>c</div> a b, c a b, c

testGetPlainSandbox

testGetPlainSandbox
TestExpectedActual
checkY a and b a and b a and b
checkY a<!--comment-->b ab ab
checkY <!--comment-->hello, world<!--comment 2--> hello, world hello, world
checkY a <nowiki>b c</nowiki> a b c a b c
checkY '''a''' a a
checkY ''b'' b b
checkY '''a''' and ''b'' a and b a and b
checkY a and b a and b a and b
checkY '''a'' and '''b'' a and b a and b
checkY a<!--I am an unclosed comment a a
checkY '''unclosed bold unclosed bold unclosed bold
checkY <!-- hello -- -->'''a''' <!--world-->''<nowiki>b</nowiki> a b a b
checkY <b>a</b> '''b'''<!-- hello -- world -->, <div style='font-size:100%;'>c</div> a b, c a b, c

testRemoveDelimited

testRemoveDelimited
TestExpectedActual
checkY comment ab ab
checkY 2 comments hello, world hello, world
checkY ref in foo. in foo.

testRemoveDelimitedSandbox

testRemoveDelimitedSandbox
TestExpectedActual
checkY comment ab ab
checkY 2 comments hello, world hello, world
checkY ref in foo. in foo.

testIsLatin

testIsLatin
TestExpectedActual
checkY true true
checkY abcd true true
checkY Ça ira true true
checkY α – Ω false false
checkY a日本d false false

testIsLatinSandbox

testIsLatinSandbox
TestExpectedActual
checkY true true
checkY abcd true true
checkY Ça ira true true
checkY α – Ω false false
checkY a日本d false false

testIsQuote

testIsQuote
TestExpectedActual
checkY false false
checkY " true true
checkY false false
checkY abc" false false

testIsQuoteSandbox

testIsQuoteSandbox
TestExpectedActual
checkY false false
checkY " true true
checkY false false
checkY abc" false false

testQuote

testQuote
TestExpectedActual
checkY “” “”
checkY abcd “abcd” “abcd”
checkY "abcd" “"abcd"” “"abcd"”
checkY fr « abcd » « abcd »
checkY fr2  abcd   abcd 

testQuoteSandbox

testQuoteSandbox
TestExpectedActual
checkY “” “”
checkY abcd “abcd” “abcd”
checkY "abcd" “"abcd"” “"abcd"”
checkY fr « abcd » « abcd »
checkY fr2  abcd   abcd 

testQuoteUnquoted

testQuoteUnquoted
TestExpectedActual
checkY
checkY abcd “abcd” “abcd”
checkY "abcd" "abcd" "abcd"
checkY fr « abcd » « abcd »
checkY fr2  abcd   abcd 

testQuoteUnquotedSandbox

testQuoteUnquotedSandbox
TestExpectedActual
checkY
checkY abcd “abcd” “abcd”
checkY "abcd" "abcd" "abcd"
checkY fr « abcd » « abcd »
checkY fr2  abcd   abcd 

testRemoveDiacritics

testRemoveDiacritics
TestExpectedActual
checkY
checkY abcd abcd abcd
checkY âbçdé abcde abcde
checkY a日本d a日本d a日本d

testRemoveDiacriticsSandbox

testRemoveDiacriticsSandbox
TestExpectedActual
checkY
checkY abcd abcd abcd
checkY âbçdé abcde abcde
checkY a日本d a日本d a日本d

testSentenceTerminated

testSentenceTerminated
TestExpectedActual
checkY Hello false false
checkY (Hello) false false
checkY Hello. true true
checkY „Deutsche“ false false
checkY „Deutsche?“ true true
checkY "English?" true true
checkY [[Hello!]] true true

testSentenceTerminatedSandbox

testSentenceTerminatedSandbox
TestExpectedActual
checkY Hello false false
checkY (Hello) false false
checkY Hello. true true
checkY „Deutsche“ false false
checkY „Deutsche?“ true true
checkY "English?" true true
checkY [[Hello!]] true true

testUCFirstAll

testUCFirstAll
TestExpectedActual
checkY
checkY 25 25 25
checkY Help test me Help Test Me Help Test Me
checkY an der Schönen An Der Schönen An Der Schönen
checkY an der Schönen &lauen An Der Schönen &Lauen An Der Schönen &Lauen
checkY HTML ndash An Der Schönen &Lauen Donau – X Y Z An Der Schönen &Lauen Donau – X Y Z
checkY HTML nbsp A B A B
checkY many HTML &<>  ‌‍‎‏ &<>  ‌‍‎‏

testUCFirstAllSandbox

testUCFirstAllSandbox
TestExpectedActual
checkY
checkY 25 25 25
checkY Help test me Help Test Me Help Test Me
checkY an der Schönen An Der Schönen An Der Schönen
checkY an der Schönen &lauen An Der Schönen &Lauen An Der Schönen &Lauen
checkY HTML ndash An Der Schönen &Lauen Donau – X Y Z An Der Schönen &Lauen Donau – X Y Z
checkY HTML nbsp A B A B
checkY many HTML &<>  ‌‍‎‏ &<>  ‌‍‎‏

testUprightNonLatin

testUprightNonLatin
TestExpectedActual
checkY abc abc abc
checkY abc abc abc
checkY Musṭafah Musṭafah Musṭafah
checkY μm μm μm
checkY 1 α-particle 1 α-particle 1 α-particle
checkY Method 3α Method 3α Method 3α
checkY ΣΨΩ <span dir='auto' style='font-style:normal'>ΣΨΩ</span> <span dir='auto' style='font-style:normal'>ΣΨΩ</span>
checkY abcΣΨΩxyz abc<span dir='auto' style='font-style:normal'>ΣΨΩ</span>xyz abc<span dir='auto' style='font-style:normal'>ΣΨΩ</span>xyz
checkY abЩyz ab<span dir='auto' style='font-style:normal'>Щ</span>yz ab<span dir='auto' style='font-style:normal'>Щ</span>yz
checkY Войната 1915 година. Втора Македония <span dir='auto' style='font-style:normal'>Войната 1915 година. Втора Македония</span> <span dir='auto' style='font-style:normal'>Войната 1915 година. Втора Македония</span>
checkY a日本d a<span dir='auto' style='font-style:normal'>日本</span>d a<span dir='auto' style='font-style:normal'>日本</span>d

testUprightNonLatinSandbox

testUprightNonLatinSandbox
TestExpectedActual
checkY abc abc abc
checkY abc abc abc
checkY Musṭafah Musṭafah Musṭafah
checkY μm μm μm
checkY 1 α-particle 1 α-particle 1 α-particle
checkY Method 3α Method 3α Method 3α
checkY ΣΨΩ <span dir='auto' style='font-style:normal'>ΣΨΩ</span> <span dir='auto' style='font-style:normal'>ΣΨΩ</span>
checkY abcΣΨΩxyz abc<span dir='auto' style='font-style:normal'>ΣΨΩ</span>xyz abc<span dir='auto' style='font-style:normal'>ΣΨΩ</span>xyz
checkY abЩyz ab<span dir='auto' style='font-style:normal'>Щ</span>yz ab<span dir='auto' style='font-style:normal'>Щ</span>yz
checkY Войната 1915 година. Втора Македония <span dir='auto' style='font-style:normal'>Войната 1915 година. Втора Македония</span> <span dir='auto' style='font-style:normal'>Войната 1915 година. Втора Македония</span>
checkY a日本d a<span dir='auto' style='font-style:normal'>日本</span>d a<span dir='auto' style='font-style:normal'>日本</span>d

testExport

testExport
TestExpectedActual
checkY {{#invoke:Text|containsCJK|a}}
checkY {{#invoke:Text|containsCJK|}} 1 1
checkY {{#invoke:Text|isLatinRange|}}
checkY {{#invoke:Text|isLatinRange|a}} 1 1
checkY {{#invoke:Text|isQuote|}}
checkY {{#invoke:Text|isQuote|}} 1 1
checkY {{#invoke:Text|sentenceTerminated|}}
checkY {{#invoke:Text|sentenceTerminated|a.}} 1 1
checkY {{#invoke:Text|getPlain|a}} a a
checkY {{#invoke:Text|removeDiacritics|a}} a a
checkY {{#invoke:Text|ucfirstAll|a}} A A
checkY {{#invoke:Text|uprightNonlatin|a}} a a

testExportSandbox

testExportSandbox
TestExpectedActual
checkY {{#invoke:Text/sandbox|containsCJK|a}}
checkY {{#invoke:Text/sandbox|containsCJK|}} 1 1
checkY {{#invoke:Text/sandbox|isLatinRange|}}
checkY {{#invoke:Text/sandbox|isLatinRange|a}} 1 1
checkY {{#invoke:Text/sandbox|isQuote|}}
checkY {{#invoke:Text/sandbox|isQuote|}} 1 1
checkY {{#invoke:Text/sandbox|sentenceTerminated|}}
checkY {{#invoke:Text/sandbox|sentenceTerminated|a.}} 1 1
checkY {{#invoke:Text/sandbox|getPlain|a}} a a
checkY {{#invoke:Text/sandbox|removeDiacritics|a}} a a
checkY {{#invoke:Text/sandbox|ucfirstAll|a}} A A
checkY {{#invoke:Text/sandbox|uprightNonlatin|a}} a a

testSplit

testSplit
TestExpectedActual
checkY "?a?b?c?d?e?f?", "c" {"?a?b?","?d?e?f?"} {"?a?b?","?d?e?f?"}
checkY "?a?b?c?d?e?f?", "?" {"","a","b","c","d","e","f",""} {"","a","b","c","d","e","f",""}
checkY "?a?b?c?d?e?f?", "" {"?","a","?","b","?","c","?","d","?","e","?","f","?"} {"?","a","?","b","?","c","?","d","?","e","?","f","?"}
checkY "?a?b?c?d?e?f?", "z" {"?a?b?c?d?e?f?"} {"?a?b?c?d?e?f?"}
checkY "?a?b?c?d?e?f?", "[bdf]" {"?a?","?c?","?e?","?"} {"?a?","?c?","?e?","?"}
checkY "?a?b?c?d?e?f?", "[bdf]", true {"?a?b?c?d?e?f?"} {"?a?b?c?d?e?f?"}
checkY {{#invoke:Text|split|?a?b?c?|c}} ?a?b? ?a?b?
checkY {{#invoke:Text|split|?a?b?c?|?}}
checkY {{#invoke:Text|split|?a?b?c?|?|false|2}} a a
checkY {{#invoke:Text|split|?a?b?c?|?|false|-2}} c c
checkY {{#invoke:Text|split|?a?b?c?||false|2}} a a
checkY {{#invoke:Text|split|?a?b?c?|z}} ?a?b?c? ?a?b?c?
checkY {{#invoke:Text|split|?a?b?c?|[bc]}} ?a? ?a?
checkY {{#invoke:Text|split|?a?b?c?|[bc]|true}} ?a?b?c? ?a?b?c?

testSplitSandbox

testSplitSandbox
TestExpectedActual
checkY "?a?b?c?d?e?f?", "c" {"?a?b?","?d?e?f?"} {"?a?b?","?d?e?f?"}
checkY "?a?b?c?d?e?f?", "?" {"","a","b","c","d","e","f",""} {"","a","b","c","d","e","f",""}
checkY "?a?b?c?d?e?f?", "" {"?","a","?","b","?","c","?","d","?","e","?","f","?"} {"?","a","?","b","?","c","?","d","?","e","?","f","?"}
checkY "?a?b?c?d?e?f?", "z" {"?a?b?c?d?e?f?"} {"?a?b?c?d?e?f?"}
checkY "?a?b?c?d?e?f?", "[bdf]" {"?a?","?c?","?e?","?"} {"?a?","?c?","?e?","?"}
checkY "?a?b?c?d?e?f?", "[bdf]", true {"?a?b?c?d?e?f?"} {"?a?b?c?d?e?f?"}
checkY {{#invoke:Text/sandbox|split|?a?b?c?|c}} ?a?b? ?a?b?
checkY {{#invoke:Text/sandbox|split|?a?b?c?|?}}
checkY {{#invoke:Text/sandbox|split|?a?b?c?|?|false|2}} a a
checkY {{#invoke:Text/sandbox|split|?a?b?c?|?|false|-2}} c c
checkY {{#invoke:Text/sandbox|split|?a?b?c?||false|2}} a a
checkY {{#invoke:Text/sandbox|split|?a?b?c?|z}} ?a?b?c? ?a?b?c?
checkY {{#invoke:Text/sandbox|split|?a?b?c?|[bc]}} ?a? ?a?
checkY {{#invoke:Text/sandbox|split|?a?b?c?|[bc]|true}} ?a?b?c? ?a?b?c?

testZip

testZip
TestExpectedActual
checkY {{#invoke:Text|zip|a,b,c|1,2,3|sep=,|isep=-|osep=/}} a-1/b-2/c-3 a-1/b-2/c-3
checkY {{#invoke:Text|zip|a b c|x y z|1 2 3|sep=%s+|isep=-|osep=/}} a-x-1/b-y-2/c-z-3 a-x-1/b-y-2/c-z-3

testZipSandbox

testZipSandbox
TestExpectedActual
checkY {{#invoke:Text/sandbox|zip|a,b,c|1,2,3|sep=,|isep=-|osep=/}} a-1/b-2/c-3 a-1/b-2/c-3
checkY {{#invoke:Text/sandbox|zip|a b c|x y z|1 2 3|sep=%s+|isep=-|osep=/}} a-x-1/b-y-2/c-z-3 a-x-1/b-y-2/c-z-3