PhpSpreadsheet/tests/data/Calculation/TextData/CHAR.php
oleibman 957cb62dab
TextData Coverage and Minor Bug Fixes (#1744)
This had been intended to get 100% coverage for TextData functions, and it does that.
However, some minor bugs requiring source changes arose during testing.
- the Excel CHAR function restricts its argument to 1-255. PhpSpreadsheet CHARACTER
  had been allowing 0+. Also, there is no need to test if iconv exists,
  since it is part of Composer requirements.
- The DOLLAR function had been returning NUM for invalid arguments. Excel returns VALUE.
  Also, negative amounts were not being handled correctly.
- The FIXEDFORMAT function had been returning NUM for invalid arguments. Excel FIXED returns VALUE.
2020-12-10 18:35:26 +01:00

65 lines
737 B
PHP

<?php
return [
[
'#VALUE!',
'ABC',
],
[
'#VALUE!',
-5,
],
[
'#VALUE!',
0,
],
[
'A',
65,
],
[
'{',
123,
],
[
'~',
126,
],
[
'Á',
193,
],
[
'ÿ',
255,
],
[
'#VALUE!',
256,
],
[
'#VALUE!', // '⽇',
12103,
],
[
'#VALUE!', // 'œ',
0x153,
],
[
'#VALUE!', // 'ƒ',
0x192,
],
[
'#VALUE!', // '℅',
0x2105,
],
[
'#VALUE!', // '∑',
0x2211,
],
[
'#VALUE!', // '†',
0x2020,
],
];