Added tests for Base64, Dice, EmToPx, FlipText, GoldenRatio, Guid, Periemeter, Roman, SigFigs, TitleCase, Unicode
2012-04-15 16:17:12 -07:00
|
|
|
#!/usr/bin/env perl
|
|
|
|
|
|
|
|
use strict;
|
|
|
|
use warnings;
|
|
|
|
use Test::More;
|
|
|
|
use DDG::Test::Goodie;
|
|
|
|
|
|
|
|
zci answer_type => 'unicode_conversion';
|
|
|
|
zci is_cached => 1;
|
|
|
|
|
|
|
|
ddg_goodie_test(
|
2013-01-25 23:11:03 -08:00
|
|
|
[
|
|
|
|
qw(DDG::Goodie::Unicode)
|
|
|
|
],
|
|
|
|
|
|
|
|
# Raw query, "U+XXXX"
|
Added tests for Base64, Dice, EmToPx, FlipText, GoldenRatio, Guid, Periemeter, Roman, SigFigs, TitleCase, Unicode
2012-04-15 16:17:12 -07:00
|
|
|
'U+263A' => test_zci("\x{263A} U+263A WHITE SMILING FACE, decimal: 9786, HTML: ☺, UTF-8: 0xE2 0x98 0xBA, block: Miscellaneous Symbols"),
|
2012-01-25 21:22:15 -08:00
|
|
|
'\u263A' => test_zci("\x{263A} U+263A WHITE SMILING FACE, decimal: 9786, HTML: ☺, UTF-8: 0xE2 0x98 0xBA, block: Miscellaneous Symbols"),
|
Added tests for Base64, Dice, EmToPx, FlipText, GoldenRatio, Guid, Periemeter, Roman, SigFigs, TitleCase, Unicode
2012-04-15 16:17:12 -07:00
|
|
|
|
2013-01-25 23:11:03 -08:00
|
|
|
# Same should work with the "unicode" start trigger too
|
2012-05-05 01:00:23 -07:00
|
|
|
'unicode U+263B' => test_zci("\x{263B} U+263B BLACK SMILING FACE, decimal: 9787, HTML: ☻, UTF-8: 0xE2 0x98 0xBB, block: Miscellaneous Symbols"),
|
|
|
|
|
2015-12-11 01:13:42 -08:00
|
|
|
# Lookup by name, "unicode LATIN SMALL LETTER A WITH CIRCUMFLEX"
|
2012-05-18 13:05:21 -07:00
|
|
|
"unicode White Smiling Face" => test_zci("\x{263A} U+263A WHITE SMILING FACE, decimal: 9786, HTML: ☺, UTF-8: 0xE2 0x98 0xBA, block: Miscellaneous Symbols"),
|
2012-05-05 01:00:23 -07:00
|
|
|
|
2015-12-11 01:13:42 -08:00
|
|
|
# Lookup by name, "utf-8 bullet"
|
|
|
|
"utf-8 bullet" => test_zci("\x{2022} U+2022 BULLET, decimal: 8226, HTML: •, UTF-8: 0xE2 0x80 0xA2, block: General Punctuation"),
|
|
|
|
|
|
|
|
# Lookup by name, "utf-16 smile"
|
|
|
|
"utf-16 smile" => test_zci("\x{2323} U+2323 SMILE, decimal: 8995, HTML: ⌣, UTF-8: 0xE2 0x8C 0xA3, block: Miscellaneous Technical"),
|
|
|
|
|
|
|
|
# Lookup by name, "utf-32 custard"
|
|
|
|
"utf-32 custard" => test_zci("\x{1F36E} U+1F36E CUSTARD, decimal: 127854, HTML: 🍮, UTF-8: 0xF0 0x9F 0x8D 0xAE, block: Miscellaneous Symbols And Pictographs"),
|
|
|
|
|
2015-12-22 07:26:43 -08:00
|
|
|
# Lookup by name, "emoji rocket"
|
|
|
|
"emoji rocket" => test_zci("\x{1F680} U+1F680 ROCKET, decimal: 128640, HTML: 🚀, UTF-8: 0xF0 0x9F 0x9A 0x80, block: Transport And Map Symbols"),
|
|
|
|
|
2013-01-25 23:11:03 -08:00
|
|
|
# Lookup by character, "unicode à"
|
2012-05-05 01:00:23 -07:00
|
|
|
"unicode \x{263B}" => test_zci("\x{263B} U+263B BLACK SMILING FACE, decimal: 9787, HTML: ☻, UTF-8: 0xE2 0x98 0xBB, block: Miscellaneous Symbols"),
|
2013-01-25 23:11:03 -08:00
|
|
|
|
2014-02-10 13:24:52 -08:00
|
|
|
'U+590c' => test_zci("\x{590C} U+590C CJK UNIFIED IDEOGRAPH-590C, decimal: 22796, HTML: 夌, UTF-8: 0xE5 0xA4 0x8C, script: Han, block: CJK Unified Ideographs"),
|
|
|
|
'unicode white smiling face' => test_zci("\x{263A} U+263A WHITE SMILING FACE, decimal: 9786, HTML: ☺, UTF-8: 0xE2 0x98 0xBA, block: Miscellaneous Symbols"),
|
2014-06-16 07:59:24 -07:00
|
|
|
|
|
|
|
'\x{2764}' => test_zci("\x{2764} U+2764 HEAVY BLACK HEART, decimal: 10084, HTML: ❤, UTF-8: 0xE2 0x9D 0xA4, block: Dingbats"),
|
2015-12-08 10:07:20 -08:00
|
|
|
|
2015-12-11 01:13:42 -08:00
|
|
|
'unicode unknown' => undef,
|
|
|
|
'utf-15 bullet' => undef
|
2012-05-05 01:00:23 -07:00
|
|
|
);
|
|
|
|
|
Added tests for Base64, Dice, EmToPx, FlipText, GoldenRatio, Guid, Periemeter, Roman, SigFigs, TitleCase, Unicode
2012-04-15 16:17:12 -07:00
|
|
|
done_testing;
|