tests.inc 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. /*
  2. Legal:
  3. Version: MPL 1.1
  4. The contents of this file are subject to the Mozilla Public License Version
  5. 1.1 the "License"; you may not use this file except in compliance with
  6. the License. You may obtain a copy of the License at
  7. http://www.mozilla.org/MPL/
  8. Software distributed under the License is distributed on an "AS IS" basis,
  9. WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
  10. for the specific language governing rights and limitations under the
  11. License.
  12. The Original Code is the YSI framework.
  13. The Initial Developer of the Original Code is Alex "Y_Less" Cole.
  14. Portions created by the Initial Developer are Copyright C 2011
  15. the Initial Developer. All Rights Reserved.
  16. Contributors:
  17. Y_Less
  18. koolk
  19. JoeBullet/Google63
  20. g_aSlice/Slice
  21. Misiur
  22. samphunter
  23. tianmeta
  24. maddinat0r
  25. spacemud
  26. Crayder
  27. Dayvison
  28. Ahmad45123
  29. Zeex
  30. irinel1996
  31. Yiin-
  32. Chaprnks
  33. Konstantinos
  34. Masterchen09
  35. Southclaws
  36. PatchwerkQWER
  37. m0k1
  38. paulommu
  39. udan111
  40. Thanks:
  41. JoeBullet/Google63 - Handy arbitrary ASM jump code using SCTRL.
  42. ZeeX - Very productive conversations.
  43. koolk - IsPlayerinAreaEx code.
  44. TheAlpha - Danish translation.
  45. breadfish - German translation.
  46. Fireburn - Dutch translation.
  47. yom - French translation.
  48. 50p - Polish translation.
  49. Zamaroht - Spanish translation.
  50. Los - Portuguese translation.
  51. Dracoblue, sintax, mabako, Xtreme, other coders - Producing other modes for
  52. me to strive to better.
  53. Pixels^ - Running XScripters where the idea was born.
  54. Matite - Pestering me to release it and using it.
  55. Very special thanks to:
  56. Thiadmer - PAWN, whose limits continue to amaze me!
  57. Kye/Kalcor - SA:MP.
  58. SA:MP Team past, present and future - SA:MP.
  59. Optional plugins:
  60. Gamer_Z - GPS.
  61. Incognito - Streamer.
  62. Me - sscanf2, fixes2, Whirlpool.
  63. */
  64. Test:y_punycode_1()
  65. {
  66. new
  67. dst[32];
  68. Puny_Encode(dst, "bücher");
  69. P:1("Test:y_punycode_1: dst = %s", dst);
  70. ASSERT(!strcmp(dst, "bcher-kva"));
  71. Puny_Encode(dst, "büücher");
  72. P:1("Test:y_punycode_1: dst = %s", dst);
  73. ASSERT(!strcmp(dst, "bcher-kvaa"));
  74. Puny_Encode(dst, "bücüher");
  75. P:1("Test:y_punycode_1: dst = %s", dst);
  76. ASSERT(!strcmp(dst, "bcher-kvab"));
  77. Puny_Encode(dst, "bücherü");
  78. P:1("Test:y_punycode_1: dst = %s", dst);
  79. ASSERT(!strcmp(dst, "bcher-kvae"));
  80. Puny_Encode(dst, "ýbücher");
  81. P:1("Test:y_punycode_1: dst = %s", dst);
  82. ASSERT(!strcmp(dst, "bcher-kvaf"));
  83. Puny_Encode(dst, "übücher");
  84. P:1("Test:y_punycode_1: dst = %s", dst);
  85. ASSERT(!strcmp(dst, "bcher-jvab"));
  86. }
  87. Test:y_punycode_2()
  88. {
  89. new
  90. dst[32],
  91. hash;
  92. Puny_EncodeHash(dst, "bücher", hash);
  93. P:1("Test:y_punycode_2: dst = %s", dst);
  94. ASSERT(!strcmp(dst, "bcher-kva"));
  95. Puny_EncodeHash(dst, "büCHer", hash);
  96. P:1("Test:y_punycode_2: dst = %s", dst);
  97. ASSERT(!strcmp(dst, "bcher-kva"));
  98. Puny_EncodeHash(dst, "BücHeR", hash);
  99. P:1("Test:y_punycode_2: dst = %s", dst);
  100. ASSERT(!strcmp(dst, "bcher-kva"));
  101. Puny_EncodeHash(dst, "bücHER", hash);
  102. P:1("Test:y_punycode_2: dst = %s", dst);
  103. ASSERT(!strcmp(dst, "bcher-kva"));
  104. Puny_EncodeHash(dst, "bÜcher", hash);
  105. P:1("Test:y_punycode_2: dst = %s", dst);
  106. ASSERT(!strcmp(dst, "bcher-kva"));
  107. }
  108. /*
  109. These all work in UTF-8, but can't be compiled in ANSI.
  110. xn--mgbh0fb.xn--kgbechtv http://مثال.إختبار Arabic Arabic
  111. xn--fsqu00a.xn--0zwm56d http://例�.测试 Simplified Chinese Chinese
  112. xn--fsqu00a.xn--g6w251d http://例�.測試 Traditional Chinese Chinese
  113. xn--hxajbheg2az3al.xn--jxalpdlp http://πα�άδειγμα.δοκιμή Greek Greek
  114. xn--p1b6ci4b4b3a.xn--11b5bs3a9aj6g http://उदाहरण.परीक�षा Devanagari Hindi
  115. xn--r8jz45g.xn--zckzah http://例�.テスト Kanji+Kana Japanese
  116. xn--9n2bp8q.xn--9t4b11yi5a http://실례.테스트 Hangul Korean
  117. xn--mgbh0fb.xn--hgbk6aj7f53bba http://مثال.آزمایشی Perso-Arabic Persian
  118. xn--e1afmkfd.xn--80akhbyknj4f http://пример.и�пытание Cyrillic Russian
  119. xn--zkc6cc5bi7f6e.xn--hlcj6aya9esc7a http://உதாரணம�.பரிட�சை Tamil Tamil
  120. xn--6dbbec0c.xn--deba0ad http://דוגמה.טעסט Hebrew Hebrew
  121. xn--fdbk5d8ap9b8a8d.xn--deba0ad http://בײַשפּיל.טעסט Hebrew Yiddish
  122. */