diff --git a/hphp/test/ext/test_ext.h b/hphp/test/ext/test_ext.h index d5b1f7542..5b71d2076 100644 --- a/hphp/test/ext/test_ext.h +++ b/hphp/test/ext/test_ext.h @@ -36,7 +36,6 @@ #include "hphp/facebook/extensions/urlextraction/test_ext_urlextraction.h" #include "hphp/test/ext/test_ext_curl.h" #include "hphp/test/ext/test_ext_imagesprite.h" -#include "hphp/test/ext/test_ext_intl.h" #include "hphp/test/ext/test_ext_ipc.h" #include "hphp/test/ext/test_ext_json.h" #include "hphp/test/ext/test_ext_mailparse.h" diff --git a/hphp/test/ext/test_ext_intl.cpp b/hphp/test/ext/test_ext_intl.cpp deleted file mode 100644 index bc4e9e1c6..000000000 --- a/hphp/test/ext/test_ext_intl.cpp +++ /dev/null @@ -1,178 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | HipHop for PHP | - +----------------------------------------------------------------------+ - | Copyright (c) 2010-2013 Facebook, Inc. (http://www.facebook.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ -*/ - -#include "hphp/test/ext/test_ext_intl.h" -#include "hphp/runtime/ext/ext_intl.h" - -IMPLEMENT_SEP_EXTENSION_TEST(Intl); -/////////////////////////////////////////////////////////////////////////////// - -bool TestExtIntl::RunTests(const std::string &which) { - bool ret = true; - - RUN_TEST(test_intl_get_error_code); - RUN_TEST(test_intl_get_error_message); - RUN_TEST(test_intl_error_name); - RUN_TEST(test_intl_is_failure); - RUN_TEST(test_collator_asort); - RUN_TEST(test_collator_compare); - RUN_TEST(test_collator_create); - RUN_TEST(test_collator_get_attribute); - RUN_TEST(test_collator_get_error_code); - RUN_TEST(test_collator_get_error_message); - RUN_TEST(test_collator_get_locale); - RUN_TEST(test_collator_get_strength); - RUN_TEST(test_collator_set_attribute); - RUN_TEST(test_collator_set_strength); - RUN_TEST(test_collator_sort_with_sort_keys); - RUN_TEST(test_collator_sort); - RUN_TEST(test_idn_to_ascii); - RUN_TEST(test_idn_to_unicode); - RUN_TEST(test_idn_to_utf8); - RUN_TEST(test_Collator); - RUN_TEST(test_Locale); - RUN_TEST(test_Normalizer); - - return ret; -} - -/////////////////////////////////////////////////////////////////////////////// - -bool TestExtIntl::test_intl_get_error_code() { - return Count(true); -} - -bool TestExtIntl::test_intl_get_error_message() { - return Count(true); -} - -bool TestExtIntl::test_intl_error_name() { - return Count(true); -} - -bool TestExtIntl::test_intl_is_failure() { - return Count(true); -} - -bool TestExtIntl::test_collator_asort() { - return Count(true); -} - -bool TestExtIntl::test_collator_compare() { - return Count(true); -} - -bool TestExtIntl::test_collator_create() { - return Count(true); -} - -bool TestExtIntl::test_collator_get_attribute() { - return Count(true); -} - -bool TestExtIntl::test_collator_get_error_code() { - return Count(true); -} - -bool TestExtIntl::test_collator_get_error_message() { - return Count(true); -} - -bool TestExtIntl::test_collator_get_locale() { - return Count(true); -} - -bool TestExtIntl::test_collator_get_strength() { - return Count(true); -} - -bool TestExtIntl::test_collator_set_attribute() { - return Count(true); -} - -bool TestExtIntl::test_collator_set_strength() { - return Count(true); -} - -bool TestExtIntl::test_collator_sort_with_sort_keys() { - return Count(true); -} - -bool TestExtIntl::test_collator_sort() { - return Count(true); -} - -bool TestExtIntl::test_idn_to_ascii() { - VS(f_idn_to_ascii("www.m\xc3\xa5nsjonasson.se"), - "www.xn--mnsjonasson-x8a.se"); - VS(f_idn_to_ascii("www.facebook.com"), - "www.facebook.com"); - VS(f_idn_to_ascii("www.xn--m\xc3\xa5nsjonasson.se"), - false); - VS(f_idn_to_ascii("www.12345678901234567890123456789" - "012345678901234m\xc3\xa5nsjonasson.se"), - "www.xn--123456789012345678901234567890123456789" - "01234mnsjonasson-5we.se"); - VS(f_idn_to_ascii("www.12345678901234567890123456789" - "0123456789012345m\xc3\xa5nsjonasson.se"), - false); - VS(f_idn_to_ascii("\u1937ai\u18ed-\u18f0.tk", 1), - "xn--ai--youq53b.tk") - VS(f_idn_to_ascii("\u1937ai\u18ed-\u18f0.tk", 0), - false) - return Count(true); -} - -bool TestExtIntl::test_idn_to_unicode() { - VS(f_idn_to_unicode("www.xn--mnsjonasson-x8a.se"), - "www.m\xc3\xa5nsjonasson.se"); - VS(f_idn_to_unicode("www.facebook.com"), - "www.facebook.com"); - VS(f_idn_to_unicode("www.xn--12345678901234567890123456789" - "012345678901234mnsjonasson-5we.se"), - "www.12345678901234567890123456789" - "012345678901234m\xc3\xa5nsjonasson.se"); - return Count(true); -} - -bool TestExtIntl::test_idn_to_utf8() { - VS(f_idn_to_utf8("www.xn--mnsjonasson-x8a.se"), - "www.m\xc3\xa5nsjonasson.se"); - VS(f_idn_to_utf8("www.facebook.com"), - "www.facebook.com"); - VS(f_idn_to_utf8("www.xn--12345678901234567890123456789" - "012345678901234mnsjonasson-5we.se"), - "www.12345678901234567890123456789" - "012345678901234m\xc3\xa5nsjonasson.se"); - return Count(true); -} - -bool TestExtIntl::test_Collator() { - return Count(true); -} - -bool TestExtIntl::test_Locale() { - return Count(true); -} - -bool TestExtIntl::test_Normalizer() { - VERIFY(c_Normalizer::ti_isnormalized("\xC3\x85")); - VERIFY(!c_Normalizer::ti_isnormalized("A\xCC\x8A")); - VS(c_Normalizer::ti_normalize("A\xCC\x8A", q_Normalizer$$FORM_C), - "\xC3\x85"); - return Count(true); -} - diff --git a/hphp/test/ext/test_ext_intl.h b/hphp/test/ext/test_ext_intl.h deleted file mode 100644 index 79a7f836c..000000000 --- a/hphp/test/ext/test_ext_intl.h +++ /dev/null @@ -1,56 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | HipHop for PHP | - +----------------------------------------------------------------------+ - | Copyright (c) 2010-2013 Facebook, Inc. (http://www.facebook.com) | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is | - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ -*/ - -#ifndef incl_HPHP_TEST_EXT_INTL_H_ -#define incl_HPHP_TEST_EXT_INTL_H_ - -// >>>>>> Generated by idl.php. Do NOT modify. <<<<<< - -#include "hphp/test/ext/test_cpp_ext.h" - -/////////////////////////////////////////////////////////////////////////////// - -class TestExtIntl : public TestCppExt { - public: - virtual bool RunTests(const std::string &which); - - bool test_intl_get_error_code(); - bool test_intl_get_error_message(); - bool test_intl_error_name(); - bool test_intl_is_failure(); - bool test_collator_asort(); - bool test_collator_compare(); - bool test_collator_create(); - bool test_collator_get_attribute(); - bool test_collator_get_error_code(); - bool test_collator_get_error_message(); - bool test_collator_get_locale(); - bool test_collator_get_strength(); - bool test_collator_set_attribute(); - bool test_collator_set_strength(); - bool test_collator_sort_with_sort_keys(); - bool test_collator_sort(); - bool test_idn_to_ascii(); - bool test_idn_to_unicode(); - bool test_idn_to_utf8(); - bool test_Collator(); - bool test_Locale(); - bool test_Normalizer(); -}; - -/////////////////////////////////////////////////////////////////////////////// - -#endif // incl_HPHP_TEST_EXT_INTL_H_ diff --git a/hphp/test/slow/ext_intl/idn_to_ascii.php b/hphp/test/slow/ext_intl/idn_to_ascii.php new file mode 100644 index 000000000..9a0c1de58 --- /dev/null +++ b/hphp/test/slow/ext_intl/idn_to_ascii.php @@ -0,0 +1,21 @@ +