Skip to content

Commit 304cde9

Browse files
committed
splitted the test
1 parent 2d0a52f commit 304cde9

16 files changed

+968
-983
lines changed

ext/bcmath/tests/bcceil.phpt

Lines changed: 17 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -24,72 +24,23 @@ $nums = [
2424
];
2525

2626
foreach ($nums as $num) {
27-
echo $num."\n";
28-
echo '=> '.bcceil($num)."\n\n";
29-
}
30-
31-
echo "========== value error ==========\n";
32-
try {
33-
bcceil('hoge');
34-
} catch (Throwable $e) {
35-
echo $e->getMessage()."\n";
36-
}
37-
38-
try {
39-
bcceil('0.00.1');
40-
} catch (Throwable $e) {
41-
echo $e->getMessage()."\n";
27+
echo str_pad("$num", 50), ' => ', bcceil($num), "\n";
4228
}
4329
?>
4430
--EXPECT--
45-
0
46-
=> 0
47-
48-
0.00
49-
=> 0
50-
51-
-0
52-
=> 0
53-
54-
-0.00
55-
=> 0
56-
57-
0.01
58-
=> 1
59-
60-
0.000000000000000000000000000000000000000001
61-
=> 1
62-
63-
-0.01
64-
=> 0
65-
66-
-0.000000000000000000000000000000000000000001
67-
=> 0
68-
69-
1
70-
=> 1
71-
72-
1.0000
73-
=> 1
74-
75-
1.0001
76-
=> 2
77-
78-
100000.000000000000000000000000000000000000000001
79-
=> 100001
80-
81-
-1
82-
=> -1
83-
84-
-1.0000
85-
=> -1
86-
87-
-1.0001
88-
=> -1
89-
90-
-100000.000000000000000000000000000000000000000001
91-
=> -100000
92-
93-
========== value error ==========
94-
bcceil(): Argument #1 ($num) is not well-formed
95-
bcceil(): Argument #1 ($num) is not well-formed
31+
0 => 0
32+
0.00 => 0
33+
-0 => 0
34+
-0.00 => 0
35+
0.01 => 1
36+
0.000000000000000000000000000000000000000001 => 1
37+
-0.01 => 0
38+
-0.000000000000000000000000000000000000000001 => 0
39+
1 => 1
40+
1.0000 => 1
41+
1.0001 => 2
42+
100000.000000000000000000000000000000000000000001 => 100001
43+
-1 => -1
44+
-1.0000 => -1
45+
-1.0001 => -1
46+
-100000.000000000000000000000000000000000000000001 => -100000

ext/bcmath/tests/bcceil_error.phpt

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
--TEST--
2+
bcceil() function with error
3+
--EXTENSIONS--
4+
bcmath
5+
--FILE--
6+
<?php
7+
try {
8+
bcceil('hoge');
9+
} catch (Throwable $e) {
10+
echo $e->getMessage()."\n";
11+
}
12+
13+
try {
14+
bcceil('0.00.1');
15+
} catch (Throwable $e) {
16+
echo $e->getMessage()."\n";
17+
}
18+
?>
19+
--EXPECT--
20+
bcceil(): Argument #1 ($num) is not well-formed
21+
bcceil(): Argument #1 ($num) is not well-formed

ext/bcmath/tests/bcfloor.phpt

Lines changed: 17 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -24,72 +24,23 @@ $nums = [
2424
];
2525

2626
foreach ($nums as $num) {
27-
echo $num."\n";
28-
echo '=> '.bcfloor($num)."\n\n";
29-
}
30-
31-
echo "========== value error ==========\n";
32-
try {
33-
bcfloor('hoge');
34-
} catch (Throwable $e) {
35-
echo $e->getMessage()."\n";
36-
}
37-
38-
try {
39-
bcfloor('0.00.1');
40-
} catch (Throwable $e) {
41-
echo $e->getMessage()."\n";
27+
echo str_pad("$num", 50), ' => ', bcfloor($num), "\n";
4228
}
4329
?>
4430
--EXPECT--
45-
0
46-
=> 0
47-
48-
0.00
49-
=> 0
50-
51-
-0
52-
=> 0
53-
54-
-0.00
55-
=> 0
56-
57-
0.01
58-
=> 0
59-
60-
0.000000000000000000000000000000000000000001
61-
=> 0
62-
63-
-0.01
64-
=> -1
65-
66-
-0.000000000000000000000000000000000000000001
67-
=> -1
68-
69-
1
70-
=> 1
71-
72-
1.0000
73-
=> 1
74-
75-
1.0001
76-
=> 1
77-
78-
100000.000000000000000000000000000000000000000001
79-
=> 100000
80-
81-
-1
82-
=> -1
83-
84-
-1.0000
85-
=> -1
86-
87-
-1.0001
88-
=> -2
89-
90-
-100000.000000000000000000000000000000000000000001
91-
=> -100001
92-
93-
========== value error ==========
94-
bcfloor(): Argument #1 ($num) is not well-formed
95-
bcfloor(): Argument #1 ($num) is not well-formed
31+
0 => 0
32+
0.00 => 0
33+
-0 => 0
34+
-0.00 => 0
35+
0.01 => 0
36+
0.000000000000000000000000000000000000000001 => 0
37+
-0.01 => -1
38+
-0.000000000000000000000000000000000000000001 => -1
39+
1 => 1
40+
1.0000 => 1
41+
1.0001 => 1
42+
100000.000000000000000000000000000000000000000001 => 100000
43+
-1 => -1
44+
-1.0000 => -1
45+
-1.0001 => -2
46+
-100000.000000000000000000000000000000000000000001 => -100001

ext/bcmath/tests/bcfloor_error.phpt

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
--TEST--
2+
bcfloor() function with error
3+
--EXTENSIONS--
4+
bcmath
5+
--FILE--
6+
<?php
7+
try {
8+
bcfloor('hoge');
9+
} catch (Throwable $e) {
10+
echo $e->getMessage()."\n";
11+
}
12+
13+
try {
14+
bcfloor('0.00.1');
15+
} catch (Throwable $e) {
16+
echo $e->getMessage()."\n";
17+
}
18+
?>
19+
--EXPECT--
20+
bcfloor(): Argument #1 ($num) is not well-formed
21+
bcfloor(): Argument #1 ($num) is not well-formed

0 commit comments

Comments
 (0)