expand unicode trigger for \uXXXX syntax

master
Dylan Lloyd 2012-01-26 00:22:15 -05:00
parent 8994dd9308
commit b7e6dd5f3e
2 changed files with 2 additions and 1 deletions

View File

@ -16,7 +16,7 @@ topics 'programming';
use constant {
CODEPOINT_RE => qr/^ \s* U \+ (?<codepoint> [a-f0-9]{4,6}) \s* $/xi,
CODEPOINT_RE => qr/^ \s* (?:U \+|\\(?:u|x)) (?<codepoint> [a-f0-9]{4,6}) \s* $/xi,
NAME_RE => qr/^ (?<name> [A-Z][A-Z\s]+) $/xi,
CHAR_RE => qr/^ \s* (?<char> .) \s* $/x,
UNICODE_RE => qr/^ unicode \s+ (.+) $/xi,

View File

@ -15,6 +15,7 @@ ddg_goodie_test(
# Raw query, "U+XXXX"
'U+263A' => test_zci("\x{263A} U+263A WHITE SMILING FACE, decimal: 9786, HTML: &#9786;, UTF-8: 0xE2 0x98 0xBA, block: Miscellaneous Symbols"),
'\u263A' => test_zci("\x{263A} U+263A WHITE SMILING FACE, decimal: 9786, HTML: &#9786;, UTF-8: 0xE2 0x98 0xBA, block: Miscellaneous Symbols"),
# Same should work with the "unicode" start trigger too
'unicode U+263B' => test_zci("\x{263B} U+263B BLACK SMILING FACE, decimal: 9787, HTML: &#9787;, UTF-8: 0xE2 0x98 0xBB, block: Miscellaneous Symbols"),