mirror of https://github.com/svaarala/duktape.git
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
29 lines
467 B
12 years ago
|
/*---
|
||
|
{
|
||
|
"custom": true
|
||
|
}
|
||
|
---*/
|
||
|
|
||
|
/*===
|
||
|
1
|
||
|
0
|
||
|
-1
|
||
12 years ago
|
-1
|
||
|
1
|
||
12 years ago
|
===*/
|
||
|
|
||
|
/* 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'));
|
||
12 years ago
|
|
||
|
print(''.localeCompare('\u0000'));
|
||
|
print('\u0000'.localeCompare(''));
|
||
12 years ago
|
} catch (e) {
|
||
|
print(e);
|
||
|
}
|