/usr/share/lifelines/st/st_string_UTF-8.li is in lifelines-reports 3.0.61-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 | /*
* @progname st_string_UTF-8.li
* @version 1.1
* @author Perry Rapp
* @category self-test
* @output none
* @description validate string functions on UTF-8
*/
char_encoding("UTF-8")
require("lifelines-reports.version:1.3")
option("explicitvars") /* Disallow use of undefined variables */
include("st_aux")
/* entry point in case not invoked via st_all.ll */
proc main()
{
call testStrings_UTF_8()
}
/*
test some string functions against defined & undefined strings
*/
proc testStrings_UTF_8()
{
call initSubsection()
call testBothWays_UTF_8("ä", "Ä", "adia") /* u+00E4, u+00C4 */
call testBothWays_UTF_8("ö", "Ö", "odia") /* u+00F6, u+00D6 */
call testBothWays_UTF_8("æ", "Æ", "ae") /* u+00E6, u+00C6 */
call testBothWays_UTF_8("ǽ", "Ǽ", "ae_acute") /* u+01FD, u+01FC */
call testBothWays_UTF_8("ð", "Ð", "eth") /* u+00F0, u+00D0 */
call testBothWays_UTF_8("þ", "Þ", "thorn") /* u+00FE, u+00DE */
call testBothWays_UTF_8("ø", "Ø", "o_stroke") /* u+00F8, u+00D8 */
call testBothWays_UTF_8("œ", "Œ", "oe") /* u+0153, u+0152 */
call testBothWays_UTF_8("ł", "Ł", "l_stroke") /* u+0142, u+0141 */
call testBothWays_UTF_8("δ", "Δ", "delta") /* u+03B4, u+0394 */
call testBothWays_UTF_8("ш", "Ш", "Cyrillic_sha") /* u+0448, u+0428 */
/* special cases */
/*
Special handling of Greek lower sigma is not implemented
Currently lifelines uses Unicode character properties
from UnicodeDataExcerpt.txt
*/
/* call testBothWays_UTF_8("σας", "ΣΑΣ", "Greek sas") */
/* TODO: add German special case when implemented */
call reportSubsection("string UTF-8 tests")
}
proc testBothWays_UTF_8(slo, shi, sname)
{
if (ne(upper(slo), shi)) {
call reportfail(concat("upper(", sname, ") FAILED"))
}
else { incr(testok) }
if (ne(lower(shi), slo)) {
call reportfail(concat("lower(", sname, ") FAILED"))
}
else { incr(testok) }
}
|