+ assert(test_string(" thorn", XKB_KEY_NoSymbol));
+ assert(test_string("thorn ", XKB_KEY_NoSymbol));
+
+ /* Decimal keysyms are not supported (digits are special cases) */
+ assert(test_string("-1", XKB_KEY_NoSymbol));
+ assert(test_string("10", XKB_KEY_NoSymbol));
+ assert(test_string("010", XKB_KEY_NoSymbol));
+ assert(test_string("4567", XKB_KEY_NoSymbol));
+
+ /* Unicode: test various ranges */
+ assert(test_string("U0000", XKB_KEY_NoSymbol)); /* Min Unicode */
+ assert(test_string("U001f", XKB_KEY_NoSymbol));
+ assert(test_string("U0020", 0x0000020));
+ assert(test_string("U007E", 0x000007e));
+ assert(test_string("U007f", XKB_KEY_NoSymbol));
+ assert(test_string("U009f", XKB_KEY_NoSymbol));
+ assert(test_string("U00a0", 0x00000a0));
+ assert(test_string("U00ff", 0x00000ff));
+ assert(test_string("U4567", 0x1004567));
+ assert(test_string("U1F4A9", 0x0101F4A9));
+ assert(test_string("U10FFFF", 0x110ffff)); /* Max Unicode */
+ assert(test_string("U110000", XKB_KEY_NoSymbol));
+ /* Unicode: test syntax */
+ assert(test_string("U00004567", 0x1004567)); /* OK: 8 digits */
+ assert(test_string("U000004567", XKB_KEY_NoSymbol)); /* ERR: 9 digits */
+ assert(test_string("U+4567", XKB_KEY_NoSymbol)); /* ERR: Standard Unicode notation */
+ assert(test_string("U+4567ffff", XKB_KEY_NoSymbol));
+ assert(test_string("U+4567ffffff", XKB_KEY_NoSymbol));
+ assert(test_string("U-456", XKB_KEY_NoSymbol)); /* No negative number */
+ assert(test_string("U456w", XKB_KEY_NoSymbol)); /* Not hexadecimal digit */
+ assert(test_string("U4567 ", XKB_KEY_NoSymbol));
+ assert(test_string(" U4567", XKB_KEY_NoSymbol));
+ assert(test_string("U 4567", XKB_KEY_NoSymbol));
+ assert(test_string("U +4567", XKB_KEY_NoSymbol));
+ assert(test_string("u4567", XKB_KEY_NoSymbol)); /* Require XKB_KEYSYM_CASE_INSENSITIVE */
+
+ /* Hexadecimal: test ranges */
+ assert(test_string(STRINGIFY2(XKB_KEYSYM_MIN), XKB_KEY_NoSymbol)); /* Min keysym. */
+ assert(test_string("0x1", 0x00000001));
+ assert(test_string("0x01234567", 0x01234567));
+ assert(test_string("0x09abcdef", 0x09abcdef));
+ assert(test_string("0x01000100", 0x01000100)); /* Min Unicode. */
+ assert(test_string("0x0110ffff", 0x0110ffff)); /* Max Unicode. */
+ assert(test_string(STRINGIFY2(XKB_KEYSYM_MAX), XKB_KEYSYM_MAX)); /* Max keysym. */
+ assert(test_string("0x20000000", XKB_KEY_NoSymbol));
+ assert(test_string("0xffffffff", XKB_KEY_NoSymbol));