Move TestExtCType to php
Esse commit está contido em:
@@ -36,7 +36,6 @@
|
||||
#include "hphp/facebook/extensions/urlextraction/test_ext_urlextraction.h"
|
||||
#include "hphp/test/ext/test_ext_bcmath.h"
|
||||
#include "hphp/test/ext/test_ext_bzip2.h"
|
||||
#include "hphp/test/ext/test_ext_ctype.h"
|
||||
#include "hphp/test/ext/test_ext_curl.h"
|
||||
#include "hphp/test/ext/test_ext_datetime.h"
|
||||
#include "hphp/test/ext/test_ext_debugger.h"
|
||||
|
||||
@@ -1,106 +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_ctype.h"
|
||||
#include "hphp/runtime/ext/ext_ctype.h"
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
bool TestExtCtype::RunTests(const std::string &which) {
|
||||
bool ret = true;
|
||||
|
||||
RUN_TEST(test_ctype_alnum);
|
||||
RUN_TEST(test_ctype_alpha);
|
||||
RUN_TEST(test_ctype_cntrl);
|
||||
RUN_TEST(test_ctype_digit);
|
||||
RUN_TEST(test_ctype_graph);
|
||||
RUN_TEST(test_ctype_lower);
|
||||
RUN_TEST(test_ctype_print);
|
||||
RUN_TEST(test_ctype_punct);
|
||||
RUN_TEST(test_ctype_space);
|
||||
RUN_TEST(test_ctype_upper);
|
||||
RUN_TEST(test_ctype_xdigit);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
bool TestExtCtype::test_ctype_alnum() {
|
||||
VERIFY(f_ctype_alnum("abc123"));
|
||||
VERIFY(!f_ctype_alnum("!@#$^"));
|
||||
return Count(true);
|
||||
}
|
||||
|
||||
bool TestExtCtype::test_ctype_alpha() {
|
||||
VERIFY(f_ctype_alpha("abcdef"));
|
||||
VERIFY(!f_ctype_alpha("abc123"));
|
||||
return Count(true);
|
||||
}
|
||||
|
||||
bool TestExtCtype::test_ctype_cntrl() {
|
||||
VERIFY(f_ctype_cntrl("\t\n\r"));
|
||||
VERIFY(!f_ctype_cntrl("abc123"));
|
||||
return Count(true);
|
||||
}
|
||||
|
||||
bool TestExtCtype::test_ctype_digit() {
|
||||
VERIFY(f_ctype_digit("123456"));
|
||||
VERIFY(!f_ctype_digit("abc123"));
|
||||
return Count(true);
|
||||
}
|
||||
|
||||
bool TestExtCtype::test_ctype_graph() {
|
||||
VERIFY(f_ctype_graph("!@#$^"));
|
||||
VERIFY(!f_ctype_graph("\b"));
|
||||
return Count(true);
|
||||
}
|
||||
|
||||
bool TestExtCtype::test_ctype_lower() {
|
||||
VERIFY(f_ctype_lower("abcdef"));
|
||||
VERIFY(!f_ctype_lower("ABCDEF"));
|
||||
return Count(true);
|
||||
}
|
||||
|
||||
bool TestExtCtype::test_ctype_print() {
|
||||
VERIFY(f_ctype_print("!@#$^"));
|
||||
VERIFY(!f_ctype_print("\b"));
|
||||
return Count(true);
|
||||
}
|
||||
|
||||
bool TestExtCtype::test_ctype_punct() {
|
||||
VERIFY(f_ctype_punct("!@#$^"));
|
||||
VERIFY(!f_ctype_punct("ABCDEF"));
|
||||
return Count(true);
|
||||
}
|
||||
|
||||
bool TestExtCtype::test_ctype_space() {
|
||||
VERIFY(f_ctype_space(" "));
|
||||
VERIFY(!f_ctype_space("a "));
|
||||
return Count(true);
|
||||
}
|
||||
|
||||
bool TestExtCtype::test_ctype_upper() {
|
||||
VERIFY(f_ctype_upper("ABCDEF"));
|
||||
VERIFY(!f_ctype_upper("abcdef"));
|
||||
return Count(true);
|
||||
}
|
||||
|
||||
bool TestExtCtype::test_ctype_xdigit() {
|
||||
VERIFY(f_ctype_xdigit("ABCDEF"));
|
||||
VERIFY(!f_ctype_xdigit("GHIJKL"));
|
||||
return Count(true);
|
||||
}
|
||||
@@ -1,45 +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_CTYPE_H_
|
||||
#define incl_HPHP_TEST_EXT_CTYPE_H_
|
||||
|
||||
// >>>>>> Generated by idl.php. Do NOT modify. <<<<<<
|
||||
|
||||
#include "hphp/test/ext/test_cpp_ext.h"
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
class TestExtCtype : public TestCppExt {
|
||||
public:
|
||||
virtual bool RunTests(const std::string &which);
|
||||
|
||||
bool test_ctype_alnum();
|
||||
bool test_ctype_alpha();
|
||||
bool test_ctype_cntrl();
|
||||
bool test_ctype_digit();
|
||||
bool test_ctype_graph();
|
||||
bool test_ctype_lower();
|
||||
bool test_ctype_print();
|
||||
bool test_ctype_punct();
|
||||
bool test_ctype_space();
|
||||
bool test_ctype_upper();
|
||||
bool test_ctype_xdigit();
|
||||
};
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#endif // incl_HPHP_TEST_EXT_CTYPE_H_
|
||||
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
var_dump(ctype_alnum("abc123"));
|
||||
var_dump(!ctype_alnum("!@#$^"));
|
||||
|
||||
var_dump(ctype_alpha("abcdef"));
|
||||
var_dump(!ctype_alpha("abc123"));
|
||||
|
||||
var_dump(ctype_cntrl("\t\n\r"));
|
||||
var_dump(!ctype_cntrl("abc123"));
|
||||
|
||||
var_dump(ctype_digit("123456"));
|
||||
var_dump(!ctype_digit("abc123"));
|
||||
|
||||
var_dump(ctype_graph("!@#$^"));
|
||||
var_dump(!ctype_graph("\x07"));
|
||||
|
||||
var_dump(ctype_lower("abcdef"));
|
||||
var_dump(!ctype_lower("ABCDEF"));
|
||||
|
||||
var_dump(ctype_print("!@#$^"));
|
||||
var_dump(!ctype_print("\x07"));
|
||||
|
||||
var_dump(ctype_punct("!@#$^"));
|
||||
var_dump(!ctype_punct("ABCDEF"));
|
||||
|
||||
var_dump(ctype_space(" "));
|
||||
var_dump(!ctype_space("a "));
|
||||
|
||||
var_dump(ctype_upper("ABCDEF"));
|
||||
var_dump(!ctype_upper("abcdef"));
|
||||
|
||||
var_dump(ctype_xdigit("ABCDEF"));
|
||||
var_dump(!ctype_xdigit("GHIJKL"));
|
||||
@@ -0,0 +1,22 @@
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
bool(true)
|
||||
Referência em uma Nova Issue
Bloquear um usuário