Remove ctype tests for oct/dec int literals

The way the integer literal is written in PHP is wholly irrelevant
to the ctype implementation. The actual behavior of different
integers is tested elsewhere already.
This commit is contained in:
Nikita Popov 2021-07-09 11:02:12 +02:00
parent 1a43094e6f
commit d60e3a2957
11 changed files with 0 additions and 650 deletions

View File

@ -1,57 +0,0 @@
--TEST--
Test ctype_alnum() function : usage variations - octal and hexadecimal values
--EXTENSIONS--
ctype
--FILE--
<?php
/*
* Pass octal and hexadecimal values to ctype_alnum() to test behaviour
*/
echo "*** Testing ctype_alnum() : usage variations ***\n";
$orig = setlocale(LC_CTYPE, "C");
$octal_values = array (060, 061, 062, 063);
$hex_values = array(0x30, 0x31, 0x32, 0x33);
echo "\n-- Octal Values --\n";
$iterator = 1;
foreach($octal_values as $c) {
echo "-- Iteration $iterator --\n";
var_dump(ctype_alnum($c));
$iterator++;
}
echo "\n-- Hexadecimal Values --\n";
$iterator = 1;
foreach($hex_values as $c) {
echo "-- Iteration $iterator --\n";
var_dump(ctype_alnum($c));
$iterator++;
}
setlocale(LC_CTYPE, $orig);
?>
--EXPECT--
*** Testing ctype_alnum() : usage variations ***
-- Octal Values --
-- Iteration 1 --
bool(true)
-- Iteration 2 --
bool(true)
-- Iteration 3 --
bool(true)
-- Iteration 4 --
bool(true)
-- Hexadecimal Values --
-- Iteration 1 --
bool(true)
-- Iteration 2 --
bool(true)
-- Iteration 3 --
bool(true)
-- Iteration 4 --
bool(true)

View File

@ -1,57 +0,0 @@
--TEST--
Test ctype_alpha() function : usage variations - Octal and hexadecimal values
--EXTENSIONS--
ctype
--FILE--
<?php
/*
* Pass octal and hexadecimal values to ctype_alpha() to test behaviour
*/
echo "*** Testing ctype_alpha() : usage variations ***\n";
$orig = setlocale(LC_CTYPE, "C");
$octal_values = array (0101, 0102, 0103, 0104);
$hex_values = array (0x41, 0x42, 0x43, 0x44);
echo "\n-- Octal Values --\n";
$iterator = 1;
foreach($octal_values as $c) {
echo "-- Iteration $iterator --\n";
var_dump(ctype_alpha($c));
$iterator++;
}
echo "\n-- Hexadecimal Values --\n";
$iterator = 1;
foreach($hex_values as $c) {
echo "-- Iteration $iterator --\n";
var_dump(ctype_alpha($c));
$iterator++;
}
setlocale(LC_CTYPE, $orig);
?>
--EXPECT--
*** Testing ctype_alpha() : usage variations ***
-- Octal Values --
-- Iteration 1 --
bool(true)
-- Iteration 2 --
bool(true)
-- Iteration 3 --
bool(true)
-- Iteration 4 --
bool(true)
-- Hexadecimal Values --
-- Iteration 1 --
bool(true)
-- Iteration 2 --
bool(true)
-- Iteration 3 --
bool(true)
-- Iteration 4 --
bool(true)

View File

@ -1,56 +0,0 @@
--TEST--
Test ctype_cntrl() function : usage variations - Octal and hexadecimal values
--EXTENSIONS--
ctype
--FILE--
<?php
/*
* Pass hexadecimal and octal values to ctype_cntrl() to test behaviour
*/
echo "*** Testing ctype_cntrl() : usage variations ***\n";
$orig = setlocale(LC_CTYPE, "C");
$octal_values = array(01, 02, 03, 04);
$hex_values = array(0x1, 0x2, 0x3, 0x4);
echo "\n-- Octal Values --\n";
$iterator = 1;
foreach($octal_values as $c) {
echo "-- Iteration $iterator --\n";
var_dump(ctype_cntrl($c));
$iterator++;
}
echo "\n-- Hexadecimal Values --\n";
$iterator = 1;
foreach($hex_values as $c) {
echo "-- Iteration $iterator --\n";
var_dump(ctype_cntrl($c));
$iterator++;
}
setlocale(LC_CTYPE, $orig);
?>
--EXPECT--
*** Testing ctype_cntrl() : usage variations ***
-- Octal Values --
-- Iteration 1 --
bool(true)
-- Iteration 2 --
bool(true)
-- Iteration 3 --
bool(true)
-- Iteration 4 --
bool(true)
-- Hexadecimal Values --
-- Iteration 1 --
bool(true)
-- Iteration 2 --
bool(true)
-- Iteration 3 --
bool(true)
-- Iteration 4 --
bool(true)

View File

@ -1,57 +0,0 @@
--TEST--
Test ctype_digit() function : usage variations - octal and hexadecimal values
--EXTENSIONS--
ctype
--FILE--
<?php
/*
* Pass octal and hexadecimal values as $c argument to ctype_digit() to test behaviour
*/
echo "*** Testing ctype_digit() : usage variations ***\n";
$orig = setlocale(LC_CTYPE, "C");
$octal_values = array(061, 062, 063, 064);
$hex_values = array (0x31, 0x32, 0x33, 0x34);
echo "\n-- Octal Values --\n";
$iterator = 1;
foreach($octal_values as $c) {
echo "-- Iteration $iterator --\n";
var_dump(ctype_digit($c));
$iterator++;
}
echo "\n-- Hexadecimal Values --\n";
$iterator = 1;
foreach($hex_values as $c) {
echo "-- Iteration $iterator --\n";
var_dump(ctype_digit($c));
$iterator++;
}
setlocale(LC_CTYPE, $orig);
?>
--EXPECT--
*** Testing ctype_digit() : usage variations ***
-- Octal Values --
-- Iteration 1 --
bool(true)
-- Iteration 2 --
bool(true)
-- Iteration 3 --
bool(true)
-- Iteration 4 --
bool(true)
-- Hexadecimal Values --
-- Iteration 1 --
bool(true)
-- Iteration 2 --
bool(true)
-- Iteration 3 --
bool(true)
-- Iteration 4 --
bool(true)

View File

@ -1,57 +0,0 @@
--TEST--
Test ctype_graph() function : usage variations - octal and hexadecimal values
--EXTENSIONS--
ctype
--FILE--
<?php
/*
* Pass octal and hexadecimal values to ctype_graph() to test behaviour
*/
echo "*** Testing ctype_graph() : usage variations ***\n";
$orig = setlocale(LC_CTYPE, "C");
$octal_values = array(061, 062, 063, 064);
$hex_values = array (0x31, 0x32, 0x33, 0x34);
echo "\n-- Octal Values --\n";
$iterator = 1;
foreach($octal_values as $c) {
echo "-- Iteration $iterator --\n";
var_dump(ctype_graph($c));
$iterator++;
}
echo "\n-- Hexadecimal Values --\n";
$iterator = 1;
foreach($hex_values as $c) {
echo "-- Iteration $iterator --\n";
var_dump(ctype_graph($c));
$iterator++;
}
setlocale(LC_CTYPE, $orig);
?>
--EXPECT--
*** Testing ctype_graph() : usage variations ***
-- Octal Values --
-- Iteration 1 --
bool(true)
-- Iteration 2 --
bool(true)
-- Iteration 3 --
bool(true)
-- Iteration 4 --
bool(true)
-- Hexadecimal Values --
-- Iteration 1 --
bool(true)
-- Iteration 2 --
bool(true)
-- Iteration 3 --
bool(true)
-- Iteration 4 --
bool(true)

View File

@ -1,57 +0,0 @@
--TEST--
Test ctype_lower() function : usage variations - octal and hexadecimal values
--EXTENSIONS--
ctype
--FILE--
<?php
/*
* Pass octal and hexadecimal values to ctype_lower() to test behaviour
*/
echo "*** Testing ctype_lower() : usage variations ***\n";
$orig = setlocale(LC_CTYPE, "C");
$octal_values = array(0141, 0142, 0143, 0144);
$hex_values = array (0x61, 0x62, 0x63, 0x64);
echo "\n-- Octal Values --\n";
$iterator = 1;
foreach($octal_values as $c) {
echo "-- Iteration $iterator --\n";
var_dump(ctype_lower($c));
$iterator++;
}
echo "\n-- Hexadecimal Values --\n";
$iterator = 1;
foreach($hex_values as $c) {
echo "-- Iteration $iterator --\n";
var_dump(ctype_lower($c));
$iterator++;
}
setlocale(LC_CTYPE, $orig);
?>
--EXPECT--
*** Testing ctype_lower() : usage variations ***
-- Octal Values --
-- Iteration 1 --
bool(true)
-- Iteration 2 --
bool(true)
-- Iteration 3 --
bool(true)
-- Iteration 4 --
bool(true)
-- Hexadecimal Values --
-- Iteration 1 --
bool(true)
-- Iteration 2 --
bool(true)
-- Iteration 3 --
bool(true)
-- Iteration 4 --
bool(true)

View File

@ -1,56 +0,0 @@
--TEST--
Test ctype_print() function : usage variations - octal and hexadecimal values
--EXTENSIONS--
ctype
--FILE--
<?php
/*
* Pass octal and hexadecimal values to ctype_print() to test behaviour
*/
echo "*** Testing ctype_print() : usage variations ***\n";
$orig = setlocale(LC_CTYPE, "C");
$octal_values = array(040, 041, 042, 043);
$hex_values = array (0x20, 0x21, 0x23, 0x24);
echo "\n-- Octal Values --\n";
$iterator = 1;
foreach($octal_values as $c) {
echo "-- Iteration $iterator --\n";
var_dump(ctype_print($c));
$iterator++;
}
echo "\n-- Hexadecimal Values --\n";
$iterator = 1;
foreach($hex_values as $c) {
echo "-- Iteration $iterator --\n";
var_dump(ctype_print($c));
$iterator++;
}
setlocale(LC_CTYPE, $orig);
?>
--EXPECT--
*** Testing ctype_print() : usage variations ***
-- Octal Values --
-- Iteration 1 --
bool(true)
-- Iteration 2 --
bool(true)
-- Iteration 3 --
bool(true)
-- Iteration 4 --
bool(true)
-- Hexadecimal Values --
-- Iteration 1 --
bool(true)
-- Iteration 2 --
bool(true)
-- Iteration 3 --
bool(true)
-- Iteration 4 --
bool(true)

View File

@ -1,57 +0,0 @@
--TEST--
Test ctype_punct() function : usage variations - Octal and Hexadecimal values
--EXTENSIONS--
ctype
--FILE--
<?php
/*
* Pass different octal and hexadecimal values to ctype_punct() to test behaviour
*/
echo "*** Testing ctype_punct() : usage variations ***\n";
$orig = setlocale(LC_CTYPE, "C");
$octal_values = array(041, 042, 043, 044);
$hex_values = array(0x21, 0x22, 0x23, 0x24);
echo "\n-- Octal Values --\n";
$iterator = 1;
foreach($octal_values as $c) {
echo "-- Iteration $iterator --\n";
var_dump(ctype_punct($c));
$iterator++;
}
echo "\n-- Hexadecimal Values --\n";
$iterator = 1;
foreach($hex_values as $c) {
echo "-- Iteration $iterator --\n";
var_dump(ctype_punct($c));
$iterator++;
}
setlocale(LC_CTYPE, $orig);
?>
--EXPECT--
*** Testing ctype_punct() : usage variations ***
-- Octal Values --
-- Iteration 1 --
bool(true)
-- Iteration 2 --
bool(true)
-- Iteration 3 --
bool(true)
-- Iteration 4 --
bool(true)
-- Hexadecimal Values --
-- Iteration 1 --
bool(true)
-- Iteration 2 --
bool(true)
-- Iteration 3 --
bool(true)
-- Iteration 4 --
bool(true)

View File

@ -1,64 +0,0 @@
--TEST--
Test ctype_space() function : usage variations - octal and hexadecimal values
--EXTENSIONS--
ctype
--FILE--
<?php
/*
* Pass octal and hexadecimal values as $c to ctype_space() to test behaviour
*/
echo "*** Testing ctype_space() : usage variations ***\n";
$orig = setlocale(LC_CTYPE, "C");
$octal_values = array (011, 012, 013, 014, 015, 040);
$hex_values = array (0x9, 0xA, 0xB, 0xC, 0xD, 0x20);
echo "\n-- Octal Values --\n";
$iterator = 1;
foreach($octal_values as $c) {
echo "-- Iteration $iterator --\n";
var_dump(ctype_space($c));
$iterator++;
}
echo "\n-- Hexadecimal Values --\n";
$iterator = 1;
foreach($hex_values as $c) {
echo "-- Iteration $iterator --\n";
var_dump(ctype_space($c));
$iterator++;
}
setlocale(LC_CTYPE, $orig);
?>
--EXPECT--
*** Testing ctype_space() : usage variations ***
-- Octal Values --
-- Iteration 1 --
bool(true)
-- Iteration 2 --
bool(true)
-- Iteration 3 --
bool(true)
-- Iteration 4 --
bool(true)
-- Iteration 5 --
bool(true)
-- Iteration 6 --
bool(true)
-- Hexadecimal Values --
-- Iteration 1 --
bool(true)
-- Iteration 2 --
bool(true)
-- Iteration 3 --
bool(true)
-- Iteration 4 --
bool(true)
-- Iteration 5 --
bool(true)
-- Iteration 6 --
bool(true)

View File

@ -1,56 +0,0 @@
--TEST--
Test ctype_upper() function : usage variations - octal and hexadecimal values
--EXTENSIONS--
ctype
--FILE--
<?php
/*
* Pass octal and hexadecimal values to ctype_upper() to test behaviour
*/
echo "*** Testing ctype_upper() : usage variations ***\n";
$orig = setlocale(LC_CTYPE, "C");
$octal_values = array(0101, 0102, 0103, 0104);
$hex_values = array(0x41, 0x42, 0x43, 0x44);
echo "\n-- Octal Values --\n";
$iterator = 1;
foreach($octal_values as $c) {
echo "-- Iteration $iterator --\n";
var_dump(ctype_upper($c));
$iterator++;
}
echo "\n-- Hexadecimal Values --\n";
$iterator = 1;
foreach($hex_values as $c) {
echo "-- Iteration $iterator --\n";
var_dump(ctype_upper($c));
$iterator++;
}
setlocale(LC_CTYPE, $orig);
?>
--EXPECT--
*** Testing ctype_upper() : usage variations ***
-- Octal Values --
-- Iteration 1 --
bool(true)
-- Iteration 2 --
bool(true)
-- Iteration 3 --
bool(true)
-- Iteration 4 --
bool(true)
-- Hexadecimal Values --
-- Iteration 1 --
bool(true)
-- Iteration 2 --
bool(true)
-- Iteration 3 --
bool(true)
-- Iteration 4 --
bool(true)

View File

@ -1,76 +0,0 @@
--TEST--
Test ctype_xdigit() function : usage variations - heaxadecimal and octal values
--EXTENSIONS--
ctype
--FILE--
<?php
/*
* Pass different hexadecimal and octal values that:
* 1. contain hexadecimal digits
* 2. correspond to character codes recognised as hexadecimal digits (see variation2)
* referred to as 'correct' integers below
*/
echo "*** Testing ctype_xdigit() : usage variations ***\n";
$orig = setlocale(LC_CTYPE, "C");
// contain hexadecimal digits but do not correspond to 'correct' ints
$octal_values1 = array(012, 013, 014, 015);
// correspond to 'correct' integers
$octal_values2 = array(061, 062, 063, 064);
// contain hexadecimal digits but do not correspond to 'correct' ints
$hex_values1 = array(0x1A, 0x1B, 0x1C, 0x1D);
//correspond to 'correct' integers
$hex_values2 = array(0x61, 0x62, 0x63, 0x64);
echo "\n-- Octal values --\n";
echo "'Incorrect' Integers: \n";
foreach($octal_values1 as $c) {
var_dump(ctype_xdigit($c));
}
echo "'Correct' Integers: \n";
foreach($octal_values2 as $c) {
var_dump(ctype_xdigit($c));
}
echo "\n-- Hexadecimal values --\n";
echo "'Incorrect' Integers: \n";
foreach($hex_values1 as $c) {
var_dump(ctype_xdigit($c));
}
echo "'Correct' Integers: \n";
foreach($hex_values2 as $c) {
var_dump(ctype_xdigit($c));
}
setlocale(LC_CTYPE, $orig);
?>
--EXPECT--
*** Testing ctype_xdigit() : usage variations ***
-- Octal values --
'Incorrect' Integers:
bool(false)
bool(false)
bool(false)
bool(false)
'Correct' Integers:
bool(true)
bool(true)
bool(true)
bool(true)
-- Hexadecimal values --
'Incorrect' Integers:
bool(false)
bool(false)
bool(false)
bool(false)
'Correct' Integers:
bool(true)
bool(true)
bool(true)
bool(true)