You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

29 lines
467 B

/*---
{
"custom": true
}
---*/
/*===
1
0
-1
-1
1
===*/
/* Test for a bug: strncmp() was used for string comparison, which is
* a problem because strncmp() stops comparing at a NUL.
*/
try {
print('foo\u0000f'.localeCompare('foo\u0000e'));
print('foo\u0000f'.localeCompare('foo\u0000f'));
print('foo\u0000f'.localeCompare('foo\u0000g'));
print(''.localeCompare('\u0000'));
print('\u0000'.localeCompare(''));
} catch (e) {
print(e);
}