Skip to content
Snippets Groups Projects
Commit 9741833f authored by Martin Nilsson's avatar Martin Nilsson
Browse files

_Charset test fixes

Rev: tools/release_checks.pike:1.10
parent 884541e3
No related branches found
No related tags found
No related merge requests found
...@@ -74,10 +74,16 @@ int test_unbug_year() { ...@@ -74,10 +74,16 @@ int test_unbug_year() {
} }
int test_charset_table(string t) { int test_charset_table(string t) {
array names = ({}); array names;
foreach( Stdio.read_file("src/modules/_Charset/"+t)/"\n", string line ) foreach( Stdio.read_file("src/modules/_Charset/"+t)/"\n", string line ) {
if( !names ) {
if( has_value(line, "charset_map") )
names = ({});
continue;
}
if( sscanf(line, " { \"%s\", ", string name) ) if( sscanf(line, " { \"%s\", ", string name) )
names += ({ name }); names += ({ name });
}
string code = Stdio.read_file("src/modules/_Charset/module.pmod.in"); string code = Stdio.read_file("src/modules/_Charset/module.pmod.in");
sscanf(code, "%*sstring normalize(%s return out;\n}", code); sscanf(code, "%*sstring normalize(%s return out;\n}", code);
...@@ -95,6 +101,12 @@ int test_charset_table(string t) { ...@@ -95,6 +101,12 @@ int test_charset_table(string t) {
if( !equal(names, sort(copy_value(names))) ) { if( !equal(names, sort(copy_value(names))) ) {
write("Incorrect sorting order in %s.\n", t); write("Incorrect sorting order in %s.\n", t);
foreach( sort(copy_value(names)); int i; string name)
if( name != names[i] )
{
write("Problem beings at %O, should be %O\n", names[i], name);
break;
}
status = 0; status = 0;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment