Debian Codegraph @

extensions/Scribunto/tests/phpunit/Engines/LuaCommon/UstringLibraryNormalizationTests.lua

raw symbols SCIP
1 local function tohex( s )
2 local t = { s }
3 for c in mw.ustring.gcodepoint( s ) do
4 t[#t + 1] = string.format( "%x", c )
5 end
6 return table.concat( t, '\t' )
7 end
8
9 return {
10 run = function ( c1, c2, c3, c4, c5 )
11 return
12 tohex( mw.ustring.toNFC( c1 ) ),
13 tohex( mw.ustring.toNFC( c2 ) ),
14 tohex( mw.ustring.toNFC( c3 ) ),
15 tohex( mw.ustring.toNFC( c4 ) ),
16 tohex( mw.ustring.toNFC( c5 ) ),
17 tohex( mw.ustring.toNFD( c1 ) ),
18 tohex( mw.ustring.toNFD( c2 ) ),
19 tohex( mw.ustring.toNFD( c3 ) ),
20 tohex( mw.ustring.toNFD( c4 ) ),
21 tohex( mw.ustring.toNFD( c5 ) ),
22 tohex( mw.ustring.toNFKC( c1 ) ),
23 tohex( mw.ustring.toNFKC( c2 ) ),
24 tohex( mw.ustring.toNFKC( c3 ) ),
25 tohex( mw.ustring.toNFKC( c4 ) ),
26 tohex( mw.ustring.toNFKC( c5 ) ),
27 tohex( mw.ustring.toNFKD( c1 ) ),
28 tohex( mw.ustring.toNFKD( c2 ) ),
29 tohex( mw.ustring.toNFKD( c3 ) ),
30 tohex( mw.ustring.toNFKD( c4 ) ),
31 tohex( mw.ustring.toNFKD( c5 ) )
32 end
33 }