update 1.0.8.0

Commits for version update
This commit is contained in:
Manish Verma
2016-10-17 12:02:27 +05:30
parent dec927987b
commit 76e85db070
9674 changed files with 495757 additions and 58922 deletions

View File

@@ -0,0 +1,56 @@
<?php
class AutoloaderTest extends PHPUnit_Framework_TestCase
{
public function setUp()
{
if (!defined('PHPEXCEL_ROOT'))
{
define('PHPEXCEL_ROOT', APPLICATION_PATH . '/');
}
require_once(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
}
public function testAutoloaderNonPHPExcelClass()
{
$className = 'InvalidClass';
$result = PHPExcel_Autoloader::Load($className);
// Must return a boolean...
$this->assertTrue(is_bool($result));
// ... indicating failure
$this->assertFalse($result);
}
public function testAutoloaderInvalidPHPExcelClass()
{
$className = 'PHPExcel_Invalid_Class';
$result = PHPExcel_Autoloader::Load($className);
// Must return a boolean...
$this->assertTrue(is_bool($result));
// ... indicating failure
$this->assertFalse($result);
}
public function testAutoloadValidPHPExcelClass()
{
$className = 'PHPExcel_IOFactory';
$result = PHPExcel_Autoloader::Load($className);
// Check that class has been loaded
$this->assertTrue(class_exists($className));
}
public function testAutoloadInstantiateSuccess()
{
$result = new PHPExcel_Calculation_Function(1,2,3);
// Must return an object...
$this->assertTrue(is_object($result));
// ... of the correct type
$this->assertTrue(is_a($result,'PHPExcel_Calculation_Function'));
}
}

View File

@@ -0,0 +1,466 @@
<?php
require_once 'testDataFileIterator.php';
class DateTimeTest extends PHPUnit_Framework_TestCase
{
public function setUp()
{
if (!defined('PHPEXCEL_ROOT'))
{
define('PHPEXCEL_ROOT', APPLICATION_PATH . '/');
}
require_once(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
PHPExcel_Calculation_Functions::setCompatibilityMode(PHPExcel_Calculation_Functions::COMPATIBILITY_EXCEL);
}
/**
* @dataProvider providerDATE
*/
public function testDATE()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_DateTime','DATE'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
}
public function providerDATE()
{
return new testDataFileIterator('rawTestData/Calculation/DateTime/DATE.data');
}
public function testDATEtoPHP()
{
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_PHP_NUMERIC);
$result = PHPExcel_Calculation_DateTime::DATE(2012,1,31);
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_EXCEL);
$this->assertEquals(1327968000, $result, NULL, 1E-8);
}
public function testDATEtoPHPObject()
{
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_PHP_OBJECT);
$result = PHPExcel_Calculation_DateTime::DATE(2012,1,31);
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_EXCEL);
// Must return an object...
$this->assertTrue(is_object($result));
// ... of the correct type
$this->assertTrue(is_a($result,'DateTime'));
// ... with the correct value
$this->assertEquals($result->format('d-M-Y'),'31-Jan-2012');
}
public function testDATEwith1904Calendar()
{
PHPExcel_Shared_Date::setExcelCalendar(PHPExcel_Shared_Date::CALENDAR_MAC_1904);
$result = PHPExcel_Calculation_DateTime::DATE(1918,11,11);
PHPExcel_Shared_Date::setExcelCalendar(PHPExcel_Shared_Date::CALENDAR_WINDOWS_1900);
$this->assertEquals($result,5428);
}
public function testDATEwith1904CalendarError()
{
PHPExcel_Shared_Date::setExcelCalendar(PHPExcel_Shared_Date::CALENDAR_MAC_1904);
$result = PHPExcel_Calculation_DateTime::DATE(1901,1,31);
PHPExcel_Shared_Date::setExcelCalendar(PHPExcel_Shared_Date::CALENDAR_WINDOWS_1900);
$this->assertEquals($result,'#NUM!');
}
/**
* @dataProvider providerDATEVALUE
*/
public function testDATEVALUE()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_DateTime','DATEVALUE'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
}
public function providerDATEVALUE()
{
return new testDataFileIterator('rawTestData/Calculation/DateTime/DATEVALUE.data');
}
public function testDATEVALUEtoPHP()
{
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_PHP_NUMERIC);
$result = PHPExcel_Calculation_DateTime::DATEVALUE('2012-1-31');
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_EXCEL);
$this->assertEquals(1327968000, $result, NULL, 1E-8);
}
public function testDATEVALUEtoPHPObject()
{
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_PHP_OBJECT);
$result = PHPExcel_Calculation_DateTime::DATEVALUE('2012-1-31');
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_EXCEL);
// Must return an object...
$this->assertTrue(is_object($result));
// ... of the correct type
$this->assertTrue(is_a($result,'DateTime'));
// ... with the correct value
$this->assertEquals($result->format('d-M-Y'),'31-Jan-2012');
}
/**
* @dataProvider providerYEAR
*/
public function testYEAR()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_DateTime','YEAR'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
}
public function providerYEAR()
{
return new testDataFileIterator('rawTestData/Calculation/DateTime/YEAR.data');
}
/**
* @dataProvider providerMONTH
*/
public function testMONTH()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_DateTime','MONTHOFYEAR'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
}
public function providerMONTH()
{
return new testDataFileIterator('rawTestData/Calculation/DateTime/MONTH.data');
}
/**
* @dataProvider providerWEEKNUM
*/
public function testWEEKNUM()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_DateTime','WEEKOFYEAR'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
}
public function providerWEEKNUM()
{
return new testDataFileIterator('rawTestData/Calculation/DateTime/WEEKNUM.data');
}
/**
* @dataProvider providerWEEKDAY
*/
public function testWEEKDAY()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_DateTime','DAYOFWEEK'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
}
public function providerWEEKDAY()
{
return new testDataFileIterator('rawTestData/Calculation/DateTime/WEEKDAY.data');
}
/**
* @dataProvider providerDAY
*/
public function testDAY()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_DateTime','DAYOFMONTH'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
}
public function providerDAY()
{
return new testDataFileIterator('rawTestData/Calculation/DateTime/DAY.data');
}
/**
* @dataProvider providerTIME
*/
public function testTIME()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_DateTime','TIME'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
}
public function providerTIME()
{
return new testDataFileIterator('rawTestData/Calculation/DateTime/TIME.data');
}
public function testTIMEtoPHP()
{
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_PHP_NUMERIC);
$result = PHPExcel_Calculation_DateTime::TIME(7,30,20);
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_EXCEL);
$this->assertEquals(27020, $result, NULL, 1E-8);
}
public function testTIMEtoPHPObject()
{
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_PHP_OBJECT);
$result = PHPExcel_Calculation_DateTime::TIME(7,30,20);
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_EXCEL);
// Must return an object...
$this->assertTrue(is_object($result));
// ... of the correct type
$this->assertTrue(is_a($result,'DateTime'));
// ... with the correct value
$this->assertEquals($result->format('H:i:s'),'07:30:20');
}
/**
* @dataProvider providerTIMEVALUE
*/
public function testTIMEVALUE()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_DateTime','TIMEVALUE'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
}
public function providerTIMEVALUE()
{
return new testDataFileIterator('rawTestData/Calculation/DateTime/TIMEVALUE.data');
}
public function testTIMEVALUEtoPHP()
{
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_PHP_NUMERIC);
$result = PHPExcel_Calculation_DateTime::TIMEVALUE('7:30:20');
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_EXCEL);
$this->assertEquals(23420, $result, NULL, 1E-8);
}
public function testTIMEVALUEtoPHPObject()
{
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_PHP_OBJECT);
$result = PHPExcel_Calculation_DateTime::TIMEVALUE('7:30:20');
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_EXCEL);
// Must return an object...
$this->assertTrue(is_object($result));
// ... of the correct type
$this->assertTrue(is_a($result,'DateTime'));
// ... with the correct value
$this->assertEquals($result->format('H:i:s'),'07:30:20');
}
/**
* @dataProvider providerHOUR
*/
public function testHOUR()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_DateTime','HOUROFDAY'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
}
public function providerHOUR()
{
return new testDataFileIterator('rawTestData/Calculation/DateTime/HOUR.data');
}
/**
* @dataProvider providerMINUTE
*/
public function testMINUTE()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_DateTime','MINUTEOFHOUR'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
}
public function providerMINUTE()
{
return new testDataFileIterator('rawTestData/Calculation/DateTime/MINUTE.data');
}
/**
* @dataProvider providerSECOND
*/
public function testSECOND()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_DateTime','SECONDOFMINUTE'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
}
public function providerSECOND()
{
return new testDataFileIterator('rawTestData/Calculation/DateTime/SECOND.data');
}
/**
* @dataProvider providerNETWORKDAYS
*/
public function testNETWORKDAYS()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_DateTime','NETWORKDAYS'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
}
public function providerNETWORKDAYS()
{
return new testDataFileIterator('rawTestData/Calculation/DateTime/NETWORKDAYS.data');
}
/**
* @dataProvider providerWORKDAY
*/
public function testWORKDAY()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_DateTime','WORKDAY'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
}
public function providerWORKDAY()
{
return new testDataFileIterator('rawTestData/Calculation/DateTime/WORKDAY.data');
}
/**
* @dataProvider providerEDATE
*/
public function testEDATE()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_DateTime','EDATE'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
}
public function providerEDATE()
{
return new testDataFileIterator('rawTestData/Calculation/DateTime/EDATE.data');
}
public function testEDATEtoPHP()
{
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_PHP_NUMERIC);
$result = PHPExcel_Calculation_DateTime::EDATE('2012-1-26',-1);
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_EXCEL);
$this->assertEquals(1324857600, $result, NULL, 1E-8);
}
public function testEDATEtoPHPObject()
{
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_PHP_OBJECT);
$result = PHPExcel_Calculation_DateTime::EDATE('2012-1-26',-1);
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_EXCEL);
// Must return an object...
$this->assertTrue(is_object($result));
// ... of the correct type
$this->assertTrue(is_a($result,'DateTime'));
// ... with the correct value
$this->assertEquals($result->format('d-M-Y'),'26-Dec-2011');
}
/**
* @dataProvider providerEOMONTH
*/
public function testEOMONTH()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_DateTime','EOMONTH'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
}
public function providerEOMONTH()
{
return new testDataFileIterator('rawTestData/Calculation/DateTime/EOMONTH.data');
}
public function testEOMONTHtoPHP()
{
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_PHP_NUMERIC);
$result = PHPExcel_Calculation_DateTime::EOMONTH('2012-1-26',-1);
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_EXCEL);
$this->assertEquals(1325289600, $result, NULL, 1E-8);
}
public function testEOMONTHtoPHPObject()
{
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_PHP_OBJECT);
$result = PHPExcel_Calculation_DateTime::EOMONTH('2012-1-26',-1);
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_EXCEL);
// Must return an object...
$this->assertTrue(is_object($result));
// ... of the correct type
$this->assertTrue(is_a($result,'DateTime'));
// ... with the correct value
$this->assertEquals($result->format('d-M-Y'),'31-Dec-2011');
}
/**
* @dataProvider providerDATEDIF
*/
public function testDATEDIF()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_DateTime','DATEDIF'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
}
public function providerDATEDIF()
{
return new testDataFileIterator('rawTestData/Calculation/DateTime/DATEDIF.data');
}
/**
* @dataProvider providerDAYS360
*/
public function testDAYS360()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_DateTime','DAYS360'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
}
public function providerDAYS360()
{
return new testDataFileIterator('rawTestData/Calculation/DateTime/DAYS360.data');
}
/**
* @dataProvider providerYEARFRAC
*/
public function testYEARFRAC()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_DateTime','YEARFRAC'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
}
public function providerYEARFRAC()
{
return new testDataFileIterator('rawTestData/Calculation/DateTime/YEARFRAC.data');
}
}

View File

@@ -0,0 +1,698 @@
<?php
// Custom assertion class for handling precision of Complex numbers
require_once 'custom/complexAssert.php';
// Data Provider handler
require_once 'testDataFileIterator.php';
class EngineeringTest extends PHPUnit_Framework_TestCase
{
public function setUp()
{
if (!defined('PHPEXCEL_ROOT'))
{
define('PHPEXCEL_ROOT', APPLICATION_PATH . '/');
}
require_once(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
PHPExcel_Calculation_Functions::setCompatibilityMode(PHPExcel_Calculation_Functions::COMPATIBILITY_EXCEL);
}
/**
* @dataProvider providerBESSELI
*/
public function testBESSELI()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Engineering','BESSELI'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
}
public function providerBESSELI()
{
return new testDataFileIterator('rawTestData/Calculation/Engineering/BESSELI.data');
}
/**
* @dataProvider providerBESSELJ
*/
public function testBESSELJ()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Engineering','BESSELJ'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
}
public function providerBESSELJ()
{
return new testDataFileIterator('rawTestData/Calculation/Engineering/BESSELJ.data');
}
/**
* @dataProvider providerBESSELK
*/
public function testBESSELK()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Engineering','BESSELK'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
}
public function providerBESSELK()
{
return new testDataFileIterator('rawTestData/Calculation/Engineering/BESSELK.data');
}
/**
* @dataProvider providerBESSELY
*/
public function testBESSELY()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Engineering','BESSELY'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
}
public function providerBESSELY()
{
return new testDataFileIterator('rawTestData/Calculation/Engineering/BESSELY.data');
}
/**
* @dataProvider providerCOMPLEX
*/
public function testCOMPLEX()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Engineering','COMPLEX'),$args);
$this->assertEquals($expectedResult, $result);
}
public function providerCOMPLEX()
{
return new testDataFileIterator('rawTestData/Calculation/Engineering/COMPLEX.data');
}
/**
* @dataProvider providerIMAGINARY
*/
public function testIMAGINARY()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Engineering','IMAGINARY'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
}
public function providerIMAGINARY()
{
return new testDataFileIterator('rawTestData/Calculation/Engineering/IMAGINARY.data');
}
/**
* @dataProvider providerIMREAL
*/
public function testIMREAL()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Engineering','IMREAL'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
}
public function providerIMREAL()
{
return new testDataFileIterator('rawTestData/Calculation/Engineering/IMREAL.data');
}
/**
* @dataProvider providerIMABS
*/
public function testIMABS()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Engineering','IMABS'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
}
public function providerIMABS()
{
return new testDataFileIterator('rawTestData/Calculation/Engineering/IMABS.data');
}
/**
* @dataProvider providerIMARGUMENT
*/
public function testIMARGUMENT()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Engineering','IMARGUMENT'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
}
public function providerIMARGUMENT()
{
return new testDataFileIterator('rawTestData/Calculation/Engineering/IMARGUMENT.data');
}
/**
* @dataProvider providerIMCONJUGATE
*/
public function testIMCONJUGATE()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Engineering','IMCONJUGATE'),$args);
$complexAssert = new complexAssert();
$this->assertTrue($complexAssert->assertComplexEquals($expectedResult, $result, 1E-8),
$complexAssert->getErrorMessage());
}
public function providerIMCONJUGATE()
{
return new testDataFileIterator('rawTestData/Calculation/Engineering/IMCONJUGATE.data');
}
/**
* @dataProvider providerIMCOS
*/
public function testIMCOS()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Engineering','IMCOS'),$args);
$complexAssert = new complexAssert();
$this->assertTrue($complexAssert->assertComplexEquals($expectedResult, $result, 1E-8),
$complexAssert->getErrorMessage());
}
public function providerIMCOS()
{
return new testDataFileIterator('rawTestData/Calculation/Engineering/IMCOS.data');
}
/**
* @dataProvider providerIMDIV
*/
public function testIMDIV()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Engineering','IMDIV'),$args);
$complexAssert = new complexAssert();
$this->assertTrue($complexAssert->assertComplexEquals($expectedResult, $result, 1E-8),
$complexAssert->getErrorMessage());
}
public function providerIMDIV()
{
return new testDataFileIterator('rawTestData/Calculation/Engineering/IMDIV.data');
}
/**
* @dataProvider providerIMEXP
*/
public function testIMEXP()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Engineering','IMEXP'),$args);
$complexAssert = new complexAssert();
$this->assertTrue($complexAssert->assertComplexEquals($expectedResult, $result, 1E-8),
$complexAssert->getErrorMessage());
}
public function providerIMEXP()
{
return new testDataFileIterator('rawTestData/Calculation/Engineering/IMEXP.data');
}
/**
* @dataProvider providerIMLN
*/
public function testIMLN()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Engineering','IMLN'),$args);
$complexAssert = new complexAssert();
$this->assertTrue($complexAssert->assertComplexEquals($expectedResult, $result, 1E-8),
$complexAssert->getErrorMessage());
}
public function providerIMLN()
{
return new testDataFileIterator('rawTestData/Calculation/Engineering/IMLN.data');
}
/**
* @dataProvider providerIMLOG2
*/
public function testIMLOG2()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Engineering','IMLOG2'),$args);
$complexAssert = new complexAssert();
$this->assertTrue($complexAssert->assertComplexEquals($expectedResult, $result, 1E-8),
$complexAssert->getErrorMessage());
}
public function providerIMLOG2()
{
return new testDataFileIterator('rawTestData/Calculation/Engineering/IMLOG2.data');
}
/**
* @dataProvider providerIMLOG10
*/
public function testIMLOG10()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Engineering','IMLOG10'),$args);
$complexAssert = new complexAssert();
$this->assertTrue($complexAssert->assertComplexEquals($expectedResult, $result, 1E-8),
$complexAssert->getErrorMessage());
}
public function providerIMLOG10()
{
return new testDataFileIterator('rawTestData/Calculation/Engineering/IMLOG10.data');
}
/**
* @dataProvider providerIMPOWER
*/
public function testIMPOWER()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Engineering','IMPOWER'),$args);
$complexAssert = new complexAssert();
$this->assertTrue($complexAssert->assertComplexEquals($expectedResult, $result, 1E-8),
$complexAssert->getErrorMessage());
}
public function providerIMPOWER()
{
return new testDataFileIterator('rawTestData/Calculation/Engineering/IMPOWER.data');
}
/**
* @dataProvider providerIMPRODUCT
*/
public function testIMPRODUCT()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Engineering','IMPRODUCT'),$args);
$complexAssert = new complexAssert();
$this->assertTrue($complexAssert->assertComplexEquals($expectedResult, $result, 1E-8),
$complexAssert->getErrorMessage());
}
public function providerIMPRODUCT()
{
return new testDataFileIterator('rawTestData/Calculation/Engineering/IMPRODUCT.data');
}
/**
* @dataProvider providerIMSIN
*/
public function testIMSIN()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Engineering','IMSIN'),$args);
$complexAssert = new complexAssert();
$this->assertTrue($complexAssert->assertComplexEquals($expectedResult, $result, 1E-8),
$complexAssert->getErrorMessage());
}
public function providerIMSIN()
{
return new testDataFileIterator('rawTestData/Calculation/Engineering/IMSIN.data');
}
/**
* @dataProvider providerIMSQRT
*/
public function testIMSQRT()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Engineering','IMSQRT'),$args);
$complexAssert = new complexAssert();
$this->assertTrue($complexAssert->assertComplexEquals($expectedResult, $result, 1E-8),
$complexAssert->getErrorMessage());
}
public function providerIMSQRT()
{
return new testDataFileIterator('rawTestData/Calculation/Engineering/IMSQRT.data');
}
/**
* @dataProvider providerIMSUB
*/
public function testIMSUB()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Engineering','IMSUB'),$args);
$complexAssert = new complexAssert();
$this->assertTrue($complexAssert->assertComplexEquals($expectedResult, $result, 1E-8),
$complexAssert->getErrorMessage());
}
public function providerIMSUB()
{
return new testDataFileIterator('rawTestData/Calculation/Engineering/IMSUB.data');
}
/**
* @dataProvider providerIMSUM
*/
public function testIMSUM()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Engineering','IMSUM'),$args);
$complexAssert = new complexAssert();
$this->assertTrue($complexAssert->assertComplexEquals($expectedResult, $result, 1E-8),
$complexAssert->getErrorMessage());
}
public function providerIMSUM()
{
return new testDataFileIterator('rawTestData/Calculation/Engineering/IMSUM.data');
}
/**
* @dataProvider providerERF
*/
public function testERF()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Engineering','ERF'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
}
public function providerERF()
{
return new testDataFileIterator('rawTestData/Calculation/Engineering/ERF.data');
}
/**
* @dataProvider providerERFC
*/
public function testERFC()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Engineering','ERFC'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
}
public function providerERFC()
{
return new testDataFileIterator('rawTestData/Calculation/Engineering/ERFC.data');
}
/**
* @dataProvider providerBIN2DEC
*/
public function testBIN2DEC()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Engineering','BINTODEC'),$args);
$this->assertEquals($expectedResult, $result);
}
public function providerBIN2DEC()
{
return new testDataFileIterator('rawTestData/Calculation/Engineering/BIN2DEC.data');
}
/**
* @dataProvider providerBIN2HEX
*/
public function testBIN2HEX()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Engineering','BINTOHEX'),$args);
$this->assertEquals($expectedResult, $result);
}
public function providerBIN2HEX()
{
return new testDataFileIterator('rawTestData/Calculation/Engineering/BIN2HEX.data');
}
/**
* @dataProvider providerBIN2OCT
*/
public function testBIN2OCT()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Engineering','BINTOOCT'),$args);
$this->assertEquals($expectedResult, $result);
}
public function providerBIN2OCT()
{
return new testDataFileIterator('rawTestData/Calculation/Engineering/BIN2OCT.data');
}
/**
* @dataProvider providerDEC2BIN
*/
public function testDEC2BIN()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Engineering','DECTOBIN'),$args);
$this->assertEquals($expectedResult, $result, NULL);
}
public function providerDEC2BIN()
{
return new testDataFileIterator('rawTestData/Calculation/Engineering/DEC2BIN.data');
}
/**
* @dataProvider providerDEC2HEX
*/
public function testDEC2HEX()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Engineering','DECTOHEX'),$args);
$this->assertEquals($expectedResult, $result, NULL);
}
public function providerDEC2HEX()
{
return new testDataFileIterator('rawTestData/Calculation/Engineering/DEC2HEX.data');
}
/**
* @dataProvider providerDEC2OCT
*/
public function testDEC2OCT()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Engineering','DECTOOCT'),$args);
$this->assertEquals($expectedResult, $result, NULL);
}
public function providerDEC2OCT()
{
return new testDataFileIterator('rawTestData/Calculation/Engineering/DEC2OCT.data');
}
/**
* @dataProvider providerHEX2BIN
*/
public function testHEX2BIN()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Engineering','HEXTOBIN'),$args);
$this->assertEquals($expectedResult, $result, NULL);
}
public function providerHEX2BIN()
{
return new testDataFileIterator('rawTestData/Calculation/Engineering/HEX2BIN.data');
}
/**
* @dataProvider providerHEX2DEC
*/
public function testHEX2DEC()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Engineering','HEXTODEC'),$args);
$this->assertEquals($expectedResult, $result, NULL);
}
public function providerHEX2DEC()
{
return new testDataFileIterator('rawTestData/Calculation/Engineering/HEX2DEC.data');
}
/**
* @dataProvider providerHEX2OCT
*/
public function testHEX2OCT()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Engineering','HEXTOOCT'),$args);
$this->assertEquals($expectedResult, $result, NULL);
}
public function providerHEX2OCT()
{
return new testDataFileIterator('rawTestData/Calculation/Engineering/HEX2OCT.data');
}
/**
* @dataProvider providerOCT2BIN
*/
public function testOCT2BIN()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Engineering','OCTTOBIN'),$args);
$this->assertEquals($expectedResult, $result, NULL);
}
public function providerOCT2BIN()
{
return new testDataFileIterator('rawTestData/Calculation/Engineering/OCT2BIN.data');
}
/**
* @dataProvider providerOCT2DEC
*/
public function testOCT2DEC()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Engineering','OCTTODEC'),$args);
$this->assertEquals($expectedResult, $result, NULL);
}
public function providerOCT2DEC()
{
return new testDataFileIterator('rawTestData/Calculation/Engineering/OCT2DEC.data');
}
/**
* @dataProvider providerOCT2HEX
*/
public function testOCT2HEX()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Engineering','OCTTOHEX'),$args);
$this->assertEquals($expectedResult, $result, NULL);
}
public function providerOCT2HEX()
{
return new testDataFileIterator('rawTestData/Calculation/Engineering/OCT2HEX.data');
}
/**
* @dataProvider providerDELTA
*/
public function testDELTA()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Engineering','DELTA'),$args);
$this->assertEquals($expectedResult, $result, NULL);
}
public function providerDELTA()
{
return new testDataFileIterator('rawTestData/Calculation/Engineering/DELTA.data');
}
/**
* @dataProvider providerGESTEP
*/
public function testGESTEP()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Engineering','GESTEP'),$args);
$this->assertEquals($expectedResult, $result, NULL);
}
public function providerGESTEP()
{
return new testDataFileIterator('rawTestData/Calculation/Engineering/GESTEP.data');
}
public function testGetConversionGroups()
{
$result = PHPExcel_Calculation_Engineering::getConversionGroups();
$this->assertInternalType('array', $result);
}
public function testGetConversionGroupUnits()
{
$result = PHPExcel_Calculation_Engineering::getConversionGroupUnits();
$this->assertInternalType('array', $result);
}
public function testGetConversionGroupUnitDetails()
{
$result = PHPExcel_Calculation_Engineering::getConversionGroupUnitDetails();
$this->assertInternalType('array', $result);
}
public function testGetConversionMultipliers()
{
$result = PHPExcel_Calculation_Engineering::getConversionMultipliers();
$this->assertInternalType('array', $result);
}
/**
* @dataProvider providerCONVERTUOM
*/
public function testCONVERTUOM()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Engineering','CONVERTUOM'),$args);
$this->assertEquals($expectedResult, $result, NULL);
}
public function providerCONVERTUOM()
{
return new testDataFileIterator('rawTestData/Calculation/Engineering/CONVERTUOM.data');
}
}

View File

@@ -0,0 +1,516 @@
<?php
require_once 'testDataFileIterator.php';
class FinancialTest extends PHPUnit_Framework_TestCase
{
public function setUp()
{
if (!defined('PHPEXCEL_ROOT'))
{
define('PHPEXCEL_ROOT', APPLICATION_PATH . '/');
}
require_once(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
PHPExcel_Calculation_Functions::setCompatibilityMode(PHPExcel_Calculation_Functions::COMPATIBILITY_EXCEL);
}
/**
* @dataProvider providerACCRINT
*/
public function testACCRINT()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Financial','ACCRINT'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
}
public function providerACCRINT()
{
return new testDataFileIterator('rawTestData/Calculation/Financial/ACCRINT.data');
}
/**
* @dataProvider providerACCRINTM
*/
public function testACCRINTM()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Financial','ACCRINTM'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
}
public function providerACCRINTM()
{
return new testDataFileIterator('rawTestData/Calculation/Financial/ACCRINTM.data');
}
/**
* @dataProvider providerAMORDEGRC
*/
public function testAMORDEGRC()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Financial','AMORDEGRC'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
}
public function providerAMORDEGRC()
{
return new testDataFileIterator('rawTestData/Calculation/Financial/AMORDEGRC.data');
}
/**
* @dataProvider providerAMORLINC
*/
public function testAMORLINC()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Financial','AMORLINC'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
}
public function providerAMORLINC()
{
return new testDataFileIterator('rawTestData/Calculation/Financial/AMORLINC.data');
}
/**
* @dataProvider providerCOUPDAYBS
*/
public function testCOUPDAYBS()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Financial','COUPDAYBS'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
}
public function providerCOUPDAYBS()
{
return new testDataFileIterator('rawTestData/Calculation/Financial/COUPDAYBS.data');
}
/**
* @dataProvider providerCOUPDAYS
*/
public function testCOUPDAYS()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Financial','COUPDAYS'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
}
public function providerCOUPDAYS()
{
return new testDataFileIterator('rawTestData/Calculation/Financial/COUPDAYS.data');
}
/**
* @dataProvider providerCOUPDAYSNC
*/
public function testCOUPDAYSNC()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Financial','COUPDAYSNC'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
}
public function providerCOUPDAYSNC()
{
return new testDataFileIterator('rawTestData/Calculation/Financial/COUPDAYSNC.data');
}
/**
* @dataProvider providerCOUPNCD
*/
public function testCOUPNCD()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Financial','COUPNCD'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
}
public function providerCOUPNCD()
{
return new testDataFileIterator('rawTestData/Calculation/Financial/COUPNCD.data');
}
/**
* @dataProvider providerCOUPNUM
*/
public function testCOUPNUM()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Financial','COUPNUM'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
}
public function providerCOUPNUM()
{
return new testDataFileIterator('rawTestData/Calculation/Financial/COUPNUM.data');
}
/**
* @dataProvider providerCOUPPCD
*/
public function testCOUPPCD()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Financial','COUPPCD'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
}
public function providerCOUPPCD()
{
return new testDataFileIterator('rawTestData/Calculation/Financial/COUPPCD.data');
}
/**
* @dataProvider providerCUMIPMT
*/
public function testCUMIPMT()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Financial','CUMIPMT'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
}
public function providerCUMIPMT()
{
return new testDataFileIterator('rawTestData/Calculation/Financial/CUMIPMT.data');
}
/**
* @dataProvider providerCUMPRINC
*/
public function testCUMPRINC()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Financial','CUMPRINC'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
}
public function providerCUMPRINC()
{
return new testDataFileIterator('rawTestData/Calculation/Financial/CUMPRINC.data');
}
/**
* @dataProvider providerDB
*/
public function testDB()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Financial','DB'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
}
public function providerDB()
{
return new testDataFileIterator('rawTestData/Calculation/Financial/DB.data');
}
/**
* @dataProvider providerDDB
*/
public function testDDB()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Financial','DDB'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
}
public function providerDDB()
{
return new testDataFileIterator('rawTestData/Calculation/Financial/DDB.data');
}
/**
* @dataProvider providerDISC
*/
public function testDISC()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Financial','DISC'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
}
public function providerDISC()
{
return new testDataFileIterator('rawTestData/Calculation/Financial/DISC.data');
}
/**
* @dataProvider providerDOLLARDE
*/
public function testDOLLARDE()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Financial','DOLLARDE'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
}
public function providerDOLLARDE()
{
return new testDataFileIterator('rawTestData/Calculation/Financial/DOLLARDE.data');
}
/**
* @dataProvider providerDOLLARFR
*/
public function testDOLLARFR()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Financial','DOLLARFR'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
}
public function providerDOLLARFR()
{
return new testDataFileIterator('rawTestData/Calculation/Financial/DOLLARFR.data');
}
/**
* @dataProvider providerEFFECT
*/
public function testEFFECT()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Financial','EFFECT'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
}
public function providerEFFECT()
{
return new testDataFileIterator('rawTestData/Calculation/Financial/EFFECT.data');
}
/**
* @dataProvider providerFV
*/
public function testFV()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Financial','FV'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
}
public function providerFV()
{
return new testDataFileIterator('rawTestData/Calculation/Financial/FV.data');
}
/**
* @dataProvider providerFVSCHEDULE
*/
public function testFVSCHEDULE()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Financial','FVSCHEDULE'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
}
public function providerFVSCHEDULE()
{
return new testDataFileIterator('rawTestData/Calculation/Financial/FVSCHEDULE.data');
}
/**
* @dataProvider providerINTRATE
*/
public function testINTRATE()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Financial','INTRATE'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
}
public function providerINTRATE()
{
return new testDataFileIterator('rawTestData/Calculation/Financial/INTRATE.data');
}
/**
* @dataProvider providerIPMT
*/
public function testIPMT()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Financial','IPMT'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
}
public function providerIPMT()
{
return new testDataFileIterator('rawTestData/Calculation/Financial/IPMT.data');
}
/**
* @dataProvider providerIRR
*/
public function testIRR()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Financial','IRR'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
}
public function providerIRR()
{
return new testDataFileIterator('rawTestData/Calculation/Financial/IRR.data');
}
/**
* @dataProvider providerISPMT
*/
public function testISPMT()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Financial','ISPMT'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
}
public function providerISPMT()
{
return new testDataFileIterator('rawTestData/Calculation/Financial/ISPMT.data');
}
/**
* @dataProvider providerMIRR
*/
public function testMIRR()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Financial','MIRR'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
}
public function providerMIRR()
{
return new testDataFileIterator('rawTestData/Calculation/Financial/MIRR.data');
}
/**
* @dataProvider providerNOMINAL
*/
public function testNOMINAL()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Financial','NOMINAL'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
}
public function providerNOMINAL()
{
return new testDataFileIterator('rawTestData/Calculation/Financial/NOMINAL.data');
}
/**
* @dataProvider providerNPER
*/
public function testNPER()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Financial','NPER'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
}
public function providerNPER()
{
return new testDataFileIterator('rawTestData/Calculation/Financial/NPER.data');
}
/**
* @dataProvider providerNPV
*/
public function testNPV()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Financial','NPV'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
}
public function providerNPV()
{
return new testDataFileIterator('rawTestData/Calculation/Financial/NPV.data');
}
/**
* @dataProvider providerPRICE
*/
public function testPRICE()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Financial','PRICE'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
}
public function providerPRICE()
{
return new testDataFileIterator('rawTestData/Calculation/Financial/PRICE.data');
}
/**
* @dataProvider providerRATE
*/
public function testRATE()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Financial','RATE'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
}
public function providerRATE()
{
return new testDataFileIterator('rawTestData/Calculation/Financial/RATE.data');
}
/**
* @dataProvider providerXIRR
*/
public function testXIRR()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Financial','XIRR'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
}
public function providerXIRR()
{
return new testDataFileIterator('rawTestData/Calculation/Financial/XIRR.data');
}
}

View File

@@ -0,0 +1,276 @@
<?php
require_once 'testDataFileIterator.php';
class FunctionsTest extends PHPUnit_Framework_TestCase
{
public function setUp()
{
if (!defined('PHPEXCEL_ROOT'))
{
define('PHPEXCEL_ROOT', APPLICATION_PATH . '/');
}
require_once(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
PHPExcel_Calculation_Functions::setCompatibilityMode(PHPExcel_Calculation_Functions::COMPATIBILITY_EXCEL);
}
public function testDUMMY()
{
$result = PHPExcel_Calculation_Functions::DUMMY();
$this->assertEquals('#Not Yet Implemented', $result);
}
public function testDIV0()
{
$result = PHPExcel_Calculation_Functions::DIV0();
$this->assertEquals('#DIV/0!', $result);
}
public function testNA()
{
$result = PHPExcel_Calculation_Functions::NA();
$this->assertEquals('#N/A', $result);
}
public function testNaN()
{
$result = PHPExcel_Calculation_Functions::NaN();
$this->assertEquals('#NUM!', $result);
}
public function testNAME()
{
$result = PHPExcel_Calculation_Functions::NAME();
$this->assertEquals('#NAME?', $result);
}
public function testREF()
{
$result = PHPExcel_Calculation_Functions::REF();
$this->assertEquals('#REF!', $result);
}
public function testNULL()
{
$result = PHPExcel_Calculation_Functions::NULL();
$this->assertEquals('#NULL!', $result);
}
public function testVALUE()
{
$result = PHPExcel_Calculation_Functions::VALUE();
$this->assertEquals('#VALUE!', $result);
}
/**
* @dataProvider providerIS_BLANK
*/
public function testIS_BLANK()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Functions','IS_BLANK'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
}
public function providerIS_BLANK()
{
return new testDataFileIterator('rawTestData/Calculation/Functions/IS_BLANK.data');
}
/**
* @dataProvider providerIS_ERR
*/
public function testIS_ERR()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Functions','IS_ERR'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
}
public function providerIS_ERR()
{
return new testDataFileIterator('rawTestData/Calculation/Functions/IS_ERR.data');
}
/**
* @dataProvider providerIS_ERROR
*/
public function testIS_ERROR()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Functions','IS_ERROR'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
}
public function providerIS_ERROR()
{
return new testDataFileIterator('rawTestData/Calculation/Functions/IS_ERROR.data');
}
/**
* @dataProvider providerERROR_TYPE
*/
public function testERROR_TYPE()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Functions','ERROR_TYPE'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
}
public function providerERROR_TYPE()
{
return new testDataFileIterator('rawTestData/Calculation/Functions/ERROR_TYPE.data');
}
/**
* @dataProvider providerIS_LOGICAL
*/
public function testIS_LOGICAL()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Functions','IS_LOGICAL'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
}
public function providerIS_LOGICAL()
{
return new testDataFileIterator('rawTestData/Calculation/Functions/IS_LOGICAL.data');
}
/**
* @dataProvider providerIS_NA
*/
public function testIS_NA()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Functions','IS_NA'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
}
public function providerIS_NA()
{
return new testDataFileIterator('rawTestData/Calculation/Functions/IS_NA.data');
}
/**
* @dataProvider providerIS_NUMBER
*/
public function testIS_NUMBER()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Functions','IS_NUMBER'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
}
public function providerIS_NUMBER()
{
return new testDataFileIterator('rawTestData/Calculation/Functions/IS_NUMBER.data');
}
/**
* @dataProvider providerIS_TEXT
*/
public function testIS_TEXT()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Functions','IS_TEXT'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
}
public function providerIS_TEXT()
{
return new testDataFileIterator('rawTestData/Calculation/Functions/IS_TEXT.data');
}
/**
* @dataProvider providerIS_NONTEXT
*/
public function testIS_NONTEXT()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Functions','IS_NONTEXT'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
}
public function providerIS_NONTEXT()
{
return new testDataFileIterator('rawTestData/Calculation/Functions/IS_NONTEXT.data');
}
/**
* @dataProvider providerIS_EVEN
*/
public function testIS_EVEN()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Functions','IS_EVEN'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
}
public function providerIS_EVEN()
{
return new testDataFileIterator('rawTestData/Calculation/Functions/IS_EVEN.data');
}
/**
* @dataProvider providerIS_ODD
*/
public function testIS_ODD()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Functions','IS_ODD'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
}
public function providerIS_ODD()
{
return new testDataFileIterator('rawTestData/Calculation/Functions/IS_ODD.data');
}
/**
* @dataProvider providerTYPE
*/
public function testTYPE()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Functions','TYPE'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
}
public function providerTYPE()
{
return new testDataFileIterator('rawTestData/Calculation/Functions/TYPE.data');
}
/**
* @dataProvider providerN
*/
public function testN()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Functions','N'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
}
public function providerN()
{
return new testDataFileIterator('rawTestData/Calculation/Functions/N.data');
}
}

View File

@@ -0,0 +1,112 @@
<?php
require_once 'testDataFileIterator.php';
class LogicalTest extends PHPUnit_Framework_TestCase
{
public function setUp()
{
if (!defined('PHPEXCEL_ROOT'))
{
define('PHPEXCEL_ROOT', APPLICATION_PATH . '/');
}
require_once(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
PHPExcel_Calculation_Functions::setCompatibilityMode(PHPExcel_Calculation_Functions::COMPATIBILITY_EXCEL);
}
public function testTRUE()
{
$result = PHPExcel_Calculation_Logical::TRUE();
$this->assertEquals(TRUE, $result);
}
public function testFALSE()
{
$result = PHPExcel_Calculation_Logical::FALSE();
$this->assertEquals(FALSE, $result);
}
/**
* @dataProvider providerAND
*/
public function testAND()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Logical','LOGICAL_AND'),$args);
$this->assertEquals($expectedResult, $result);
}
public function providerAND()
{
return new testDataFileIterator('rawTestData/Calculation/Logical/AND.data');
}
/**
* @dataProvider providerOR
*/
public function testOR()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Logical','LOGICAL_OR'),$args);
$this->assertEquals($expectedResult, $result);
}
public function providerOR()
{
return new testDataFileIterator('rawTestData/Calculation/Logical/OR.data');
}
/**
* @dataProvider providerNOT
*/
public function testNOT()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Logical','NOT'),$args);
$this->assertEquals($expectedResult, $result);
}
public function providerNOT()
{
return new testDataFileIterator('rawTestData/Calculation/Logical/NOT.data');
}
/**
* @dataProvider providerIF
*/
public function testIF()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Logical','STATEMENT_IF'),$args);
$this->assertEquals($expectedResult, $result);
}
public function providerIF()
{
return new testDataFileIterator('rawTestData/Calculation/Logical/IF.data');
}
/**
* @dataProvider providerIFERROR
*/
public function testIFERROR()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Logical','IFERROR'),$args);
$this->assertEquals($expectedResult, $result);
}
public function providerIFERROR()
{
return new testDataFileIterator('rawTestData/Calculation/Logical/IFERROR.data');
}
}

View File

@@ -0,0 +1,52 @@
<?php
require_once 'testDataFileIterator.php';
class LookupRefTest extends PHPUnit_Framework_TestCase
{
public function setUp()
{
if (!defined('PHPEXCEL_ROOT'))
{
define('PHPEXCEL_ROOT', APPLICATION_PATH . '/');
}
require_once(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
PHPExcel_Calculation_Functions::setCompatibilityMode(PHPExcel_Calculation_Functions::COMPATIBILITY_EXCEL);
}
/**
* @dataProvider providerHLOOKUP
*/
public function testHLOOKUP()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_LookupRef','HLOOKUP'),$args);
$this->assertEquals($expectedResult, $result);
}
public function providerHLOOKUP()
{
return new testDataFileIterator('rawTestData/Calculation/LookupRef/HLOOKUP.data');
}
/**
* @dataProvider providerVLOOKUP
*/
public function testVLOOKUP()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_LookupRef','VLOOKUP'),$args);
$this->assertEquals($expectedResult, $result);
}
public function providerVLOOKUP()
{
return new testDataFileIterator('rawTestData/Calculation/LookupRef/VLOOKUP.data');
}
}

View File

@@ -0,0 +1,560 @@
<?php
require_once 'testDataFileIterator.php';
class MathTrigTest extends PHPUnit_Framework_TestCase
{
public function setUp()
{
if (!defined('PHPEXCEL_ROOT'))
{
define('PHPEXCEL_ROOT', APPLICATION_PATH . '/');
}
require_once(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
PHPExcel_Calculation_Functions::setCompatibilityMode(PHPExcel_Calculation_Functions::COMPATIBILITY_EXCEL);
}
/**
* @dataProvider providerATAN2
*/
public function testATAN2()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','ATAN2'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
}
public function providerATAN2()
{
return new testDataFileIterator('rawTestData/Calculation/MathTrig/ATAN2.data');
}
/**
* @dataProvider providerCEILING
*/
public function testCEILING()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','CEILING'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
}
public function providerCEILING()
{
return new testDataFileIterator('rawTestData/Calculation/MathTrig/CEILING.data');
}
/**
* @dataProvider providerCOMBIN
*/
public function testCOMBIN()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','COMBIN'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
}
public function providerCOMBIN()
{
return new testDataFileIterator('rawTestData/Calculation/MathTrig/COMBIN.data');
}
/**
* @dataProvider providerEVEN
*/
public function testEVEN()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','EVEN'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
}
public function providerEVEN()
{
return new testDataFileIterator('rawTestData/Calculation/MathTrig/EVEN.data');
}
/**
* @dataProvider providerODD
*/
public function testODD()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','ODD'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
}
public function providerODD()
{
return new testDataFileIterator('rawTestData/Calculation/MathTrig/ODD.data');
}
/**
* @dataProvider providerFACT
*/
public function testFACT()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','FACT'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
}
public function providerFACT()
{
return new testDataFileIterator('rawTestData/Calculation/MathTrig/FACT.data');
}
/**
* @dataProvider providerFACTDOUBLE
*/
public function testFACTDOUBLE()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','FACTDOUBLE'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
}
public function providerFACTDOUBLE()
{
return new testDataFileIterator('rawTestData/Calculation/MathTrig/FACTDOUBLE.data');
}
/**
* @dataProvider providerFLOOR
*/
public function testFLOOR()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','FLOOR'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
}
public function providerFLOOR()
{
return new testDataFileIterator('rawTestData/Calculation/MathTrig/FLOOR.data');
}
/**
* @dataProvider providerGCD
*/
public function testGCD()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','GCD'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
}
public function providerGCD()
{
return new testDataFileIterator('rawTestData/Calculation/MathTrig/GCD.data');
}
/**
* @dataProvider providerLCM
*/
public function testLCM()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','LCM'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
}
public function providerLCM()
{
return new testDataFileIterator('rawTestData/Calculation/MathTrig/LCM.data');
}
/**
* @dataProvider providerINT
*/
public function testINT()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','INT'),$args);
$this->assertEquals($expectedResult, $result);
}
public function providerINT()
{
return new testDataFileIterator('rawTestData/Calculation/MathTrig/INT.data');
}
/**
* @dataProvider providerSIGN
*/
public function testSIGN()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','SIGN'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
}
public function providerSIGN()
{
return new testDataFileIterator('rawTestData/Calculation/MathTrig/SIGN.data');
}
/**
* @dataProvider providerPOWER
*/
public function testPOWER()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','POWER'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
}
public function providerPOWER()
{
return new testDataFileIterator('rawTestData/Calculation/MathTrig/POWER.data');
}
/**
* @dataProvider providerLOG
*/
public function testLOG()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','LOG_BASE'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
}
public function providerLOG()
{
return new testDataFileIterator('rawTestData/Calculation/MathTrig/LOG.data');
}
/**
* @dataProvider providerMOD
*/
public function testMOD()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','MOD'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
}
public function providerMOD()
{
return new testDataFileIterator('rawTestData/Calculation/MathTrig/MOD.data');
}
/**
* @dataProvider providerMDETERM
*/
public function testMDETERM()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','MDETERM'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
}
public function providerMDETERM()
{
return new testDataFileIterator('rawTestData/Calculation/MathTrig/MDETERM.data');
}
/**
* @dataProvider providerMINVERSE
*/
public function testMINVERSE()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','MINVERSE'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
}
public function providerMINVERSE()
{
return new testDataFileIterator('rawTestData/Calculation/MathTrig/MINVERSE.data');
}
/**
* @dataProvider providerMMULT
*/
public function testMMULT()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','MMULT'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
}
public function providerMMULT()
{
return new testDataFileIterator('rawTestData/Calculation/MathTrig/MMULT.data');
}
/**
* @dataProvider providerMULTINOMIAL
*/
public function testMULTINOMIAL()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','MULTINOMIAL'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
}
public function providerMULTINOMIAL()
{
return new testDataFileIterator('rawTestData/Calculation/MathTrig/MULTINOMIAL.data');
}
/**
* @dataProvider providerMROUND
*/
public function testMROUND()
{
$args = func_get_args();
$expectedResult = array_pop($args);
PHPExcel_Calculation::setArrayReturnType(PHPExcel_Calculation::RETURN_ARRAY_AS_VALUE);
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','MROUND'),$args);
PHPExcel_Calculation::setArrayReturnType(PHPExcel_Calculation::RETURN_ARRAY_AS_ARRAY);
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
}
public function providerMROUND()
{
return new testDataFileIterator('rawTestData/Calculation/MathTrig/MROUND.data');
}
/**
* @dataProvider providerPRODUCT
*/
public function testPRODUCT()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','PRODUCT'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
}
public function providerPRODUCT()
{
return new testDataFileIterator('rawTestData/Calculation/MathTrig/PRODUCT.data');
}
/**
* @dataProvider providerQUOTIENT
*/
public function testQUOTIENT()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','QUOTIENT'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
}
public function providerQUOTIENT()
{
return new testDataFileIterator('rawTestData/Calculation/MathTrig/QUOTIENT.data');
}
/**
* @dataProvider providerROUNDUP
*/
public function testROUNDUP()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','ROUNDUP'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
}
public function providerROUNDUP()
{
return new testDataFileIterator('rawTestData/Calculation/MathTrig/ROUNDUP.data');
}
/**
* @dataProvider providerROUNDDOWN
*/
public function testROUNDDOWN()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','ROUNDDOWN'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
}
public function providerROUNDDOWN()
{
return new testDataFileIterator('rawTestData/Calculation/MathTrig/ROUNDDOWN.data');
}
/**
* @dataProvider providerSERIESSUM
*/
public function testSERIESSUM()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','SERIESSUM'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
}
public function providerSERIESSUM()
{
return new testDataFileIterator('rawTestData/Calculation/MathTrig/SERIESSUM.data');
}
/**
* @dataProvider providerSUMSQ
*/
public function testSUMSQ()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','SUMSQ'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
}
public function providerSUMSQ()
{
return new testDataFileIterator('rawTestData/Calculation/MathTrig/SUMSQ.data');
}
/**
* @dataProvider providerTRUNC
*/
public function testTRUNC()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','TRUNC'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
}
public function providerTRUNC()
{
return new testDataFileIterator('rawTestData/Calculation/MathTrig/TRUNC.data');
}
/**
* @dataProvider providerROMAN
*/
public function testROMAN()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','ROMAN'),$args);
$this->assertEquals($expectedResult, $result);
}
public function providerROMAN()
{
return new testDataFileIterator('rawTestData/Calculation/MathTrig/ROMAN.data');
}
/**
* @dataProvider providerSQRTPI
*/
public function testSQRTPI()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','SQRTPI'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
}
public function providerSQRTPI()
{
return new testDataFileIterator('rawTestData/Calculation/MathTrig/SQRTPI.data');
}
/**
* @dataProvider providerSUMIF
*/
public function testSUMIF()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig', 'SUMIF'), $args);
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
}
public function providerSUMIF()
{
return array(
array(
array(
array(1),
array(5),
array(10),
),
'>=5',
15,
),
array(
array(
array('text'),
array(2),
),
'=text',
array(
array(10),
array(100),
),
10,
),
array(
array(
array('"text with quotes"'),
array(2),
),
'="text with quotes"',
array(
array(10),
array(100),
),
10,
),
array(
array(
array('"text with quotes"'),
array(''),
),
'>"', // Compare to the single characater " (double quote)
array(
array(10),
array(100),
),
10
),
array(
array(
array(''),
array('anything'),
),
'>"', // Compare to the single characater " (double quote)
array(
array(10),
array(100),
),
100
),
);
}
}

View File

@@ -0,0 +1,365 @@
<?php
require_once 'testDataFileIterator.php';
class TextDataTest extends PHPUnit_Framework_TestCase
{
public function setUp()
{
if (!defined('PHPEXCEL_ROOT'))
{
define('PHPEXCEL_ROOT', APPLICATION_PATH . '/');
}
require_once(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
PHPExcel_Calculation_Functions::setCompatibilityMode(PHPExcel_Calculation_Functions::COMPATIBILITY_EXCEL);
}
/**
* @dataProvider providerCHAR
*/
public function testCHAR()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_TextData','CHARACTER'),$args);
$this->assertEquals($expectedResult, $result);
}
public function providerCHAR()
{
return new testDataFileIterator('rawTestData/Calculation/TextData/CHAR.data');
}
/**
* @dataProvider providerCODE
*/
public function testCODE()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_TextData','ASCIICODE'),$args);
$this->assertEquals($expectedResult, $result);
}
public function providerCODE()
{
return new testDataFileIterator('rawTestData/Calculation/TextData/CODE.data');
}
/**
* @dataProvider providerCONCATENATE
*/
public function testCONCATENATE()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_TextData','CONCATENATE'),$args);
$this->assertEquals($expectedResult, $result);
}
public function providerCONCATENATE()
{
return new testDataFileIterator('rawTestData/Calculation/TextData/CONCATENATE.data');
}
/**
* @dataProvider providerLEFT
*/
public function testLEFT()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_TextData','LEFT'),$args);
$this->assertEquals($expectedResult, $result);
}
public function providerLEFT()
{
return new testDataFileIterator('rawTestData/Calculation/TextData/LEFT.data');
}
/**
* @dataProvider providerMID
*/
public function testMID()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_TextData','MID'),$args);
$this->assertEquals($expectedResult, $result);
}
public function providerMID()
{
return new testDataFileIterator('rawTestData/Calculation/TextData/MID.data');
}
/**
* @dataProvider providerRIGHT
*/
public function testRIGHT()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_TextData','RIGHT'),$args);
$this->assertEquals($expectedResult, $result);
}
public function providerRIGHT()
{
return new testDataFileIterator('rawTestData/Calculation/TextData/RIGHT.data');
}
/**
* @dataProvider providerLOWER
*/
public function testLOWER()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_TextData','LOWERCASE'),$args);
$this->assertEquals($expectedResult, $result);
}
public function providerLOWER()
{
return new testDataFileIterator('rawTestData/Calculation/TextData/LOWER.data');
}
/**
* @dataProvider providerUPPER
*/
public function testUPPER()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_TextData','UPPERCASE'),$args);
$this->assertEquals($expectedResult, $result);
}
public function providerUPPER()
{
return new testDataFileIterator('rawTestData/Calculation/TextData/UPPER.data');
}
/**
* @dataProvider providerPROPER
*/
public function testPROPER()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_TextData','PROPERCASE'),$args);
$this->assertEquals($expectedResult, $result);
}
public function providerPROPER()
{
return new testDataFileIterator('rawTestData/Calculation/TextData/PROPER.data');
}
/**
* @dataProvider providerLEN
*/
public function testLEN()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_TextData','STRINGLENGTH'),$args);
$this->assertEquals($expectedResult, $result);
}
public function providerLEN()
{
return new testDataFileIterator('rawTestData/Calculation/TextData/LEN.data');
}
/**
* @dataProvider providerSEARCH
*/
public function testSEARCH()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_TextData','SEARCHINSENSITIVE'),$args);
$this->assertEquals($expectedResult, $result);
}
public function providerSEARCH()
{
return new testDataFileIterator('rawTestData/Calculation/TextData/SEARCH.data');
}
/**
* @dataProvider providerFIND
*/
public function testFIND()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_TextData','SEARCHSENSITIVE'),$args);
$this->assertEquals($expectedResult, $result);
}
public function providerFIND()
{
return new testDataFileIterator('rawTestData/Calculation/TextData/FIND.data');
}
/**
* @dataProvider providerREPLACE
*/
public function testREPLACE()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_TextData','REPLACE'),$args);
$this->assertEquals($expectedResult, $result);
}
public function providerREPLACE()
{
return new testDataFileIterator('rawTestData/Calculation/TextData/REPLACE.data');
}
/**
* @dataProvider providerSUBSTITUTE
*/
public function testSUBSTITUTE()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_TextData','SUBSTITUTE'),$args);
$this->assertEquals($expectedResult, $result);
}
public function providerSUBSTITUTE()
{
return new testDataFileIterator('rawTestData/Calculation/TextData/SUBSTITUTE.data');
}
/**
* @dataProvider providerTRIM
*/
public function testTRIM()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_TextData','TRIMSPACES'),$args);
$this->assertEquals($expectedResult, $result);
}
public function providerTRIM()
{
return new testDataFileIterator('rawTestData/Calculation/TextData/TRIM.data');
}
/**
* @dataProvider providerCLEAN
*/
public function testCLEAN()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_TextData','TRIMNONPRINTABLE'),$args);
$this->assertEquals($expectedResult, $result);
}
public function providerCLEAN()
{
return new testDataFileIterator('rawTestData/Calculation/TextData/CLEAN.data');
}
/**
* @dataProvider providerDOLLAR
*/
public function testDOLLAR()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_TextData','DOLLAR'),$args);
$this->assertEquals($expectedResult, $result);
}
public function providerDOLLAR()
{
return new testDataFileIterator('rawTestData/Calculation/TextData/DOLLAR.data');
}
/**
* @dataProvider providerFIXED
*/
public function testFIXED()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_TextData','FIXEDFORMAT'),$args);
$this->assertEquals($expectedResult, $result);
}
public function providerFIXED()
{
return new testDataFileIterator('rawTestData/Calculation/TextData/FIXED.data');
}
/**
* @dataProvider providerT
*/
public function testT()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_TextData','RETURNSTRING'),$args);
$this->assertEquals($expectedResult, $result);
}
public function providerT()
{
return new testDataFileIterator('rawTestData/Calculation/TextData/T.data');
}
/**
* @dataProvider providerTEXT
*/
public function testTEXT()
{
// Enforce decimal and thousands separator values to UK/US, and currency code to USD
call_user_func(array('PHPExcel_Shared_String','setDecimalSeparator'),'.');
call_user_func(array('PHPExcel_Shared_String','setThousandsSeparator'),',');
call_user_func(array('PHPExcel_Shared_String','setCurrencyCode'),'$');
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_TextData','TEXTFORMAT'),$args);
$this->assertEquals($expectedResult, $result);
}
public function providerTEXT()
{
return new testDataFileIterator('rawTestData/Calculation/TextData/TEXT.data');
}
/**
* @dataProvider providerVALUE
*/
public function testVALUE()
{
call_user_func(array('PHPExcel_Shared_String','setDecimalSeparator'),'.');
call_user_func(array('PHPExcel_Shared_String','setThousandsSeparator'),' ');
call_user_func(array('PHPExcel_Shared_String','setCurrencyCode'),'$');
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_TextData','VALUE'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
}
public function providerVALUE()
{
return new testDataFileIterator('rawTestData/Calculation/TextData/VALUE.data');
}
}

View File

@@ -0,0 +1,37 @@
<?php
require_once 'testDataFileIterator.php';
class CalculationTest extends PHPUnit_Framework_TestCase
{
public function setUp()
{
if (!defined('PHPEXCEL_ROOT')) {
define('PHPEXCEL_ROOT', APPLICATION_PATH . '/');
}
require_once(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
PHPExcel_Calculation_Functions::setCompatibilityMode(PHPExcel_Calculation_Functions::COMPATIBILITY_EXCEL);
}
/**
* @dataProvider providerBinaryComparisonOperation
*/
public function testBinaryComparisonOperation($formula, $expectedResultExcel, $expectedResultOpenOffice)
{
PHPExcel_Calculation_Functions::setCompatibilityMode(PHPExcel_Calculation_Functions::COMPATIBILITY_EXCEL);
$resultExcel = \PHPExcel_Calculation::getInstance()->_calculateFormulaValue($formula);
$this->assertEquals($expectedResultExcel, $resultExcel, 'should be Excel compatible');
PHPExcel_Calculation_Functions::setCompatibilityMode(PHPExcel_Calculation_Functions::COMPATIBILITY_OPENOFFICE);
$resultOpenOffice = \PHPExcel_Calculation::getInstance()->_calculateFormulaValue($formula);
$this->assertEquals($expectedResultOpenOffice, $resultOpenOffice, 'should be OpenOffice compatible');
}
public function providerBinaryComparisonOperation()
{
return new testDataFileIterator('rawTestData/CalculationBinaryComparisonOperation.data');
}
}

View File

@@ -0,0 +1,73 @@
<?php
class AdvancedValueBinderTest extends PHPUnit_Framework_TestCase
{
public function setUp()
{
if (!defined('PHPEXCEL_ROOT')) {
define('PHPEXCEL_ROOT', APPLICATION_PATH . '/');
}
require_once(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
}
public function provider()
{
if (!class_exists('PHPExcel_Style_NumberFormat')) {
$this->setUp();
}
$currencyUSD = PHPExcel_Style_NumberFormat::FORMAT_CURRENCY_USD_SIMPLE;
$currencyEURO = str_replace('$', '€', PHPExcel_Style_NumberFormat::FORMAT_CURRENCY_USD_SIMPLE);
return array(
array('10%', 0.1, PHPExcel_Style_NumberFormat::FORMAT_PERCENTAGE_00, ',', '.', '$'),
array('$10.11', 10.11, $currencyUSD, ',', '.', '$'),
array('$1,010.12', 1010.12, $currencyUSD, ',', '.', '$'),
array('$20,20', 20.2, $currencyUSD, '.', ',', '$'),
array('$2.020,20', 2020.2, $currencyUSD, '.', ',', '$'),
array('€2.020,20', 2020.2, $currencyEURO, '.', ',', '€'),
array('€ 2.020,20', 2020.2, $currencyEURO, '.', ',', '€'),
array('€2,020.22', 2020.22, $currencyEURO, ',', '.', '€'),
);
}
/**
* @dataProvider provider
*/
public function testCurrency($value, $valueBinded, $format, $thousandsSeparator, $decimalSeparator, $currencyCode)
{
$sheet = $this->getMock(
'PHPExcel_Worksheet',
array('getStyle', 'getNumberFormat', 'setFormatCode','getCellCacheController')
);
$cache = $this->getMockBuilder('PHPExcel_CachedObjectStorage_Memory')
->disableOriginalConstructor()
->getMock();
$cache->expects($this->any())
->method('getParent')
->will($this->returnValue($sheet));
$sheet->expects($this->once())
->method('getStyle')
->will($this->returnSelf());
$sheet->expects($this->once())
->method('getNumberFormat')
->will($this->returnSelf());
$sheet->expects($this->once())
->method('setFormatCode')
->with($format)
->will($this->returnSelf());
$sheet->expects($this->any())
->method('getCellCacheController')
->will($this->returnValue($cache));
PHPExcel_Shared_String::setCurrencyCode($currencyCode);
PHPExcel_Shared_String::setDecimalSeparator($decimalSeparator);
PHPExcel_Shared_String::setThousandsSeparator($thousandsSeparator);
$cell = new PHPExcel_Cell(NULL, PHPExcel_Cell_DataType::TYPE_STRING, $sheet);
$binder = new PHPExcel_Cell_AdvancedValueBinder();
$binder->bindValue($cell, $value);
$this->assertEquals($valueBinded, $cell->getValue());
}
}

View File

@@ -0,0 +1,24 @@
<?php
class DataTypeTest extends PHPUnit_Framework_TestCase
{
public function setUp()
{
if (!defined('PHPEXCEL_ROOT'))
{
define('PHPEXCEL_ROOT', APPLICATION_PATH . '/');
}
require_once(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
}
public function testGetErrorCodes()
{
$result = call_user_func(array('PHPExcel_Cell_DataType','getErrorCodes'));
$this->assertInternalType('array', $result);
$this->assertGreaterThan(0, count($result));
$this->assertArrayHasKey('#NULL!', $result);
}
}

View File

@@ -0,0 +1,85 @@
<?php
require_once 'testDataFileIterator.php';
class DefaultValueBinderTest extends PHPUnit_Framework_TestCase
{
protected $cellStub;
public function setUp()
{
if (!defined('PHPEXCEL_ROOT'))
{
define('PHPEXCEL_ROOT', APPLICATION_PATH . '/');
}
require_once(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
}
protected function createCellStub()
{
// Create a stub for the Cell class.
$this->cellStub = $this->getMockBuilder('PHPExcel_Cell')
->disableOriginalConstructor()
->getMock();
// Configure the stub.
$this->cellStub->expects($this->any())
->method('setValueExplicit')
->will($this->returnValue(true));
}
/**
* @dataProvider binderProvider
*/
public function testBindValue($value)
{
$this->createCellStub();
$binder = new PHPExcel_Cell_DefaultValueBinder();
$result = $binder->bindValue($this->cellStub, $value);
$this->assertTrue($result);
}
public function binderProvider()
{
return array(
array(null),
array(''),
array('ABC'),
array('=SUM(A1:B2)'),
array(true),
array(false),
array(123),
array(-123.456),
array('123'),
array('-123.456'),
array('#REF!'),
array(new DateTime()),
);
}
/**
* @dataProvider providerDataTypeForValue
*/
public function testDataTypeForValue()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Cell_DefaultValueBinder','dataTypeForValue'), $args);
$this->assertEquals($expectedResult, $result);
}
public function providerDataTypeForValue()
{
return new testDataFileIterator('rawTestData/Cell/DefaultValueBinder.data');
}
public function testDataTypeForRichTextObject()
{
$objRichText = new PHPExcel_RichText();
$objRichText->createText('Hello World');
$expectedResult = PHPExcel_Cell_DataType::TYPE_INLINE;
$result = call_user_func(array('PHPExcel_Cell_DefaultValueBinder','dataTypeForValue'), $objRichText);
$this->assertEquals($expectedResult, $result);
}
}

View File

@@ -0,0 +1,88 @@
<?php
class HyperlinkTest extends PHPUnit_Framework_TestCase
{
public function setUp()
{
if (!defined('PHPEXCEL_ROOT'))
{
define('PHPEXCEL_ROOT', APPLICATION_PATH . '/');
}
require_once(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
}
public function testGetUrl()
{
$urlValue = 'http://www.phpexcel.net';
$testInstance = new PHPExcel_Cell_Hyperlink($urlValue);
$result = $testInstance->getUrl();
$this->assertEquals($urlValue,$result);
}
public function testSetUrl()
{
$initialUrlValue = 'http://www.phpexcel.net';
$newUrlValue = 'http://github.com/PHPOffice/PHPExcel';
$testInstance = new PHPExcel_Cell_Hyperlink($initialUrlValue);
$result = $testInstance->setUrl($newUrlValue);
$this->assertTrue($result instanceof PHPExcel_Cell_Hyperlink);
$result = $testInstance->getUrl();
$this->assertEquals($newUrlValue,$result);
}
public function testGetTooltip()
{
$tooltipValue = 'PHPExcel Web Site';
$testInstance = new PHPExcel_Cell_Hyperlink(NULL, $tooltipValue);
$result = $testInstance->getTooltip();
$this->assertEquals($tooltipValue,$result);
}
public function testSetTooltip()
{
$initialTooltipValue = 'PHPExcel Web Site';
$newTooltipValue = 'PHPExcel Repository on Github';
$testInstance = new PHPExcel_Cell_Hyperlink(NULL, $initialTooltipValue);
$result = $testInstance->setTooltip($newTooltipValue);
$this->assertTrue($result instanceof PHPExcel_Cell_Hyperlink);
$result = $testInstance->getTooltip();
$this->assertEquals($newTooltipValue,$result);
}
public function testIsInternal()
{
$initialUrlValue = 'http://www.phpexcel.net';
$newUrlValue = 'sheet://Worksheet1!A1';
$testInstance = new PHPExcel_Cell_Hyperlink($initialUrlValue);
$result = $testInstance->isInternal();
$this->assertFalse($result);
$testInstance->setUrl($newUrlValue);
$result = $testInstance->isInternal();
$this->assertTrue($result);
}
public function testGetHashCode()
{
$urlValue = 'http://www.phpexcel.net';
$tooltipValue = 'PHPExcel Web Site';
$initialExpectedHash = 'd84d713aed1dbbc8a7c5af183d6c7dbb';
$testInstance = new PHPExcel_Cell_Hyperlink($urlValue, $tooltipValue);
$result = $testInstance->getHashCode();
$this->assertEquals($initialExpectedHash,$result);
}
}

View File

@@ -0,0 +1,295 @@
<?php
require_once 'testDataFileIterator.php';
class CellTest extends PHPUnit_Framework_TestCase
{
public function setUp()
{
if (!defined('PHPEXCEL_ROOT')) {
define('PHPEXCEL_ROOT', APPLICATION_PATH . '/');
}
require_once(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
}
/**
* @dataProvider providerColumnString
*/
public function testColumnIndexFromString()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Cell','columnIndexFromString'),$args);
$this->assertEquals($expectedResult, $result);
}
public function providerColumnString()
{
return new testDataFileIterator('rawTestData/ColumnString.data');
}
public function testColumnIndexFromStringTooLong()
{
$cellAddress = 'ABCD';
try {
$result = call_user_func(array('PHPExcel_Cell','columnIndexFromString'),$cellAddress);
} catch (PHPExcel_Exception $e) {
$this->assertEquals($e->getMessage(), 'Column string index can not be longer than 3 characters');
return;
}
$this->fail('An expected exception has not been raised.');
}
public function testColumnIndexFromStringTooShort()
{
$cellAddress = '';
try {
$result = call_user_func(array('PHPExcel_Cell','columnIndexFromString'),$cellAddress);
} catch (PHPExcel_Exception $e) {
$this->assertEquals($e->getMessage(), 'Column string index can not be empty');
return;
}
$this->fail('An expected exception has not been raised.');
}
/**
* @dataProvider providerColumnIndex
*/
public function testStringFromColumnIndex()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Cell','stringFromColumnIndex'),$args);
$this->assertEquals($expectedResult, $result);
}
public function providerColumnIndex()
{
return new testDataFileIterator('rawTestData/ColumnIndex.data');
}
/**
* @dataProvider providerCoordinates
*/
public function testCoordinateFromString()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Cell','coordinateFromString'),$args);
$this->assertEquals($expectedResult, $result);
}
public function providerCoordinates()
{
return new testDataFileIterator('rawTestData/CellCoordinates.data');
}
public function testCoordinateFromStringWithRangeAddress()
{
$cellAddress = 'A1:AI2012';
try {
$result = call_user_func(array('PHPExcel_Cell','coordinateFromString'),$cellAddress);
} catch (PHPExcel_Exception $e) {
$this->assertEquals($e->getMessage(), 'Cell coordinate string can not be a range of cells');
return;
}
$this->fail('An expected exception has not been raised.');
}
public function testCoordinateFromStringWithEmptyAddress()
{
$cellAddress = '';
try {
$result = call_user_func(array('PHPExcel_Cell','coordinateFromString'),$cellAddress);
} catch (PHPExcel_Exception $e) {
$this->assertEquals($e->getMessage(), 'Cell coordinate can not be zero-length string');
return;
}
$this->fail('An expected exception has not been raised.');
}
public function testCoordinateFromStringWithInvalidAddress()
{
$cellAddress = 'AI';
try {
$result = call_user_func(array('PHPExcel_Cell','coordinateFromString'),$cellAddress);
} catch (PHPExcel_Exception $e) {
$this->assertEquals($e->getMessage(), 'Invalid cell coordinate '.$cellAddress);
return;
}
$this->fail('An expected exception has not been raised.');
}
/**
* @dataProvider providerAbsoluteCoordinates
*/
public function testAbsoluteCoordinateFromString()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Cell','absoluteCoordinate'),$args);
$this->assertEquals($expectedResult, $result);
}
public function providerAbsoluteCoordinates()
{
return new testDataFileIterator('rawTestData/CellAbsoluteCoordinate.data');
}
public function testAbsoluteCoordinateFromStringWithRangeAddress()
{
$cellAddress = 'A1:AI2012';
try {
$result = call_user_func(array('PHPExcel_Cell','absoluteCoordinate'),$cellAddress);
} catch (PHPExcel_Exception $e) {
$this->assertEquals($e->getMessage(), 'Cell coordinate string can not be a range of cells');
return;
}
$this->fail('An expected exception has not been raised.');
}
/**
* @dataProvider providerAbsoluteReferences
*/
public function testAbsoluteReferenceFromString()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Cell','absoluteReference'),$args);
$this->assertEquals($expectedResult, $result);
}
public function providerAbsoluteReferences()
{
return new testDataFileIterator('rawTestData/CellAbsoluteReference.data');
}
public function testAbsoluteReferenceFromStringWithRangeAddress()
{
$cellAddress = 'A1:AI2012';
try {
$result = call_user_func(array('PHPExcel_Cell','absoluteReference'),$cellAddress);
} catch (PHPExcel_Exception $e) {
$this->assertEquals($e->getMessage(), 'Cell coordinate string can not be a range of cells');
return;
}
$this->fail('An expected exception has not been raised.');
}
/**
* @dataProvider providerSplitRange
*/
public function testSplitRange()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Cell','splitRange'),$args);
foreach($result as $key => $split) {
if (!is_array($expectedResult[$key])) {
$this->assertEquals($expectedResult[$key], $split[0]);
} else {
$this->assertEquals($expectedResult[$key], $split);
}
}
}
public function providerSplitRange()
{
return new testDataFileIterator('rawTestData/CellSplitRange.data');
}
/**
* @dataProvider providerBuildRange
*/
public function testBuildRange()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Cell','buildRange'),$args);
$this->assertEquals($expectedResult, $result);
}
public function providerBuildRange()
{
return new testDataFileIterator('rawTestData/CellBuildRange.data');
}
public function testBuildRangeInvalid()
{
$cellRange = '';
try {
$result = call_user_func(array('PHPExcel_Cell','buildRange'),$cellRange);
} catch (PHPExcel_Exception $e) {
$this->assertEquals($e->getMessage(), 'Range does not contain any information');
return;
}
$this->fail('An expected exception has not been raised.');
}
/**
* @dataProvider providerRangeBoundaries
*/
public function testRangeBoundaries()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Cell','rangeBoundaries'),$args);
$this->assertEquals($expectedResult, $result);
}
public function providerRangeBoundaries()
{
return new testDataFileIterator('rawTestData/CellRangeBoundaries.data');
}
/**
* @dataProvider providerRangeDimension
*/
public function testRangeDimension()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Cell','rangeDimension'),$args);
$this->assertEquals($expectedResult, $result);
}
public function providerRangeDimension()
{
return new testDataFileIterator('rawTestData/CellRangeDimension.data');
}
/**
* @dataProvider providerGetRangeBoundaries
*/
public function testGetRangeBoundaries()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Cell','getRangeBoundaries'),$args);
$this->assertEquals($expectedResult, $result);
}
public function providerGetRangeBoundaries()
{
return new testDataFileIterator('rawTestData/CellGetRangeBoundaries.data');
}
/**
* @dataProvider providerExtractAllCellReferencesInRange
*/
public function testExtractAllCellReferencesInRange()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Cell','extractAllCellReferencesInRange'),$args);
$this->assertEquals($expectedResult, $result);
}
public function providerExtractAllCellReferencesInRange()
{
return new testDataFileIterator('rawTestData/CellExtractAllCellReferencesInRange.data');
}
}

View File

@@ -0,0 +1,55 @@
<?php
class DataSeriesValuesTest extends PHPUnit_Framework_TestCase
{
public function setUp()
{
if (!defined('PHPEXCEL_ROOT'))
{
define('PHPEXCEL_ROOT', APPLICATION_PATH . '/');
}
require_once(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
}
public function testSetDataType()
{
$dataTypeValues = array(
'Number',
'String'
);
$testInstance = new PHPExcel_Chart_DataSeriesValues;
foreach($dataTypeValues as $dataTypeValue) {
$result = $testInstance->setDataType($dataTypeValue);
$this->assertTrue($result instanceof PHPExcel_Chart_DataSeriesValues);
}
}
public function testSetInvalidDataTypeThrowsException()
{
$testInstance = new PHPExcel_Chart_DataSeriesValues;
try {
$result = $testInstance->setDataType('BOOLEAN');
} catch (Exception $e) {
$this->assertEquals($e->getMessage(), 'Invalid datatype for chart data series values');
return;
}
$this->fail('An expected exception has not been raised.');
}
public function testGetDataType()
{
$dataTypeValue = 'String';
$testInstance = new PHPExcel_Chart_DataSeriesValues;
$setValue = $testInstance->setDataType($dataTypeValue);
$result = $testInstance->getDataType();
$this->assertEquals($dataTypeValue,$result);
}
}

View File

@@ -0,0 +1,37 @@
<?php
class LayoutTest extends PHPUnit_Framework_TestCase
{
public function setUp()
{
if (!defined('PHPEXCEL_ROOT'))
{
define('PHPEXCEL_ROOT', APPLICATION_PATH . '/');
}
require_once(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
}
public function testSetLayoutTarget()
{
$LayoutTargetValue = 'String';
$testInstance = new PHPExcel_Chart_Layout;
$result = $testInstance->setLayoutTarget($LayoutTargetValue);
$this->assertTrue($result instanceof PHPExcel_Chart_Layout);
}
public function testGetLayoutTarget()
{
$LayoutTargetValue = 'String';
$testInstance = new PHPExcel_Chart_Layout;
$setValue = $testInstance->setLayoutTarget($LayoutTargetValue);
$result = $testInstance->getLayoutTarget();
$this->assertEquals($LayoutTargetValue,$result);
}
}

View File

@@ -0,0 +1,134 @@
<?php
class LegendTest extends PHPUnit_Framework_TestCase
{
public function setUp()
{
if (!defined('PHPEXCEL_ROOT'))
{
define('PHPEXCEL_ROOT', APPLICATION_PATH . '/');
}
require_once(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
}
public function testSetPosition()
{
$positionValues = array(
PHPExcel_Chart_Legend::POSITION_RIGHT,
PHPExcel_Chart_Legend::POSITION_LEFT,
PHPExcel_Chart_Legend::POSITION_TOP,
PHPExcel_Chart_Legend::POSITION_BOTTOM,
PHPExcel_Chart_Legend::POSITION_TOPRIGHT,
);
$testInstance = new PHPExcel_Chart_Legend;
foreach($positionValues as $positionValue) {
$result = $testInstance->setPosition($positionValue);
$this->assertTrue($result);
}
}
public function testSetInvalidPositionReturnsFalse()
{
$testInstance = new PHPExcel_Chart_Legend;
$result = $testInstance->setPosition('BottomLeft');
$this->assertFalse($result);
// Ensure that value is unchanged
$result = $testInstance->getPosition();
$this->assertEquals(PHPExcel_Chart_Legend::POSITION_RIGHT,$result);
}
public function testGetPosition()
{
$PositionValue = PHPExcel_Chart_Legend::POSITION_BOTTOM;
$testInstance = new PHPExcel_Chart_Legend;
$setValue = $testInstance->setPosition($PositionValue);
$result = $testInstance->getPosition();
$this->assertEquals($PositionValue,$result);
}
public function testSetPositionXL()
{
$positionValues = array(
PHPExcel_Chart_Legend::xlLegendPositionBottom,
PHPExcel_Chart_Legend::xlLegendPositionCorner,
PHPExcel_Chart_Legend::xlLegendPositionCustom,
PHPExcel_Chart_Legend::xlLegendPositionLeft,
PHPExcel_Chart_Legend::xlLegendPositionRight,
PHPExcel_Chart_Legend::xlLegendPositionTop,
);
$testInstance = new PHPExcel_Chart_Legend;
foreach($positionValues as $positionValue) {
$result = $testInstance->setPositionXL($positionValue);
$this->assertTrue($result);
}
}
public function testSetInvalidXLPositionReturnsFalse()
{
$testInstance = new PHPExcel_Chart_Legend;
$result = $testInstance->setPositionXL(999);
$this->assertFalse($result);
// Ensure that value is unchanged
$result = $testInstance->getPositionXL();
$this->assertEquals(PHPExcel_Chart_Legend::xlLegendPositionRight,$result);
}
public function testGetPositionXL()
{
$PositionValue = PHPExcel_Chart_Legend::xlLegendPositionCorner;
$testInstance = new PHPExcel_Chart_Legend;
$setValue = $testInstance->setPositionXL($PositionValue);
$result = $testInstance->getPositionXL();
$this->assertEquals($PositionValue,$result);
}
public function testSetOverlay()
{
$overlayValues = array(
TRUE,
FALSE,
);
$testInstance = new PHPExcel_Chart_Legend;
foreach($overlayValues as $overlayValue) {
$result = $testInstance->setOverlay($overlayValue);
$this->assertTrue($result);
}
}
public function testSetInvalidOverlayReturnsFalse()
{
$testInstance = new PHPExcel_Chart_Legend;
$result = $testInstance->setOverlay('INVALID');
$this->assertFalse($result);
$result = $testInstance->getOverlay();
$this->assertFalse($result);
}
public function testGetOverlay()
{
$OverlayValue = TRUE;
$testInstance = new PHPExcel_Chart_Legend;
$setValue = $testInstance->setOverlay($OverlayValue);
$result = $testInstance->getOverlay();
$this->assertEquals($OverlayValue,$result);
}
}

View File

@@ -0,0 +1,55 @@
<?php
class XEEValidatorTest extends PHPUnit_Framework_TestCase
{
public function setUp()
{
if (!defined('PHPEXCEL_ROOT')) {
define('PHPEXCEL_ROOT', APPLICATION_PATH . '/');
}
require_once(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
}
/**
* @dataProvider providerInvalidXML
* @expectedException PHPExcel_Reader_Exception
*/
public function testInvalidXML($filename)
{
$reader = $this->getMockForAbstractClass('PHPExcel_Reader_Abstract');
$expectedResult = 'FAILURE: Should throw an Exception rather than return a value';
$result = $reader->securityScanFile($filename);
$this->assertEquals($expectedResult, $result);
}
public function providerInvalidXML()
{
$tests = [];
foreach(glob('rawTestData/Reader/XEETestInvalid*.xml') as $file) {
$tests[] = [realpath($file), true];
}
return $tests;
}
/**
* @dataProvider providerValidXML
*/
public function testValidXML($filename, $expectedResult)
{
$reader = $this->getMockForAbstractClass('PHPExcel_Reader_Abstract');
$result = $reader->securityScanFile($filename);
$this->assertEquals($expectedResult, $result);
}
public function providerValidXML()
{
$tests = [];
foreach(glob('rawTestData/Reader/XEETestValid*.xml') as $file) {
$tests[] = [realpath($file), file_get_contents($file)];
}
return $tests;
}
}

View File

@@ -0,0 +1,58 @@
<?php
class ReferenceHelperTest extends PHPUnit_Framework_TestCase
{
public function setUp()
{
if (!defined('PHPEXCEL_ROOT')) {
define('PHPEXCEL_ROOT', APPLICATION_PATH . '/');
}
require_once(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
}
public function testColumnSort()
{
$columnBase = $columnExpectedResult = array(
'A','B','Z',
'AA','AB','AZ',
'BA','BB','BZ',
'ZA','ZB','ZZ',
'AAA','AAB','AAZ',
'ABA','ABB','ABZ',
'AZA','AZB','AZZ',
'BAA','BAB','BAZ',
'BBA','BBB','BBZ',
'BZA','BZB','BZZ'
);
shuffle($columnBase);
usort($columnBase, array('PHPExcel_ReferenceHelper','columnSort'));
foreach($columnBase as $key => $value) {
$this->assertEquals($columnExpectedResult[$key], $value);
}
}
public function testColumnReverseSort()
{
$columnBase = $columnExpectedResult = array(
'A','B','Z',
'AA','AB','AZ',
'BA','BB','BZ',
'ZA','ZB','ZZ',
'AAA','AAB','AAZ',
'ABA','ABB','ABZ',
'AZA','AZB','AZZ',
'BAA','BAB','BAZ',
'BBA','BBB','BBZ',
'BZA','BZB','BZZ'
);
shuffle($columnBase);
$columnExpectedResult = array_reverse($columnExpectedResult);
usort($columnBase, array('PHPExcel_ReferenceHelper','columnReverseSort'));
foreach($columnBase as $key => $value) {
$this->assertEquals($columnExpectedResult[$key], $value);
}
}
}

View File

@@ -0,0 +1,57 @@
<?php
require_once 'testDataFileIterator.php';
class CodePageTest extends PHPUnit_Framework_TestCase
{
public function setUp()
{
if (!defined('PHPEXCEL_ROOT')) {
define('PHPEXCEL_ROOT', APPLICATION_PATH . '/');
}
require_once(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
}
/**
* @dataProvider providerCodePage
*/
public function testCodePageNumberToName()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Shared_CodePage','NumberToName'),$args);
$this->assertEquals($expectedResult, $result);
}
public function providerCodePage()
{
return new testDataFileIterator('rawTestData/Shared/CodePage.data');
}
public function testNumberToNameWithInvalidCodePage()
{
$invalidCodePage = 12345;
try {
$result = call_user_func(array('PHPExcel_Shared_CodePage','NumberToName'),$invalidCodePage);
} catch (Exception $e) {
$this->assertEquals($e->getMessage(), 'Unknown codepage: 12345');
return;
}
$this->fail('An expected exception has not been raised.');
}
public function testNumberToNameWithUnsupportedCodePage()
{
$unsupportedCodePage = 720;
try {
$result = call_user_func(array('PHPExcel_Shared_CodePage','NumberToName'),$unsupportedCodePage);
} catch (Exception $e) {
$this->assertEquals($e->getMessage(), 'Code page 720 not supported.');
return;
}
$this->fail('An expected exception has not been raised.');
}
}

View File

@@ -0,0 +1,188 @@
<?php
require_once 'testDataFileIterator.php';
class DateTest extends PHPUnit_Framework_TestCase
{
public function setUp()
{
if (!defined('PHPEXCEL_ROOT')) {
define('PHPEXCEL_ROOT', APPLICATION_PATH . '/');
}
require_once(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
}
public function testSetExcelCalendar()
{
$calendarValues = array(
PHPExcel_Shared_Date::CALENDAR_MAC_1904,
PHPExcel_Shared_Date::CALENDAR_WINDOWS_1900,
);
foreach($calendarValues as $calendarValue) {
$result = call_user_func(array('PHPExcel_Shared_Date','setExcelCalendar'),$calendarValue);
$this->assertTrue($result);
}
}
public function testSetExcelCalendarWithInvalidValue()
{
$unsupportedCalendar = '2012';
$result = call_user_func(array('PHPExcel_Shared_Date','setExcelCalendar'),$unsupportedCalendar);
$this->assertFalse($result);
}
/**
* @dataProvider providerDateTimeExcelToPHP1900
*/
public function testDateTimeExcelToPHP1900()
{
$result = call_user_func(
array('PHPExcel_Shared_Date','setExcelCalendar'),
PHPExcel_Shared_Date::CALENDAR_WINDOWS_1900
);
$args = func_get_args();
$expectedResult = array_pop($args);
if ($args[0] < 1) {
$expectedResult += gmmktime(0,0,0);
}
$result = call_user_func_array(array('PHPExcel_Shared_Date','ExcelToPHP'),$args);
$this->assertEquals($expectedResult, $result);
}
public function providerDateTimeExcelToPHP1900()
{
return new testDataFileIterator('rawTestData/Shared/DateTimeExcelToPHP1900.data');
}
/**
* @dataProvider providerDateTimePHPToExcel1900
*/
public function testDateTimePHPToExcel1900()
{
$result = call_user_func(
array('PHPExcel_Shared_Date','setExcelCalendar'),
PHPExcel_Shared_Date::CALENDAR_WINDOWS_1900
);
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Shared_Date','PHPToExcel'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-5);
}
public function providerDateTimePHPToExcel1900()
{
return new testDataFileIterator('rawTestData/Shared/DateTimePHPToExcel1900.data');
}
/**
* @dataProvider providerDateTimeFormattedPHPToExcel1900
*/
public function testDateTimeFormattedPHPToExcel1900()
{
$result = call_user_func(
array('PHPExcel_Shared_Date','setExcelCalendar'),
PHPExcel_Shared_Date::CALENDAR_WINDOWS_1900
);
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Shared_Date','FormattedPHPToExcel'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-5);
}
public function providerDateTimeFormattedPHPToExcel1900()
{
return new testDataFileIterator('rawTestData/Shared/DateTimeFormattedPHPToExcel1900.data');
}
/**
* @dataProvider providerDateTimeExcelToPHP1904
*/
public function testDateTimeExcelToPHP1904()
{
$result = call_user_func(
array('PHPExcel_Shared_Date','setExcelCalendar'),
PHPExcel_Shared_Date::CALENDAR_MAC_1904
);
$args = func_get_args();
$expectedResult = array_pop($args);
if ($args[0] < 1) {
$expectedResult += gmmktime(0,0,0);
}
$result = call_user_func_array(array('PHPExcel_Shared_Date','ExcelToPHP'),$args);
$this->assertEquals($expectedResult, $result);
}
public function providerDateTimeExcelToPHP1904()
{
return new testDataFileIterator('rawTestData/Shared/DateTimeExcelToPHP1904.data');
}
/**
* @dataProvider providerDateTimePHPToExcel1904
*/
public function testDateTimePHPToExcel1904()
{
$result = call_user_func(
array('PHPExcel_Shared_Date','setExcelCalendar'),
PHPExcel_Shared_Date::CALENDAR_MAC_1904
);
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Shared_Date','PHPToExcel'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-5);
}
public function providerDateTimePHPToExcel1904()
{
return new testDataFileIterator('rawTestData/Shared/DateTimePHPToExcel1904.data');
}
/**
* @dataProvider providerIsDateTimeFormatCode
*/
public function testIsDateTimeFormatCode()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Shared_Date','isDateTimeFormatCode'),$args);
$this->assertEquals($expectedResult, $result);
}
public function providerIsDateTimeFormatCode()
{
return new testDataFileIterator('rawTestData/Shared/DateTimeFormatCodes.data');
}
/**
* @dataProvider providerDateTimeExcelToPHP1900Timezone
*/
public function testDateTimeExcelToPHP1900Timezone()
{
$result = call_user_func(
array('PHPExcel_Shared_Date','setExcelCalendar'),
PHPExcel_Shared_Date::CALENDAR_WINDOWS_1900
);
$args = func_get_args();
$expectedResult = array_pop($args);
if ($args[0] < 1) {
$expectedResult += gmmktime(0,0,0);
}
$result = call_user_func_array(array('PHPExcel_Shared_Date','ExcelToPHP'),$args);
$this->assertEquals($expectedResult, $result);
}
public function providerDateTimeExcelToPHP1900Timezone()
{
return new testDataFileIterator('rawTestData/Shared/DateTimeExcelToPHP1900Timezone.data');
}
}

View File

@@ -0,0 +1,39 @@
<?php
require_once 'testDataFileIterator.php';
class FileTest extends PHPUnit_Framework_TestCase
{
public function setUp()
{
if (!defined('PHPEXCEL_ROOT')) {
define('PHPEXCEL_ROOT', APPLICATION_PATH . '/');
}
require_once(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
}
public function testGetUseUploadTempDirectory()
{
$expectedResult = FALSE;
$result = call_user_func(array('PHPExcel_Shared_File','getUseUploadTempDirectory'));
$this->assertEquals($expectedResult, $result);
}
public function testSetUseUploadTempDirectory()
{
$useUploadTempDirectoryValues = array(
TRUE,
FALSE,
);
foreach($useUploadTempDirectoryValues as $useUploadTempDirectoryValue) {
call_user_func(array('PHPExcel_Shared_File','setUseUploadTempDirectory'),$useUploadTempDirectoryValue);
$result = call_user_func(array('PHPExcel_Shared_File','getUseUploadTempDirectory'));
$this->assertEquals($useUploadTempDirectoryValue, $result);
}
}
}

View File

@@ -0,0 +1,94 @@
<?php
require_once 'testDataFileIterator.php';
class FontTest extends PHPUnit_Framework_TestCase
{
public function setUp()
{
if (!defined('PHPEXCEL_ROOT')) {
define('PHPEXCEL_ROOT', APPLICATION_PATH . '/');
}
require_once(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
}
public function testGetAutoSizeMethod()
{
$expectedResult = PHPExcel_Shared_Font::AUTOSIZE_METHOD_APPROX;
$result = call_user_func(array('PHPExcel_Shared_Font','getAutoSizeMethod'));
$this->assertEquals($expectedResult, $result);
}
public function testSetAutoSizeMethod()
{
$autosizeMethodValues = array(
PHPExcel_Shared_Font::AUTOSIZE_METHOD_EXACT,
PHPExcel_Shared_Font::AUTOSIZE_METHOD_APPROX,
);
foreach($autosizeMethodValues as $autosizeMethodValue) {
$result = call_user_func(array('PHPExcel_Shared_Font','setAutoSizeMethod'),$autosizeMethodValue);
$this->assertTrue($result);
}
}
public function testSetAutoSizeMethodWithInvalidValue()
{
$unsupportedAutosizeMethod = 'guess';
$result = call_user_func(array('PHPExcel_Shared_Font','setAutoSizeMethod'),$unsupportedAutosizeMethod);
$this->assertFalse($result);
}
/**
* @dataProvider providerFontSizeToPixels
*/
public function testFontSizeToPixels()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Shared_Font','fontSizeToPixels'),$args);
$this->assertEquals($expectedResult, $result);
}
public function providerFontSizeToPixels()
{
return new testDataFileIterator('rawTestData/Shared/FontSizeToPixels.data');
}
/**
* @dataProvider providerInchSizeToPixels
*/
public function testInchSizeToPixels()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Shared_Font','inchSizeToPixels'),$args);
$this->assertEquals($expectedResult, $result);
}
public function providerInchSizeToPixels()
{
return new testDataFileIterator('rawTestData/Shared/InchSizeToPixels.data');
}
/**
* @dataProvider providerCentimeterSizeToPixels
*/
public function testCentimeterSizeToPixels()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Shared_Font','centimeterSizeToPixels'),$args);
$this->assertEquals($expectedResult, $result);
}
public function providerCentimeterSizeToPixels()
{
return new testDataFileIterator('rawTestData/Shared/CentimeterSizeToPixels.data');
}
}

View File

@@ -0,0 +1,33 @@
<?php
require_once 'testDataFileIterator.php';
class PasswordHasherTest extends PHPUnit_Framework_TestCase
{
public function setUp()
{
if (!defined('PHPEXCEL_ROOT')) {
define('PHPEXCEL_ROOT', APPLICATION_PATH . '/');
}
require_once(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
}
/**
* @dataProvider providerHashPassword
*/
public function testHashPassword()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Shared_PasswordHasher','hashPassword'),$args);
$this->assertEquals($expectedResult, $result);
}
public function providerHashPassword()
{
return new testDataFileIterator('rawTestData/Shared/PasswordHashes.data');
}
}

View File

@@ -0,0 +1,83 @@
<?php
require_once 'testDataFileIterator.php';
class StringTest extends PHPUnit_Framework_TestCase
{
public function setUp()
{
if (!defined('PHPEXCEL_ROOT')) {
define('PHPEXCEL_ROOT', APPLICATION_PATH . '/');
}
require_once(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
}
public function testGetIsMbStringEnabled()
{
$result = call_user_func(array('PHPExcel_Shared_String','getIsMbstringEnabled'));
$this->assertTrue($result);
}
public function testGetIsIconvEnabled()
{
$result = call_user_func(array('PHPExcel_Shared_String','getIsIconvEnabled'));
$this->assertTrue($result);
}
public function testGetDecimalSeparator()
{
$localeconv = localeconv();
$expectedResult = (!empty($localeconv['decimal_point'])) ? $localeconv['decimal_point'] : ',';
$result = call_user_func(array('PHPExcel_Shared_String','getDecimalSeparator'));
$this->assertEquals($expectedResult, $result);
}
public function testSetDecimalSeparator()
{
$expectedResult = ',';
$result = call_user_func(array('PHPExcel_Shared_String','setDecimalSeparator'),$expectedResult);
$result = call_user_func(array('PHPExcel_Shared_String','getDecimalSeparator'));
$this->assertEquals($expectedResult, $result);
}
public function testGetThousandsSeparator()
{
$localeconv = localeconv();
$expectedResult = (!empty($localeconv['thousands_sep'])) ? $localeconv['thousands_sep'] : ',';
$result = call_user_func(array('PHPExcel_Shared_String','getThousandsSeparator'));
$this->assertEquals($expectedResult, $result);
}
public function testSetThousandsSeparator()
{
$expectedResult = ' ';
$result = call_user_func(array('PHPExcel_Shared_String','setThousandsSeparator'),$expectedResult);
$result = call_user_func(array('PHPExcel_Shared_String','getThousandsSeparator'));
$this->assertEquals($expectedResult, $result);
}
public function testGetCurrencyCode()
{
$localeconv = localeconv();
$expectedResult = (!empty($localeconv['currency_symbol'])) ? $localeconv['currency_symbol'] : '$';
$result = call_user_func(array('PHPExcel_Shared_String','getCurrencyCode'));
$this->assertEquals($expectedResult, $result);
}
public function testSetCurrencyCode()
{
$expectedResult = '£';
$result = call_user_func(array('PHPExcel_Shared_String','setCurrencyCode'),$expectedResult);
$result = call_user_func(array('PHPExcel_Shared_String','getCurrencyCode'));
$this->assertEquals($expectedResult, $result);
}
}

View File

@@ -0,0 +1,39 @@
<?php
class TimeZoneTest extends PHPUnit_Framework_TestCase
{
public function setUp()
{
if (!defined('PHPEXCEL_ROOT')) {
define('PHPEXCEL_ROOT', APPLICATION_PATH . '/');
}
require_once(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
}
public function testSetTimezone()
{
$timezoneValues = array(
'Europe/Prague',
'Asia/Tokyo',
'America/Indiana/Indianapolis',
'Pacific/Honolulu',
'Atlantic/St_Helena',
);
foreach($timezoneValues as $timezoneValue) {
$result = call_user_func(array('PHPExcel_Shared_TimeZone','setTimezone'),$timezoneValue);
$this->assertTrue($result);
}
}
public function testSetTimezoneWithInvalidValue()
{
$unsupportedTimezone = 'Etc/GMT+10';
$result = call_user_func(array('PHPExcel_Shared_TimeZone','setTimezone'),$unsupportedTimezone);
$this->assertFalse($result);
}
}

View File

@@ -0,0 +1,81 @@
<?php
require_once 'testDataFileIterator.php';
class ColorTest extends PHPUnit_Framework_TestCase
{
public function setUp()
{
if (!defined('PHPEXCEL_ROOT')) {
define('PHPEXCEL_ROOT', APPLICATION_PATH . '/');
}
require_once(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
}
/**
* @dataProvider providerColorGetRed
*/
public function testGetRed()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Style_Color','getRed'),$args);
$this->assertEquals($expectedResult, $result);
}
public function providerColorGetRed()
{
return new testDataFileIterator('rawTestData/Style/ColorGetRed.data');
}
/**
* @dataProvider providerColorGetGreen
*/
public function testGetGreen()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Style_Color','getGreen'),$args);
$this->assertEquals($expectedResult, $result);
}
public function providerColorGetGreen()
{
return new testDataFileIterator('rawTestData/Style/ColorGetGreen.data');
}
/**
* @dataProvider providerColorGetBlue
*/
public function testGetBlue()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Style_Color','getBlue'),$args);
$this->assertEquals($expectedResult, $result);
}
public function providerColorGetBlue()
{
return new testDataFileIterator('rawTestData/Style/ColorGetBlue.data');
}
/**
* @dataProvider providerColorChangeBrightness
*/
public function testChangeBrightness()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Style_Color','changeBrightness'),$args);
$this->assertEquals($expectedResult, $result);
}
public function providerColorChangeBrightness()
{
return new testDataFileIterator('rawTestData/Style/ColorChangeBrightness.data');
}
}

View File

@@ -0,0 +1,36 @@
<?php
require_once 'testDataFileIterator.php';
class NumberFormatTest extends PHPUnit_Framework_TestCase
{
public function setUp()
{
if (!defined('PHPEXCEL_ROOT')) {
define('PHPEXCEL_ROOT', APPLICATION_PATH . '/');
}
require_once(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
PHPExcel_Shared_String::setDecimalSeparator('.');
PHPExcel_Shared_String::setThousandsSeparator(',');
}
/**
* @dataProvider providerNumberFormat
*/
public function testFormatValueWithMask()
{
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Style_NumberFormat','toFormattedString'),$args);
$this->assertEquals($expectedResult, $result);
}
public function providerNumberFormat()
{
return new testDataFileIterator('rawTestData/Style/NumberFormat.data');
}
}

View File

@@ -0,0 +1,109 @@
<?php
class RuleTest extends PHPUnit_Framework_TestCase
{
private $_testAutoFilterRuleObject;
private $_mockAutoFilterColumnObject;
public function setUp()
{
if (!defined('PHPEXCEL_ROOT')) {
define('PHPEXCEL_ROOT', APPLICATION_PATH . '/');
}
require_once(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
$this->_mockAutoFilterColumnObject = $this->getMockBuilder('PHPExcel_Worksheet_AutoFilter_Column')
->disableOriginalConstructor()
->getMock();
$this->_mockAutoFilterColumnObject->expects($this->any())
->method('testColumnInRange')
->will($this->returnValue(3));
$this->_testAutoFilterRuleObject = new PHPExcel_Worksheet_AutoFilter_Column_Rule(
$this->_mockAutoFilterColumnObject
);
}
public function testGetRuleType()
{
$result = $this->_testAutoFilterRuleObject->getRuleType();
$this->assertEquals(PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_FILTER, $result);
}
public function testSetRuleType()
{
$expectedResult = PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DATEGROUP;
// Setters return the instance to implement the fluent interface
$result = $this->_testAutoFilterRuleObject->setRuleType($expectedResult);
$this->assertInstanceOf('PHPExcel_Worksheet_AutoFilter_Column_Rule', $result);
$result = $this->_testAutoFilterRuleObject->getRuleType();
$this->assertEquals($expectedResult, $result);
}
public function testSetValue()
{
$expectedResult = 100;
// Setters return the instance to implement the fluent interface
$result = $this->_testAutoFilterRuleObject->setValue($expectedResult);
$this->assertInstanceOf('PHPExcel_Worksheet_AutoFilter_Column_Rule', $result);
$result = $this->_testAutoFilterRuleObject->getValue();
$this->assertEquals($expectedResult, $result);
}
public function testGetOperator()
{
$result = $this->_testAutoFilterRuleObject->getOperator();
$this->assertEquals(PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_COLUMN_RULE_EQUAL, $result);
}
public function testSetOperator()
{
$expectedResult = PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_COLUMN_RULE_LESSTHAN;
// Setters return the instance to implement the fluent interface
$result = $this->_testAutoFilterRuleObject->setOperator($expectedResult);
$this->assertInstanceOf('PHPExcel_Worksheet_AutoFilter_Column_Rule', $result);
$result = $this->_testAutoFilterRuleObject->getOperator();
$this->assertEquals($expectedResult, $result);
}
public function testSetGrouping()
{
$expectedResult = PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DATEGROUP_MONTH;
// Setters return the instance to implement the fluent interface
$result = $this->_testAutoFilterRuleObject->setGrouping($expectedResult);
$this->assertInstanceOf('PHPExcel_Worksheet_AutoFilter_Column_Rule', $result);
$result = $this->_testAutoFilterRuleObject->getGrouping();
$this->assertEquals($expectedResult, $result);
}
public function testGetParent()
{
$result = $this->_testAutoFilterRuleObject->getParent();
$this->assertInstanceOf('PHPExcel_Worksheet_AutoFilter_Column', $result);
}
public function testSetParent()
{
// Setters return the instance to implement the fluent interface
$result = $this->_testAutoFilterRuleObject->setParent($this->_mockAutoFilterColumnObject);
$this->assertInstanceOf('PHPExcel_Worksheet_AutoFilter_Column_Rule', $result);
}
public function testClone()
{
$result = clone $this->_testAutoFilterRuleObject;
$this->assertInstanceOf('PHPExcel_Worksheet_AutoFilter_Column_Rule', $result);
}
}

View File

@@ -0,0 +1,173 @@
<?php
class AutofilterColumnTest extends PHPUnit_Framework_TestCase
{
private $_testInitialColumn = 'H';
private $_testAutoFilterColumnObject;
private $_mockAutoFilterObject;
public function setUp()
{
if (!defined('PHPEXCEL_ROOT')) {
define('PHPEXCEL_ROOT', APPLICATION_PATH . '/');
}
require_once(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
$this->_mockAutoFilterObject = $this->getMockBuilder('PHPExcel_Worksheet_AutoFilter')
->disableOriginalConstructor()
->getMock();
$this->_mockAutoFilterObject->expects($this->any())
->method('testColumnInRange')
->will($this->returnValue(3));
$this->_testAutoFilterColumnObject = new PHPExcel_Worksheet_AutoFilter_Column(
$this->_testInitialColumn,
$this->_mockAutoFilterObject
);
}
public function testGetColumnIndex()
{
$result = $this->_testAutoFilterColumnObject->getColumnIndex();
$this->assertEquals($this->_testInitialColumn, $result);
}
public function testSetColumnIndex()
{
$expectedResult = 'L';
// Setters return the instance to implement the fluent interface
$result = $this->_testAutoFilterColumnObject->setColumnIndex($expectedResult);
$this->assertInstanceOf('PHPExcel_Worksheet_AutoFilter_Column', $result);
$result = $this->_testAutoFilterColumnObject->getColumnIndex();
$this->assertEquals($expectedResult, $result);
}
public function testGetParent()
{
$result = $this->_testAutoFilterColumnObject->getParent();
$this->assertInstanceOf('PHPExcel_Worksheet_AutoFilter', $result);
}
public function testSetParent()
{
// Setters return the instance to implement the fluent interface
$result = $this->_testAutoFilterColumnObject->setParent($this->_mockAutoFilterObject);
$this->assertInstanceOf('PHPExcel_Worksheet_AutoFilter_Column', $result);
}
public function testGetFilterType()
{
$result = $this->_testAutoFilterColumnObject->getFilterType();
$this->assertEquals(PHPExcel_Worksheet_AutoFilter_Column::AUTOFILTER_FILTERTYPE_FILTER, $result);
}
public function testSetFilterType()
{
$result = $this->_testAutoFilterColumnObject->setFilterType(PHPExcel_Worksheet_AutoFilter_Column::AUTOFILTER_FILTERTYPE_DYNAMICFILTER);
$this->assertInstanceOf('PHPExcel_Worksheet_AutoFilter_Column', $result);
$result = $this->_testAutoFilterColumnObject->getFilterType();
$this->assertEquals(PHPExcel_Worksheet_AutoFilter_Column::AUTOFILTER_FILTERTYPE_DYNAMICFILTER, $result);
}
/**
* @expectedException PHPExcel_Exception
*/
public function testSetInvalidFilterTypeThrowsException()
{
$expectedResult = 'Unfiltered';
$result = $this->_testAutoFilterColumnObject->setFilterType($expectedResult);
}
public function testGetJoin()
{
$result = $this->_testAutoFilterColumnObject->getJoin();
$this->assertEquals(PHPExcel_Worksheet_AutoFilter_Column::AUTOFILTER_COLUMN_JOIN_OR, $result);
}
public function testSetJoin()
{
$result = $this->_testAutoFilterColumnObject->setJoin(PHPExcel_Worksheet_AutoFilter_Column::AUTOFILTER_COLUMN_JOIN_AND);
$this->assertInstanceOf('PHPExcel_Worksheet_AutoFilter_Column', $result);
$result = $this->_testAutoFilterColumnObject->getJoin();
$this->assertEquals(PHPExcel_Worksheet_AutoFilter_Column::AUTOFILTER_COLUMN_JOIN_AND, $result);
}
/**
* @expectedException PHPExcel_Exception
*/
public function testSetInvalidJoinThrowsException()
{
$expectedResult = 'Neither';
$result = $this->_testAutoFilterColumnObject->setJoin($expectedResult);
}
public function testSetAttributes()
{
$attributeSet = array( 'val' => 100,
'maxVal' => 200
);
// Setters return the instance to implement the fluent interface
$result = $this->_testAutoFilterColumnObject->setAttributes($attributeSet);
$this->assertInstanceOf('PHPExcel_Worksheet_AutoFilter_Column', $result);
}
public function testGetAttributes()
{
$attributeSet = array( 'val' => 100,
'maxVal' => 200
);
$this->_testAutoFilterColumnObject->setAttributes($attributeSet);
$result = $this->_testAutoFilterColumnObject->getAttributes();
$this->assertTrue(is_array($result));
$this->assertEquals(count($attributeSet), count($result));
}
public function testSetAttribute()
{
$attributeSet = array( 'val' => 100,
'maxVal' => 200
);
foreach($attributeSet as $attributeName => $attributeValue) {
// Setters return the instance to implement the fluent interface
$result = $this->_testAutoFilterColumnObject->setAttribute($attributeName,$attributeValue);
$this->assertInstanceOf('PHPExcel_Worksheet_AutoFilter_Column', $result);
}
}
public function testGetAttribute()
{
$attributeSet = array( 'val' => 100,
'maxVal' => 200
);
$this->_testAutoFilterColumnObject->setAttributes($attributeSet);
foreach($attributeSet as $attributeName => $attributeValue) {
$result = $this->_testAutoFilterColumnObject->getAttribute($attributeName);
$this->assertEquals($attributeValue, $result);
}
$result = $this->_testAutoFilterColumnObject->getAttribute('nonExistentAttribute');
$this->assertNull($result);
}
public function testClone()
{
$result = clone $this->_testAutoFilterColumnObject;
$this->assertInstanceOf('PHPExcel_Worksheet_AutoFilter_Column', $result);
}
}

View File

@@ -0,0 +1,340 @@
<?php
class AutoFilterTest extends PHPUnit_Framework_TestCase
{
private $_testInitialRange = 'H2:O256';
private $_testAutoFilterObject;
public function setUp()
{
if (!defined('PHPEXCEL_ROOT')) {
define('PHPEXCEL_ROOT', APPLICATION_PATH . '/');
}
require_once(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
$this->_mockWorksheetObject = $this->getMockBuilder('PHPExcel_Worksheet')
->disableOriginalConstructor()
->getMock();
$this->_mockCacheController = $this->getMockBuilder('PHPExcel_CachedObjectStorage_Memory')
->disableOriginalConstructor()
->getMock();
$this->_mockWorksheetObject->expects($this->any())
->method('getCellCacheController')
->will($this->returnValue($this->_mockCacheController));
$this->_testAutoFilterObject = new PHPExcel_Worksheet_AutoFilter(
$this->_testInitialRange,
$this->_mockWorksheetObject
);
}
public function testToString()
{
$expectedResult = $this->_testInitialRange;
// magic __toString should return the active autofilter range
$result = $this->_testAutoFilterObject;
$this->assertEquals($expectedResult, $result);
}
public function testGetParent()
{
$result = $this->_testAutoFilterObject->getParent();
$this->assertInstanceOf('PHPExcel_Worksheet', $result);
}
public function testSetParent()
{
// Setters return the instance to implement the fluent interface
$result = $this->_testAutoFilterObject->setParent($this->_mockWorksheetObject);
$this->assertInstanceOf('PHPExcel_Worksheet_AutoFilter', $result);
}
public function testGetRange()
{
$expectedResult = $this->_testInitialRange;
// Result should be the active autofilter range
$result = $this->_testAutoFilterObject->getRange();
$this->assertEquals($expectedResult, $result);
}
public function testSetRange()
{
$ranges = array('G1:J512' => 'Worksheet1!G1:J512',
'K1:N20' => 'K1:N20'
);
foreach($ranges as $actualRange => $fullRange) {
// Setters return the instance to implement the fluent interface
$result = $this->_testAutoFilterObject->setRange($fullRange);
$this->assertInstanceOf('PHPExcel_Worksheet_AutoFilter', $result);
// Result should be the new autofilter range
$result = $this->_testAutoFilterObject->getRange();
$this->assertEquals($actualRange, $result);
}
}
public function testClearRange()
{
$expectedResult = '';
// Setters return the instance to implement the fluent interface
$result = $this->_testAutoFilterObject->setRange();
$this->assertInstanceOf('PHPExcel_Worksheet_AutoFilter', $result);
// Result should be a clear range
$result = $this->_testAutoFilterObject->getRange();
$this->assertEquals($expectedResult, $result);
}
/**
* @expectedException PHPExcel_Exception
*/
public function testSetRangeInvalidRange()
{
$expectedResult = 'A1';
$result = $this->_testAutoFilterObject->setRange($expectedResult);
}
public function testGetColumnsEmpty()
{
// There should be no columns yet defined
$result = $this->_testAutoFilterObject->getColumns();
$this->assertInternalType('array', $result);
$this->assertEquals(0, count($result));
}
public function testGetColumnOffset()
{
$columnIndexes = array( 'H' => 0,
'K' => 3,
'M' => 5
);
// If we request a specific column by its column ID, we should get an
// integer returned representing the column offset within the range
foreach($columnIndexes as $columnIndex => $columnOffset) {
$result = $this->_testAutoFilterObject->getColumnOffset($columnIndex);
$this->assertEquals($columnOffset, $result);
}
}
/**
* @expectedException PHPExcel_Exception
*/
public function testGetInvalidColumnOffset()
{
$invalidColumn = 'G';
$result = $this->_testAutoFilterObject->getColumnOffset($invalidColumn);
}
public function testSetColumnWithString()
{
$expectedResult = 'L';
// Setters return the instance to implement the fluent interface
$result = $this->_testAutoFilterObject->setColumn($expectedResult);
$this->assertInstanceOf('PHPExcel_Worksheet_AutoFilter', $result);
$result = $this->_testAutoFilterObject->getColumns();
// Result should be an array of PHPExcel_Worksheet_AutoFilter_Column
// objects for each column we set indexed by the column ID
$this->assertInternalType('array', $result);
$this->assertEquals(1, count($result));
$this->assertArrayHasKey($expectedResult,$result);
$this->assertInstanceOf('PHPExcel_Worksheet_AutoFilter_Column', $result[$expectedResult]);
}
/**
* @expectedException PHPExcel_Exception
*/
public function testSetInvalidColumnWithString()
{
$invalidColumn = 'A';
$result = $this->_testAutoFilterObject->setColumn($invalidColumn);
}
public function testSetColumnWithColumnObject()
{
$expectedResult = 'M';
$columnObject = new PHPExcel_Worksheet_AutoFilter_Column($expectedResult);
// Setters return the instance to implement the fluent interface
$result = $this->_testAutoFilterObject->setColumn($columnObject);
$this->assertInstanceOf('PHPExcel_Worksheet_AutoFilter', $result);
$result = $this->_testAutoFilterObject->getColumns();
// Result should be an array of PHPExcel_Worksheet_AutoFilter_Column
// objects for each column we set indexed by the column ID
$this->assertInternalType('array', $result);
$this->assertEquals(1, count($result));
$this->assertArrayHasKey($expectedResult,$result);
$this->assertInstanceOf('PHPExcel_Worksheet_AutoFilter_Column', $result[$expectedResult]);
}
/**
* @expectedException PHPExcel_Exception
*/
public function testSetInvalidColumnWithObject()
{
$invalidColumn = 'E';
$columnObject = new PHPExcel_Worksheet_AutoFilter_Column($invalidColumn);
$result = $this->_testAutoFilterObject->setColumn($invalidColumn);
}
/**
* @expectedException PHPExcel_Exception
*/
public function testSetColumnWithInvalidDataType()
{
$invalidColumn = 123.456;
$columnObject = new PHPExcel_Worksheet_AutoFilter_Column($invalidColumn);
$result = $this->_testAutoFilterObject->setColumn($invalidColumn);
}
public function testGetColumns()
{
$columnIndexes = array('L','M');
foreach($columnIndexes as $columnIndex) {
$this->_testAutoFilterObject->setColumn($columnIndex);
}
$result = $this->_testAutoFilterObject->getColumns();
// Result should be an array of PHPExcel_Worksheet_AutoFilter_Column
// objects for each column we set indexed by the column ID
$this->assertInternalType('array', $result);
$this->assertEquals(count($columnIndexes), count($result));
foreach($columnIndexes as $columnIndex) {
$this->assertArrayHasKey($columnIndex,$result);
$this->assertInstanceOf('PHPExcel_Worksheet_AutoFilter_Column', $result[$columnIndex]);
}
}
public function testGetColumn()
{
$columnIndexes = array('L','M');
foreach($columnIndexes as $columnIndex) {
$this->_testAutoFilterObject->setColumn($columnIndex);
}
// If we request a specific column by its column ID, we should
// get a PHPExcel_Worksheet_AutoFilter_Column object returned
foreach($columnIndexes as $columnIndex) {
$result = $this->_testAutoFilterObject->getColumn($columnIndex);
$this->assertInstanceOf('PHPExcel_Worksheet_AutoFilter_Column', $result);
}
}
public function testGetColumnByOffset()
{
$columnIndexes = array( 0 => 'H',
3 => 'K',
5 => 'M'
);
// If we request a specific column by its offset, we should
// get a PHPExcel_Worksheet_AutoFilter_Column object returned
foreach($columnIndexes as $columnIndex => $columnID) {
$result = $this->_testAutoFilterObject->getColumnByOffset($columnIndex);
$this->assertInstanceOf('PHPExcel_Worksheet_AutoFilter_Column', $result);
$this->assertEquals($result->getColumnIndex(),$columnID);
}
}
public function testGetColumnIfNotSet()
{
// If we request a specific column by its column ID, we should
// get a PHPExcel_Worksheet_AutoFilter_Column object returned
$result = $this->_testAutoFilterObject->getColumn('K');
$this->assertInstanceOf('PHPExcel_Worksheet_AutoFilter_Column', $result);
}
/**
* @expectedException PHPExcel_Exception
*/
public function testGetColumnWithoutRangeSet()
{
// Clear the range
$result = $this->_testAutoFilterObject->setRange();
$result = $this->_testAutoFilterObject->getColumn('A');
}
public function testClearRangeWithExistingColumns()
{
$expectedResult = '';
$columnIndexes = array('L','M','N');
foreach($columnIndexes as $columnIndex) {
$this->_testAutoFilterObject->setColumn($columnIndex);
}
// Setters return the instance to implement the fluent interface
$result = $this->_testAutoFilterObject->setRange();
$this->assertInstanceOf('PHPExcel_Worksheet_AutoFilter', $result);
// Range should be cleared
$result = $this->_testAutoFilterObject->getRange();
$this->assertEquals($expectedResult, $result);
// Column array should be cleared
$result = $this->_testAutoFilterObject->getColumns();
$this->assertInternalType('array', $result);
$this->assertEquals(0, count($result));
}
public function testSetRangeWithExistingColumns()
{
$expectedResult = 'G1:J512';
// These columns should be retained
$columnIndexes1 = array('I','J');
foreach($columnIndexes1 as $columnIndex) {
$this->_testAutoFilterObject->setColumn($columnIndex);
}
// These columns should be discarded
$columnIndexes2 = array('K','L','M');
foreach($columnIndexes2 as $columnIndex) {
$this->_testAutoFilterObject->setColumn($columnIndex);
}
// Setters return the instance to implement the fluent interface
$result = $this->_testAutoFilterObject->setRange($expectedResult);
$this->assertInstanceOf('PHPExcel_Worksheet_AutoFilter', $result);
// Range should be correctly set
$result = $this->_testAutoFilterObject->getRange();
$this->assertEquals($expectedResult, $result);
// Only columns that existed in the original range and that
// still fall within the new range should be retained
$result = $this->_testAutoFilterObject->getColumns();
$this->assertInternalType('array', $result);
$this->assertEquals(count($columnIndexes1), count($result));
}
public function testClone()
{
$columnIndexes = array('L','M');
foreach($columnIndexes as $columnIndex) {
$this->_testAutoFilterObject->setColumn($columnIndex);
}
$result = clone $this->_testAutoFilterObject;
$this->assertInstanceOf('PHPExcel_Worksheet_AutoFilter', $result);
}
}

View File

@@ -0,0 +1,31 @@
<?php
class CellCollectionTest extends PHPUnit_Framework_TestCase
{
public function setUp()
{
if (!defined('PHPEXCEL_ROOT'))
{
define('PHPEXCEL_ROOT', APPLICATION_PATH . '/');
}
require_once(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
}
public function testCacheLastCell()
{
$methods = PHPExcel_CachedObjectStorageFactory::getCacheStorageMethods();
foreach ($methods as $method) {
PHPExcel_CachedObjectStorageFactory::initialize($method);
$workbook = new PHPExcel();
$cells = array('A1', 'A2');
$worksheet = $workbook->getActiveSheet();
$worksheet->setCellValue('A1', 1);
$worksheet->setCellValue('A2', 2);
$this->assertEquals($cells, $worksheet->getCellCollection(), "Cache method \"$method\".");
PHPExcel_CachedObjectStorageFactory::finalize();
}
}
}

View File

@@ -0,0 +1,87 @@
<?php
class ColumnCellIteratorTest extends PHPUnit_Framework_TestCase
{
public $mockWorksheet;
public $mockColumnCell;
public function setUp()
{
if (!defined('PHPEXCEL_ROOT')) {
define('PHPEXCEL_ROOT', APPLICATION_PATH . '/');
}
require_once(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
$this->mockCell = $this->getMockBuilder('PHPExcel_Cell')
->disableOriginalConstructor()
->getMock();
$this->mockWorksheet = $this->getMockBuilder('PHPExcel_Worksheet')
->disableOriginalConstructor()
->getMock();
$this->mockWorksheet->expects($this->any())
->method('getHighestRow')
->will($this->returnValue(5));
$this->mockWorksheet->expects($this->any())
->method('getCellByColumnAndRow')
->will($this->returnValue($this->mockCell));
}
public function testIteratorFullRange()
{
$iterator = new PHPExcel_Worksheet_ColumnCellIterator($this->mockWorksheet, 'A');
$ColumnCellIndexResult = 1;
$this->assertEquals($ColumnCellIndexResult, $iterator->key());
foreach($iterator as $key => $ColumnCell) {
$this->assertEquals($ColumnCellIndexResult++, $key);
$this->assertInstanceOf('PHPExcel_Cell', $ColumnCell);
}
}
public function testIteratorStartEndRange()
{
$iterator = new PHPExcel_Worksheet_ColumnCellIterator($this->mockWorksheet, 'A', 2, 4);
$ColumnCellIndexResult = 2;
$this->assertEquals($ColumnCellIndexResult, $iterator->key());
foreach($iterator as $key => $ColumnCell) {
$this->assertEquals($ColumnCellIndexResult++, $key);
$this->assertInstanceOf('PHPExcel_Cell', $ColumnCell);
}
}
public function testIteratorSeekAndPrev()
{
$iterator = new PHPExcel_Worksheet_ColumnCellIterator($this->mockWorksheet, 'A', 2, 4);
$columnIndexResult = 4;
$iterator->seek(4);
$this->assertEquals($columnIndexResult, $iterator->key());
for($i = 1; $i < $columnIndexResult-1; $i++) {
$iterator->prev();
$this->assertEquals($columnIndexResult - $i, $iterator->key());
}
}
/**
* @expectedException PHPExcel_Exception
*/
public function testSeekOutOfRange()
{
$iterator = new PHPExcel_Worksheet_ColumnCellIterator($this->mockWorksheet, 'A', 2, 4);
$iterator->seek(1);
}
/**
* @expectedException PHPExcel_Exception
*/
public function testPrevOutOfRange()
{
$iterator = new PHPExcel_Worksheet_ColumnCellIterator($this->mockWorksheet, 'A', 2, 4);
$iterator->prev();
}
}

View File

@@ -0,0 +1,89 @@
<?php
class ColumnIteratorTest extends PHPUnit_Framework_TestCase
{
public $mockWorksheet;
public $mockColumn;
public function setUp()
{
if (!defined('PHPEXCEL_ROOT')) {
define('PHPEXCEL_ROOT', APPLICATION_PATH . '/');
}
require_once(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
$this->mockColumn = $this->getMockBuilder('PHPExcel_Worksheet_Column')
->disableOriginalConstructor()
->getMock();
$this->mockWorksheet = $this->getMockBuilder('PHPExcel_Worksheet')
->disableOriginalConstructor()
->getMock();
$this->mockWorksheet->expects($this->any())
->method('getHighestColumn')
->will($this->returnValue('E'));
$this->mockWorksheet->expects($this->any())
->method('current')
->will($this->returnValue($this->mockColumn));
}
public function testIteratorFullRange()
{
$iterator = new PHPExcel_Worksheet_ColumnIterator($this->mockWorksheet);
$columnIndexResult = 'A';
$this->assertEquals($columnIndexResult, $iterator->key());
foreach($iterator as $key => $column) {
$this->assertEquals($columnIndexResult++, $key);
$this->assertInstanceOf('PHPExcel_Worksheet_Column', $column);
}
}
public function testIteratorStartEndRange()
{
$iterator = new PHPExcel_Worksheet_ColumnIterator($this->mockWorksheet, 'B', 'D');
$columnIndexResult = 'B';
$this->assertEquals($columnIndexResult, $iterator->key());
foreach($iterator as $key => $column) {
$this->assertEquals($columnIndexResult++, $key);
$this->assertInstanceOf('PHPExcel_Worksheet_Column', $column);
}
}
public function testIteratorSeekAndPrev()
{
$ranges = range('A','E');
$iterator = new PHPExcel_Worksheet_ColumnIterator($this->mockWorksheet, 'B', 'D');
$columnIndexResult = 'D';
$iterator->seek('D');
$this->assertEquals($columnIndexResult, $iterator->key());
for($i = 1; $i < array_search($columnIndexResult, $ranges); $i++) {
$iterator->prev();
$expectedResult = $ranges[array_search($columnIndexResult, $ranges) - $i];
$this->assertEquals($expectedResult, $iterator->key());
}
}
/**
* @expectedException PHPExcel_Exception
*/
public function testSeekOutOfRange()
{
$iterator = new PHPExcel_Worksheet_ColumnIterator($this->mockWorksheet, 'B', 'D');
$iterator->seek('A');
}
/**
* @expectedException PHPExcel_Exception
*/
public function testPrevOutOfRange()
{
$iterator = new PHPExcel_Worksheet_ColumnIterator($this->mockWorksheet, 'B', 'D');
$iterator->prev();
}
}

View File

@@ -0,0 +1,89 @@
<?php
class RowCellIteratorTest extends PHPUnit_Framework_TestCase
{
public $mockWorksheet;
public $mockRowCell;
public function setUp()
{
if (!defined('PHPEXCEL_ROOT')) {
define('PHPEXCEL_ROOT', APPLICATION_PATH . '/');
}
require_once(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
$this->mockCell = $this->getMockBuilder('PHPExcel_Cell')
->disableOriginalConstructor()
->getMock();
$this->mockWorksheet = $this->getMockBuilder('PHPExcel_Worksheet')
->disableOriginalConstructor()
->getMock();
$this->mockWorksheet->expects($this->any())
->method('getHighestColumn')
->will($this->returnValue('E'));
$this->mockWorksheet->expects($this->any())
->method('getCellByColumnAndRow')
->will($this->returnValue($this->mockCell));
}
public function testIteratorFullRange()
{
$iterator = new PHPExcel_Worksheet_RowCellIterator($this->mockWorksheet);
$RowCellIndexResult = 'A';
$this->assertEquals($RowCellIndexResult, $iterator->key());
foreach($iterator as $key => $RowCell) {
$this->assertEquals($RowCellIndexResult++, $key);
$this->assertInstanceOf('PHPExcel_Cell', $RowCell);
}
}
public function testIteratorStartEndRange()
{
$iterator = new PHPExcel_Worksheet_RowCellIterator($this->mockWorksheet, 2, 'B', 'D');
$RowCellIndexResult = 'B';
$this->assertEquals($RowCellIndexResult, $iterator->key());
foreach($iterator as $key => $RowCell) {
$this->assertEquals($RowCellIndexResult++, $key);
$this->assertInstanceOf('PHPExcel_Cell', $RowCell);
}
}
public function testIteratorSeekAndPrev()
{
$ranges = range('A','E');
$iterator = new PHPExcel_Worksheet_RowCellIterator($this->mockWorksheet, 2, 'B', 'D');
$RowCellIndexResult = 'D';
$iterator->seek('D');
$this->assertEquals($RowCellIndexResult, $iterator->key());
for($i = 1; $i < array_search($RowCellIndexResult, $ranges); $i++) {
$iterator->prev();
$expectedResult = $ranges[array_search($RowCellIndexResult, $ranges) - $i];
$this->assertEquals($expectedResult, $iterator->key());
}
}
/**
* @expectedException PHPExcel_Exception
*/
public function testSeekOutOfRange()
{
$iterator = new PHPExcel_Worksheet_RowCellIterator($this->mockWorksheet, 2, 'B', 'D');
$iterator->seek(1);
}
/**
* @expectedException PHPExcel_Exception
*/
public function testPrevOutOfRange()
{
$iterator = new PHPExcel_Worksheet_RowCellIterator($this->mockWorksheet, 2, 'B', 'D');
$iterator->prev();
}
}

View File

@@ -0,0 +1,87 @@
<?php
class RowIteratorTest extends PHPUnit_Framework_TestCase
{
public $mockWorksheet;
public $mockRow;
public function setUp()
{
if (!defined('PHPEXCEL_ROOT')) {
define('PHPEXCEL_ROOT', APPLICATION_PATH . '/');
}
require_once(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
$this->mockRow = $this->getMockBuilder('PHPExcel_Worksheet_Row')
->disableOriginalConstructor()
->getMock();
$this->mockWorksheet = $this->getMockBuilder('PHPExcel_Worksheet')
->disableOriginalConstructor()
->getMock();
$this->mockWorksheet->expects($this->any())
->method('getHighestRow')
->will($this->returnValue(5));
$this->mockWorksheet->expects($this->any())
->method('current')
->will($this->returnValue($this->mockRow));
}
public function testIteratorFullRange()
{
$iterator = new PHPExcel_Worksheet_RowIterator($this->mockWorksheet);
$rowIndexResult = 1;
$this->assertEquals($rowIndexResult, $iterator->key());
foreach($iterator as $key => $row) {
$this->assertEquals($rowIndexResult++, $key);
$this->assertInstanceOf('PHPExcel_Worksheet_Row', $row);
}
}
public function testIteratorStartEndRange()
{
$iterator = new PHPExcel_Worksheet_RowIterator($this->mockWorksheet, 2, 4);
$rowIndexResult = 2;
$this->assertEquals($rowIndexResult, $iterator->key());
foreach($iterator as $key => $row) {
$this->assertEquals($rowIndexResult++, $key);
$this->assertInstanceOf('PHPExcel_Worksheet_Row', $row);
}
}
public function testIteratorSeekAndPrev()
{
$iterator = new PHPExcel_Worksheet_RowIterator($this->mockWorksheet, 2, 4);
$columnIndexResult = 4;
$iterator->seek(4);
$this->assertEquals($columnIndexResult, $iterator->key());
for($i = 1; $i < $columnIndexResult-1; $i++) {
$iterator->prev();
$this->assertEquals($columnIndexResult - $i, $iterator->key());
}
}
/**
* @expectedException PHPExcel_Exception
*/
public function testSeekOutOfRange()
{
$iterator = new PHPExcel_Worksheet_RowIterator($this->mockWorksheet, 2, 4);
$iterator->seek(1);
}
/**
* @expectedException PHPExcel_Exception
*/
public function testPrevOutOfRange()
{
$iterator = new PHPExcel_Worksheet_RowIterator($this->mockWorksheet, 2, 4);
$iterator->prev();
}
}

View File

@@ -0,0 +1,46 @@
<?php
class WorksheetColumnTest extends PHPUnit_Framework_TestCase
{
public $mockWorksheet;
public $mockColumn;
public function setUp()
{
if (!defined('PHPEXCEL_ROOT')) {
define('PHPEXCEL_ROOT', APPLICATION_PATH . '/');
}
require_once(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
$this->mockWorksheet = $this->getMockBuilder('PHPExcel_Worksheet')
->disableOriginalConstructor()
->getMock();
$this->mockWorksheet->expects($this->any())
->method('getHighestRow')
->will($this->returnValue(5));
}
public function testInstantiateColumnDefault()
{
$column = new PHPExcel_Worksheet_Column($this->mockWorksheet);
$this->assertInstanceOf('PHPExcel_Worksheet_Column', $column);
$columnIndex = $column->getColumnIndex();
$this->assertEquals('A', $columnIndex);
}
public function testInstantiateColumnSpecified()
{
$column = new PHPExcel_Worksheet_Column($this->mockWorksheet, 'E');
$this->assertInstanceOf('PHPExcel_Worksheet_Column', $column);
$columnIndex = $column->getColumnIndex();
$this->assertEquals('E', $columnIndex);
}
public function testGetCellIterator()
{
$column = new PHPExcel_Worksheet_Column($this->mockWorksheet);
$cellIterator = $column->getCellIterator();
$this->assertInstanceOf('PHPExcel_Worksheet_ColumnCellIterator', $cellIterator);
}
}

View File

@@ -0,0 +1,46 @@
<?php
class WorksheetRowTest extends PHPUnit_Framework_TestCase
{
public $mockWorksheet;
public $mockRow;
public function setUp()
{
if (!defined('PHPEXCEL_ROOT')) {
define('PHPEXCEL_ROOT', APPLICATION_PATH . '/');
}
require_once(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
$this->mockWorksheet = $this->getMockBuilder('PHPExcel_Worksheet')
->disableOriginalConstructor()
->getMock();
$this->mockWorksheet->expects($this->any())
->method('getHighestColumn')
->will($this->returnValue('E'));
}
public function testInstantiateRowDefault()
{
$row = new PHPExcel_Worksheet_Row($this->mockWorksheet);
$this->assertInstanceOf('PHPExcel_Worksheet_Row', $row);
$rowIndex = $row->getRowIndex();
$this->assertEquals(1, $rowIndex);
}
public function testInstantiateRowSpecified()
{
$row = new PHPExcel_Worksheet_Row($this->mockWorksheet, 5);
$this->assertInstanceOf('PHPExcel_Worksheet_Row', $row);
$rowIndex = $row->getRowIndex();
$this->assertEquals(5, $rowIndex);
}
public function testGetCellIterator()
{
$row = new PHPExcel_Worksheet_Row($this->mockWorksheet);
$cellIterator = $row->getCellIterator();
$this->assertInstanceOf('PHPExcel_Worksheet_RowCellIterator', $cellIterator);
}
}

View File

@@ -0,0 +1,49 @@
<?php
/**
* $Id: bootstrap.php 2892 2011-08-14 15:11:50Z markbaker@phpexcel.net $
*
* @copyright Copyright (C) 2011-2014 PHPExcel. All rights reserved.
* @package PHPExcel
* @subpackage PHPExcel Unit Tests
* @author Mark Baker
*/
chdir(dirname(__FILE__));
setlocale(LC_ALL, 'en_US.utf8');
// PHP 5.3 Compat
date_default_timezone_set('Europe/London');
// Define path to application directory
defined('APPLICATION_PATH')
|| define('APPLICATION_PATH', realpath(dirname(__FILE__) . '/../Classes'));
// Define path to application tests directory
defined('APPLICATION_TESTS_PATH')
|| define('APPLICATION_TESTS_PATH', realpath(dirname(__FILE__) ));
// Define application environment
defined('APPLICATION_ENV') || define('APPLICATION_ENV', 'ci');
// Ensure library/ is on include_path
set_include_path(implode(PATH_SEPARATOR, array(
realpath(APPLICATION_PATH . '/../Classes'),
'./',
dirname(__FILE__),
get_include_path(),
)));
/**
* @todo Sort out xdebug in vagrant so that this works in all sandboxes
* For now, it is safer to test for it rather then remove it.
*/
echo "PHPExcel tests beginning\n";
if(extension_loaded('xdebug')) {
echo "Xdebug extension loaded and running\n";
xdebug_enable();
} else {
echo 'Xdebug not found, you should run the following at the command line: echo "zend_extension=/usr/lib64/php/modules/xdebug.so" > /etc/php.d/xdebug.ini' . "\n";
}

View File

@@ -0,0 +1,114 @@
<?php
class Complex {
private $realPart = 0;
private $imaginaryPart = 0;
private $suffix = NULL;
public static function _parseComplex($complexNumber)
{
// Test for real number, with no imaginary part
if (is_numeric($complexNumber))
return array( $complexNumber, 0, NULL );
// Fix silly human errors
if (strpos($complexNumber,'+-') !== FALSE)
$complexNumber = str_replace('+-','-',$complexNumber);
if (strpos($complexNumber,'++') !== FALSE)
$complexNumber = str_replace('++','+',$complexNumber);
if (strpos($complexNumber,'--') !== FALSE)
$complexNumber = str_replace('--','-',$complexNumber);
// Basic validation of string, to parse out real and imaginary parts, and any suffix
$validComplex = preg_match('/^([\-\+]?(\d+\.?\d*|\d*\.?\d+)([Ee][\-\+]?[0-2]?\d{1,3})?)([\-\+]?(\d+\.?\d*|\d*\.?\d+)([Ee][\-\+]?[0-2]?\d{1,3})?)?(([\-\+]?)([ij]?))$/ui',$complexNumber,$complexParts);
if (!$validComplex) {
// Neither real nor imaginary part, so test to see if we actually have a suffix
$validComplex = preg_match('/^([\-\+]?)([ij])$/ui',$complexNumber,$complexParts);
if (!$validComplex) {
throw new Exception('COMPLEX: Invalid complex number');
}
// We have a suffix, so set the real to 0, the imaginary to either 1 or -1 (as defined by the sign)
$imaginary = 1;
if ($complexParts[1] === '-') {
$imaginary = 0 - $imaginary;
}
return array(0, $imaginary, $complexParts[2]);
}
// If we don't have an imaginary part, identify whether it should be +1 or -1...
if (($complexParts[4] === '') && ($complexParts[9] !== '')) {
if ($complexParts[7] !== $complexParts[9]) {
$complexParts[4] = 1;
if ($complexParts[8] === '-') {
$complexParts[4] = -1;
}
// ... or if we have only the real and no imaginary part (in which case our real should be the imaginary)
} else {
$complexParts[4] = $complexParts[1];
$complexParts[1] = 0;
}
}
// Return real and imaginary parts and suffix as an array, and set a default suffix if user input lazily
return array( $complexParts[1],
$complexParts[4],
!empty($complexParts[9]) ? $complexParts[9] : 'i'
);
} // function _parseComplex()
public function __construct($realPart, $imaginaryPart = null, $suffix = 'i')
{
if ($imaginaryPart === null) {
if (is_array($realPart)) {
// We have an array of (potentially) real and imaginary parts, and any suffix
list ($realPart, $imaginaryPart, $suffix) = array_values($realPart) + array(0.0, 0.0, 'i');
} elseif((is_string($realPart)) || (is_numeric($realPart))) {
// We've been given a string to parse to extract the real and imaginary parts, and any suffix
list ($realPart, $imaginaryPart, $suffix) = self::_parseComplex($realPart);
}
}
// Set parsed values in our properties
$this->realPart = (float) $realPart;
$this->imaginaryPart = (float) $imaginaryPart;
$this->suffix = strtolower($suffix);
}
public function getReal()
{
return $this->realPart;
}
public function getImaginary()
{
return $this->imaginaryPart;
}
public function getSuffix()
{
return $this->suffix;
}
public function __toString() {
$str = "";
if ($this->imaginaryPart != 0.0) {
if (abs($this->imaginaryPart) != 1.0) {
$str .= $this->imaginaryPart . $this->suffix;
} else {
$str .= (($this->imaginaryPart < 0.0) ? '-' : ''). $this->suffix;
}
}
if ($this->realPart != 0.0) {
if (($str) && ($this->imaginaryPart > 0.0))
$str = "+" . $str;
$str = $this->realPart . $str;
}
if (!$str)
$str = "0.0";
return $str;
}
}

View File

@@ -0,0 +1,62 @@
<?php
include_once dirname(__FILE__).'/Complex.php';
class complexAssert {
private $_errorMessage = '';
public function assertComplexEquals($expected, $actual, $delta = 0)
{
if ($expected{0} === '#') {
// Expecting an error, so we do a straight string comparison
if ($expected === $actual) {
return TRUE;
}
$this->_errorMessage = 'Expected Error: ' .
$actual . ' !== ' . $expected;
return FALSE;
}
$expectedComplex = new Complex($expected);
$actualComplex = new Complex($actual);
if (!is_numeric($actualComplex->getReal()) || !is_numeric($expectedComplex->getReal())) {
if ($actualComplex->getReal() !== $expectedComplex->getReal()) {
$this->_errorMessage = 'Mismatched String: ' .
$actualComplex->getReal() . ' !== ' . $expectedComplex->getReal();
return FALSE;
}
return TRUE;
}
if ($actualComplex->getReal() < ($expectedComplex->getReal() - $delta) ||
$actualComplex->getReal() > ($expectedComplex->getReal() + $delta)) {
$this->_errorMessage = 'Mismatched Real part: ' .
$actualComplex->getReal() . ' != ' . $expectedComplex->getReal();
return FALSE;
}
if ($actualComplex->getImaginary() < ($expectedComplex->getImaginary() - $delta) ||
$actualComplex->getImaginary() > ($expectedComplex->getImaginary() + $delta)) {
$this->_errorMessage = 'Mismatched Imaginary part: ' .
$actualComplex->getImaginary() . ' != ' . $expectedComplex->getImaginary();
return FALSE;
}
if ($actualComplex->getSuffix() !== $actualComplex->getSuffix()) {
$this->_errorMessage = 'Mismatched Suffix: ' .
$actualComplex->getSuffix() . ' != ' . $expectedComplex->getSuffix();
return FALSE;
}
return TRUE;
}
public function getErrorMessage() {
return $this->_errorMessage;
}
}

View File

@@ -0,0 +1,40 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit bootstrap="./bootstrap.php"
backupGlobals="true"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
syntaxCheck="true"
verbose="true"
strict="true"
stopOnError="false"
stopOnFailure="false"
stopOnIncomplete="false"
stopOnSkipped="false">
<php>
<ini name="memory_limit" value="2048M"/>
</php>
<testsuite name="PHPExcel Unit Test Suite">
<directory suffix="Test.php">./Classes</directory>
</testsuite>
<filter>
<whitelist>
<directory suffix=".php">../Classes</directory>
<exclude>
<directory>../Classes/PHPExcel/Shared/PCLZip</directory>
<directory>../Classes/PHPExcel/Shared/JAMA</directory>
<directory>../Classes/PHPExcel/Writer/PDF</directory>
</exclude>
</whitelist>
</filter>
<logging>
<log type="coverage-html" target="./codeCoverage" charset="UTF-8"
yui="true" highlight="false"
lowUpperBound="35" highLowerBound="70"/>
<log type="coverage-clover" target="./codeCoverage/codeCoverage.xml"/>
<log type="metrics-xml" target="./metrics/metrics.xml"/>
<log type="test-xml" target="./testResults/logfile.xml" logIncompleteSkipped="false"/>
</logging>
</phpunit>

View File

@@ -0,0 +1,32 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit bootstrap="./bootstrap.php"
backupGlobals="true"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
syntaxCheck="true"
verbose="true"
strict="true"
stopOnError="false"
stopOnFailure="false"
stopOnIncomplete="false"
stopOnSkipped="false">
<php>
<ini name="memory_limit" value="2048M"/>
</php>
<testsuite name="PHPExcel Unit Test Suite">
<directory suffix="Test.php">./Classes</directory>
</testsuite>
<filter>
<whitelist>
<directory suffix=".php">../Classes</directory>
<exclude>
<directory>../Classes/PHPExcel/Shared/PCLZip</directory>
<directory>../Classes/PHPExcel/Shared/JAMA</directory>
<directory>../Classes/PHPExcel/Writer/PDF</directory>
</exclude>
</whitelist>
</filter>
</phpunit>

View File

@@ -0,0 +1,79 @@
# Year Month Day Result Comments
18, 11, 11, 6890
1900, 1, 1, 1 // Excel 1900 Calendar Base Date
1900, 2, 28, 59 // Day before Excel mythical 1900 leap day
1900, 2, 29, 60 // Excel mythical 1900 leap day
1900, 3, 1, 61 // Day after Excel mythical 1900 leap day
1901, 12, 13, 713 // Day after Excel mythical 1900 leap day
1901, 12, 14, 714 // PHP 32-bit Earliest Date
1903, 12, 31, 1461
1904, 1, 1, 1462 // Excel 1904 Calendar Base Date
1904, 1, 2, 1463
1960, 12, 19, 22269
1970, 1, 1, 25569 // PHP Base Date
1982, 12, 7, 30292
2008, 6, 12, 39611
2038, 1, 19, 50424 // PHP 32-bit Latest Date
2038, 1, 20, 50425 // Day after PHP 32-bit Latest Date
2008, 1, 1, 39448
2008, 1, , 39447
2008, 1, -1, 39446
2008, 1, -30, 39417
2008, 1, -31, 39416
2008, 1, -365, 39082
2008, 3, 1, 39508
2008, 3, , 39507
2008, 3, -1, 39506
2008, 3, -365, 39142
2008, , 1, 39417
2008, -1, 1, 39387
2008, -11, 1, 39083
2008, -12, 1, 39052
2008, -13, 1, 39022
2008, -13, 30, 39051
2008, -13, , 39021
2008, -13, -30, 38991
2008, -13, -31, 38990
2008, 13, 1, 39814
2007, 15, , 39507
2008, 26, 1, 40210
2008, 26, -10, 40199
2008, -26, 61, 38686
2010, -15, -50, 39641
2010, -15, 50, 39741
2010, 15, -50, 40552
2010, 15, 50, 40652
2010, 1.5, 1, 40179
2010, 1.5, 0, 40178
2010, 0, 1.5, 40148
2010, 1, 1.5, 40179
2012, 6, 15, 41075
2012, 6, , 41060
2012, , 15, 40892
, 6, 15, 167
10, 6, 15, 3819
10, , , 3622
, 10, , 274
, , 10, "#NUM!"
-20, , , "#NUM!"
-20, 6, 15, "#NUM!"
9999, 12, 31, 2958465 // Excel Maximum Date
10000, 1, 1, "#NUM!" // Exceeded Excel Maximum Date
2008, 8, 10, 39670
2008, 12, 31, 39813
2008, 8, 32, 39692
2008, 13, 31, 39844
2009, 1, 0, 39813
2009, 1, -1, 39812
2009, 0, 0, 39782
2009, 0, -1, 39781
2009, -1, 0, 39752
2009, -1, -1, 39751
2010, 0, -1, 40146
2010, 5, 31, 40329
2010, 1, '21st', 40199 // MS Excel will fail with a #VALUE return, but PHPExcel can parse this date
2010, "March",'21st', 40258 // MS Excel will fail with a #VALUE return, but PHPExcel can parse this date
2010, "March",21, 40258 // MS Excel will fail with a #VALUE return, but PHPExcel can parse this date
"ABC", 1, 21, "#VALUE!"
2010, "DEF", 21, "#VALUE!"
2010, 3, "GHI", "#VALUE!"

View File

@@ -0,0 +1,96 @@
"ABC", "2007-1-10", "Y", "#VALUE!"
"2007-1-1", "DEF", "Y", "#VALUE!"
"2007-1-1", "2007-1-10", "XYZ", "#VALUE!"
"2007-1-10", "2007-1-1", "Y", "#NUM!"
"2007-12-31", "2008-1-10", "Y", 0
"2007-1-1", "2007-1-10", "Y", 0
"2007-1-1", "2007-1-10", "M", 0
"2007-1-1", "2007-1-10", "D", 9
"2007-1-1", "2007-1-10", "YM", 0
"2007-1-1", "2007-1-10", "YD", 9
"2007-1-1", "2007-1-10", "MD", 9
"2007-1-1", "2007-12-31", "Y", 0
"2007-1-1", "2007-12-31", "M", 11
"2007-1-1", "2007-12-31", "D", 364
"2007-1-1", "2007-12-31", "YM", 11
"2007-1-1", "2007-12-31", "YD", 364
"2007-1-1", "2007-12-31", "MD", 30
"2007-1-1", "2008-7-1", "Y", 1
"2007-1-1", "2008-7-1", "M", 18
"2007-1-1", "2008-7-1", "D", 547
"2007-1-1", "2008-7-1", "YM", 6
"2007-1-1", "2008-7-1", "YD", 181
"2007-1-1", "2008-7-1", "MD", 0
"2007-1-1", "2007-1-31", "Y", 0
"2007-1-1", "2007-1-31", "M", 0
"2007-1-1", "2007-1-31", "D", 30
"2007-1-1", "2007-1-31", "YM", 0
"2007-1-1", "2007-1-31", "YD", 30
"2007-1-1", "2007-1-31", "MD", 30
"2007-1-1", "2007-2-1", "Y", 0
"2007-1-1", "2007-2-1", "M", 1
"2007-1-1", "2007-2-1", "D", 31
"2007-1-1", "2007-2-1", "YM", 1
"2007-1-1", "2007-2-1", "YD", 31
"2007-1-1", "2007-2-1", "MD", 0
"2007-1-1", "2007-2-28", "Y", 0
"2007-1-1", "2007-2-28", "M", 1
"2007-1-1", "2007-2-28", "D", 58
"2007-1-1", "2007-2-28", "YM", 1
"2007-1-1", "2007-2-28", "YD", 58
"2007-1-1", "2007-2-28", "MD", 27
"2007-1-31", "2007-2-1", "Y", 0
"2007-1-31", "2007-2-1", "M", 0
"2007-1-31", "2007-2-1", "D", 1
"2007-1-31", "2007-2-1", "YM", 0
"2007-1-31", "2007-2-1", "YD", 1
"2007-1-31", "2007-2-1", "MD", 1
"2007-1-31", "2007-3-1", "Y", 0
"2007-1-31", "2007-3-1", "M", 1
"2007-1-31", "2007-3-1", "D", 29
"2007-1-31", "2007-3-1", "YM", 1
"2007-1-31", "2007-3-1", "YD", 29
"2007-1-31", "2007-3-1", "MD", -2
"2007-1-31", "2007-3-31", "Y", 0
"2007-1-31", "2007-3-31", "M", 2
"2007-1-31", "2007-3-31", "D", 59
"2007-1-31", "2007-3-31", "YM", 2
"2007-1-31", "2007-3-31", "YD", 59
"2007-1-31", "2007-3-31", "MD", 0
"2008-1-1", "2008-9-1", "Y", 0
"2008-1-1", "2008-9-1", "M", 8
"2008-1-1", "2008-9-1", "D", 244
"2008-1-1", "2008-9-1", "YM", 8
"2008-1-1", "2008-9-1", "YD", 244
"2008-1-1", "2008-9-1", "MD", 0
"2007-2-1", "2008-4-1", "Y", 1
"2007-2-1", "2008-4-1", "M", 14
"2007-2-1", "2008-4-1", "D", 425
"2007-2-1", "2008-4-1", "YM", 2
"2007-2-1", "2008-4-1", "YD", 59
"2007-2-1", "2008-4-1", "MD", 0
"1960-12-19", "2008-6-28", "Y", 47
"1960-12-19", "2008-6-28", "M", 570
"1960-12-19", "2008-6-28", "D", 17358
"1960-12-19", "2008-6-28", "YM", 6
"1960-12-19", "2008-6-28", "YD", 191
"1960-12-19", "2008-6-28", "MD", 9
"1982-12-7", "2008-6-28", "Y", 25
"1982-12-7", "2008-6-28", "M", 306
"1982-12-7", "2008-6-28", "D", 9335
"1982-12-7", "2008-6-28", "YM", 6
"1982-12-7", "2008-6-28", "YD", 203
"1982-12-7", "2008-6-28", "MD", 21
"2007-12-25", "2010-3-17", "Y", 2
"2007-12-25", "2010-3-17", "M", 26
"2007-12-25", "2010-3-17", "D", 813
"2007-12-25", "2010-3-17", "YM", 2
"2007-12-25", "2010-3-17", "YD", 82
"2007-12-25", "2010-3-17", "MD", 20
"19-12-1960", "26-01-2012" "Y", 51
"19-12-1960", "26-01-2012" "M", 613
"19-12-1960", "26-01-2012" "D", 18665
"19-12-1960", "26-01-2012" "YM", 1
"19-12-1960", "26-01-2012" "YD", 38
"19-12-1960", "26-01-2012" "MD", 7
"19-12-1960", "12-12-2012" "Y", 50

View File

@@ -0,0 +1,66 @@
# Date String Result
"25-Dec-1899", "#VALUE!"
"31-Dec-1899", "#VALUE!"
"1-Jan-1900", 1
"1900/2/28", 59
"29-02-1900", 60
"29th February 1900", 60 // MS Excel will fail with a #VALUE return, but PHPExcel can parse this date
"1900/3/1", 61
"13-12-1901", 713
"14-12-1901", 714
"1903/12/31", 1461
"1-Jan-1904", 1462
"2nd-Jan-1904", 1463 // MS Excel will fail with a #VALUE return, but PHPExcel can parse this date
"19-12-1960", 22269
"1st January 1970", 25569 // MS Excel will fail with a #VALUE return, but PHPExcel can parse this date
"7-Dec-1982", 30292
"1-1-2008", 39448
"2038-01-19", 50424
"2-6-2008", 39601
"December 25th 2008", 39807 // MS Excel will fail with a #VALUE return, but PHPExcel can parse this date
"1 Jan-2008", 39448
"12-31-2008", 39813 // MS Excel success or failure dependent on country settings
"31-12-2008", 39813 // PHPExcel tries to handle both US and UK formats, irrespective of country settings
"8/22/2008", 39682 // MS Excel success or failure dependent on country settings
"22/8/2008", 39682 // PHPExcel tries to handle both US and UK formats, irrespective of country settings
"22/8/08", 39682
"22-AUG-2008", 39682
"2008/02/23", 39501
"6-7-2008", 39635
"28-2-2007", 39141 // MS Excel success or failure dependent on country settings
"2-28-2007", 39141 // PHPExcel tries to handle both US and UK formats, irrespective of country settings
"29-2-2007", "#VALUE!" // Should fail because it's an invalid date, but PHPExcel currently adjusts to 1-3-2007 - FIX NEEDED
"1/1/1999", 36161
"1954-07-20", 19925
"22 August 98", 36029
"1st March 2007", 39142 // MS Excel will fail with a #VALUE return, but PHPExcel can parse this date
"The 1st day of March 2007", "#VALUE!"
"1 Jan", 41275
"31/12", 41639
"12/31", 11658 // Excel reads as 1st December 1931, not 31st December in current year
"5-JUL", 41460
"5 Jul", 41460
"12/2008", 39783
"10/32", 11963
11, "#VALUE!"
TRUE, "#VALUE!"
FALSE, "#VALUE!"
1, "#VALUE!"
12345, "#VALUE!"
12, "#VALUE!"
"12-Feb-2010", 40221
"Feb-12-2010", 40221 // MS Excel will fail with a #VALUE return, but PHPExcel can parse this date
"February-12-2010", 40221 // MS Excel will fail with a #VALUE return, but PHPExcel can parse this date
"February 12 2010", 40221 // MS Excel will fail with a #VALUE return, but PHPExcel can parse this date
"18 Feb 2010", 40227
"17th 3rd 2010", 40254 // MS Excel will fail with a #VALUE return, but PHPExcel can parse this date
"Feb 18th 2010", 40227 // MS Excel will fail with a #VALUE return, but PHPExcel can parse this date
"1st Feb 2010", 40210 // MS Excel will fail with a #VALUE return, but PHPExcel can parse this date
"1st-Feb-2010", 40210 // MS Excel will fail with a #VALUE return, but PHPExcel can parse this date
"1me Fev 2010", "#VALUE!"
"February 1st 2010", 40210 // MS Excel will fail with a #VALUE return, but PHPExcel can parse this date
"2nd Feb 2010", 40211 // MS Excel will fail with a #VALUE return, but PHPExcel can parse this date
"Second Feb 2010", "#VALUE!"
"First August 2010", "#VALUE!"
"1st August 2010", 40391 // MS Excel will fail with a #VALUE return, but PHPExcel can parse this date
"15:30:25", 0

View File

@@ -0,0 +1,8 @@
# Date Value Result
22269, 19
30348, 1
30843, 10
"11-Nov-1918", 11
"28-Feb-1904", 28
"Invalid", "#VALUE!"
-1, "#NUM!"

View File

@@ -0,0 +1,34 @@
"ABC", "2007-1-10", FALSE, "#VALUE!"
"2007-1-1", "DEF", TRUE, "#VALUE!"
"2007-1-1", "2007-1-10", "XYZ", "#VALUE!"
"2007-1-10", "2007-1-1", "Y", "#VALUE!"
"2007-1-1", "2007-1-10", FALSE, 9
"2007-1-1", "2007-1-10", TRUE, 9
"2007-1-1", "2007-12-31", FALSE, 360
"2007-1-1", "2007-12-31", TRUE, 359
"2007-1-1", "2008-7-1", FALSE, 540
"2007-1-1", "2008-7-1", TRUE, 540
"2007-1-1", "2007-1-31", FALSE, 30
"2007-1-1", "2007-1-31", TRUE, 29
"2007-1-1", "2007-2-1", FALSE, 30
"2007-1-1", "2007-2-1", TRUE, 30
"2007-1-1", "2007-2-28", FALSE, 57
"2007-1-1", "2007-2-28", TRUE, 57
"2007-1-31", "2007-2-1", FALSE, 1
"2007-1-31", "2007-2-1", TRUE, 1
"2007-1-31", "2007-3-1", FALSE, 31
"2007-1-31", "2007-3-1", TRUE, 31
"2007-1-31", "2007-3-31", FALSE, 60
"2007-1-31", "2007-3-31", TRUE, 60
"2008-1-1", "2008-9-1", FALSE, 240
"2008-1-1", "2008-9-1", TRUE, 240
"2007-2-1", "2008-4-1", FALSE, 420
"2007-2-1", "2008-4-1", TRUE, 420
"1960-12-19", "2008-6-28", FALSE, 17109
"1960-12-19", "2008-6-28", TRUE, 17109
"1982-12-7", "2008-6-28", FALSE, 9201
"1982-12-7", "2008-6-28", TRUE, 9201
"2000-2-28", "2000-3-31", FALSE, 33
"2000-2-28", "2000-3-31", TRUE, 32
"2000-2-29", "2000-3-31", FALSE, 30
"2000-2-29", "2000-3-31", TRUE, 31

View File

@@ -0,0 +1,15 @@
"15-Jan-2008", 1, 39493
"15-Jan-2008", -1, 39431
"15-Jan-2008", 2, 39522
"31-Mar-2007", 1, 39202
"31-Mar-2007", -1, 39141
"31-Mar-2008", -1, 39507
"31-Mar-2008", -4, 39416
"29-Feb-2008", -12, 39141
"15-Mar-2007", 3, 39248
22269.0, 0, 22269
22269.0, 2, 22331
22269.0, 110, 25618
22269.0, -110, 18920
"15-Mar-2007", "ABC", "#VALUE!"
"Invalid", 12, "#VALUE!"

View File

@@ -0,0 +1,17 @@
"15-Jan-2008", 1, 39507
"15-Jan-2008", -1, 39447
"15-Jan-2008", 2, 39538
"31-Mar-2007", 1, 39202
"31-Mar-2007", -1, 39141
"31-Mar-2008", -1, 39507
"31-Mar-2008", -4, 39416
"29-Feb-2008", -12, 39141
"15-Mar-2007", 3, 39263
22269.0, 0, 22281
22269.0, 2, 22340
22269.0, 110, 25627
22269.0, -110, 18932
22269.0, 3, 22371
22269.0, 3.75, 22371
"15-Mar-2007", "ABC", "#VALUE!"
"Invalid", 12, "#VALUE!"

View File

@@ -0,0 +1,12 @@
0.25, 6
0.75, 18
0.5, 12
0.6, 14
"11-Nov-1918 11:11", 11
"11:59 PM", 23
"23:59:59", 23
3600, 2
-3600, 0
7200, 3
65535, 19
"1 O'Clock", "#VALUE!"

View File

@@ -0,0 +1,12 @@
0.2, 48
0.4, 36
0.6, 24
0.8, 12
"11-Nov-1918 11:15", 15
"11:59 PM", 59
"23:59:59", 59
3600, 0
-3600, 0
12500, 28
65535, 12
"Half past 1 O'Clock", "#VALUE!"

View File

@@ -0,0 +1,12 @@
, 1
0, 1
22269.0, 12
30348.0, 2
30843.0, 6
"11-Nov-1918", 11
"28-Feb-1904", 2
"01 Jul 2003", 7
38094, 4
"Dec 2003", 12
-10, "#NUM!"
"ABCD", "#VALUE!"

View File

@@ -0,0 +1,18 @@
"1-Jan-2007", "10-Jan-2007", 8
"18-Jun-2008", "20-Jun-2008", 3
"16-Jun-2008", "20-Jun-2008", 5
"14-Jun-2008", "20-Jun-2008", 5
"20-Jun-2008", "20-Jun-2008", 1
"21-Jun-2008", "21-Jun-2008", 0
"20-Jun-2008", "20-Jun-2008", "20-Jun-2008", 0
"20-Jun-2008", "20-Jun-2008", "20-Jun-2008", "20-Jun-2008", 0
"14-Jun-2008", "25-Jun-2008", 8
"19-Dec-1960", "10-Jan-1961", 17
"10-Jan-1961", "19-Dec-1960", -17
"19-Dec-1960", "10-Jan-1961", "25-Dec-1960", "26-Dec-1960", "01-Jan-1961", 16
"10-Jan-1961", "19-Dec-1960", "25-Dec-1960", "26-Dec-1960", "01-Jan-1961", -16
"1-Jan-2007", "31-Mar-2007", 65
"1-Jan-2007", "31-Jan-2007", 23
"1-Jan-2007", "1-Feb-2007", 24
"1-Jan-2007", "28-Feb-2007", 43
"31-Jan-2007", "1-Feb-2007", 2

View File

@@ -0,0 +1,12 @@
0.2339930556, 57
0.4202893519, 13
0.6078935185, 22
0.8022106481, 11
"11-Nov-1918 11:15:35", 35
"11:59 PM", 0
"23:59:59", 59
3600, 0
-3601, 59
12500, 20
65535, 15
"Half past 1 O'Clock", "#VALUE!"

View File

@@ -0,0 +1,22 @@
18, 11, 11, 0.757766203704
6, 15, 5, 0.260474537037
12, 30, 10, 0.520949074074
18, 45, 25, 0.781539351852
15, 32, 50, 0.647800925926
12, , 61, 0.500706018519
11, , -1, 0.458321759259
10, , -67, 0.415891203704
13, 62, 5, 0.584780092593
9, -80, 17, 0.319641203704
8, -162, , 0.220833333333
2, -120, -1, "#NUM!"
2, -120, , 0.000000000000
2, -120, 1, 0.000011574074
36, 1, 2, 0.500717592593
-1, 2, 3, "#NUM!"
-1, 61, 29, 0.001030092593
-1, 61, -60, 0.000000000000
"A", , , "#VALUE!"
11, 59, 0, 0.499305555556
12, 0, 0, 0.500000000000
16, 48, 10, 0.700115740741

View File

@@ -0,0 +1,13 @@
"12:00:00 am", 0
"12:01:02 am", 0.000717593
"12:03 pm", 0.502083333
"12:7:11 pm", 0.504988426
"4:13:39", 0.176145833
"6:20:17 pm", 0.764085648
"18:33:27", 0.773229167
"31/12/2007 03:27:15", 0.143923611
"9:44:55 pm", 0.90619213
12, "#VALUE!"
"13:01", 0.542361111
"33:45", 0.40625
"13:01PM", "#VALUE!"

View File

@@ -0,0 +1,27 @@
"24-Oct-1968", 5
"24-Oct-1968", 2, 4
"24-Oct-1968", 3, 3
"2000-06-14", 4
"2000-06-14", 2, 3
"2000-06-14", 3, 2
"1996-07-24", 4
"1996-07-24", 2, 3
"1996-07-24", 3, 2
"1996-07-27", 7
"1996-07-27", 2, 6
"1996-07-27", 3, 5
"1977-7-31", 1
"1977-7-31", 2, 7
"1977-7-31", 3, 6
"1977-8-1", 2
"1977-8-1", 2, 1
"1977-8-1", 3, 0
"1900-2-5", 2, 7
"1900-2-1", 1
38093, 6
38093, 2, 5
38093, 3, 4
"3/7/1977", "A", "#VALUE!"
"3/7/1977", 0, "#NUM!"
"Invalid", 1, "#VALUE!"
-1, "#NUM!"

View File

@@ -0,0 +1,7 @@
"21-Dec-2000", 1, 52
"1995-01-01", 1, 1
"3/7/1977", 27
"3/7/1977", "A", "#VALUE!"
"3/7/1977", 0, "#NUM!"
"Invalid", 1, "#VALUE!"
-1, "#NUM!"

View File

@@ -0,0 +1,13 @@
"1-Jan-2007", "ABC", "#VALUE!"
"1-Jan-2007", 9, 39094
"18-Jun-2008", 2, 39619
"16-Jun-2008", 4, 39619
"14-Jun-2008", 6, 39622
"14-Jun-2008", 11, 39629
"14-Jun-2008", -2, 39611
"14-Jun-2008", -6, 39605
"19-Dec-2008", 10, 39815
"19-Dec-2008", 10, "25-Dec-2008", "26-Dec-2008", "01-Jan-2009", 39820
"19-Dec-2008", 10, {"25-Dec-2008"|"26-Dec-2008"|"01-Jan-2009"}, 39820
39820, -10, {"25-Dec-2008"|"26-Dec-2008"|"01-Jan-2009"}, 39801
"5-Apr-2012", 3, {"6-Apr-2012"|"9-Apr-2012"}, 41010

View File

@@ -0,0 +1,11 @@
, 1900
1, 1900
33333.33, 1991
22269.0, 1960
30348.0, 1983
30843.0, 1984
"01 Jan 2525", 2525
"11-Nov-1918", 1918
"28-Feb-1904", 1904
-10, "#NUM!"
"ABCD", "#VALUE!"

View File

@@ -0,0 +1,65 @@
"2007-1-1", "2007-1-10", 0, 0.025
"2007-1-1", "2007-1-10", 1, 0.02465753424658
"2007-1-1", "2007-1-10", 2, 0.025
"2007-1-1", "2007-1-10", 3, 0.02465753424658
"2007-1-1", "2007-1-10", 4, 0.025
"2007-1-1", "2007-12-31", 0, 1.0
"2007-1-1", "2007-12-31", 1, 0.99726027397260
"2007-1-1", "2007-12-31", 2, 1.01111111111111
"2007-1-1", "2007-12-31", 3, 0.99726027397260
"2007-1-1", "2007-12-31", 4, 0.99722222222222
"2007-1-1", "2008-7-1", 0, 1.5
"2007-1-1", "2008-7-1", 1, 1.49658002735978
"2007-1-1", "2008-7-1", 2, 1.51944444444444
"2007-1-1", "2008-7-1", 3, 1.49863013698630
"2007-1-1", "2008-7-1", 4, 1.5
"2007-1-1", "2007-1-31", 0, 0.08333333333333
"2007-1-1", "2007-1-31", 1, 0.08219178082192
"2007-1-1", "2007-1-31", 2, 0.08333333333333
"2007-1-1", "2007-1-31", 3, 0.08219178082192
"2007-1-1", "2007-1-31", 4, 0.08055555555556
"2007-1-1", "2007-2-1", 0, 0.08333333333333
"2007-1-1", "2007-2-1", 1, 0.08493150684932
"2007-1-1", "2007-2-1", 2, 0.08611111111111
"2007-1-1", "2007-2-1", 3, 0.08493150684932
"2007-1-1", "2007-2-1", 4, 0.08333333333333
"2007-1-1", "2007-2-28", 0, 0.15833333333333
"2007-1-1", "2007-2-28", 1, 0.15890410958904
"2007-1-1", "2007-2-28", 2, 0.16111111111111
"2007-1-1", "2007-2-28", 3, 0.15890410958904
"2007-1-1", "2007-2-28", 4, 0.15833333333333
"2007-1-31", "2007-2-1", 0, 0.00277777777778
"2007-1-31", "2007-2-1", 1, 0.00273972602740
"2007-1-31", "2007-2-1", 2, 0.00277777777778
"2007-1-31", "2007-2-1", 3, 0.00273972602740
"2007-1-31", "2007-2-1", 4, 0.00277777777778
"2007-1-31", "2007-3-1", 0, 0.08611111111111
"2007-1-31", "2007-3-1", 1, 0.07945205479452
"2007-1-31", "2007-3-1", 2, 0.08055555555556
"2007-1-31", "2007-3-1", 3, 0.07945205479452
"2007-1-31", "2007-3-1", 4, 0.08611111111111
"2007-1-31", "2007-3-31", 0, 0.16666666666667
"2007-1-31", "2007-3-31", 1, 0.16164383561644
"2007-1-31", "2007-3-31", 2, 0.16388888888889
"2007-1-31", "2007-3-31", 3, 0.16164383561644
"2007-1-31", "2007-3-31", 4, 0.16666666666667
"2008-1-1", "2008-9-1", 0, 0.66666666666667
"2008-1-1", "2008-9-1", 1, 0.66666666666667
"2008-1-1", "2008-9-1", 2, 0.67777777777778
"2008-1-1", "2008-9-1", 3, 0.66849315068493
"2008-1-1", "2008-9-1", 4, 0.66666666666667
"2007-2-1", "2008-4-1", 0, 1.16666666666667
"2007-2-1", "2008-4-1", 1, 1.16279069767442
"2007-2-1", "2008-4-1", 2, 1.18055555555556
"2007-2-1", "2008-4-1", 3, 1.16438356164384
"2007-2-1", "2008-4-1", 4, 1.16666666666667
"1960-12-19", "2008-6-28", 0, 47.525
"1960-12-19", "2008-6-28", 1, 47.52162252765670
"1960-12-19", "2008-6-28", 2, 48.21666666666670
"1960-12-19", "2008-6-28", 3, 47.55616438356160
"1960-12-19", "2008-6-28", 4, 47.525
"1982-12-7", "2008-6-28", 0, 25.55833333333330
"1982-12-7", "2008-6-28", 1, 25.55718921111340
"1982-12-7", "2008-6-28", 2, 25.93055555555560
"1982-12-7", "2008-6-28", 3, 25.57534246575340
"1982-12-7", "2008-6-28", 4, 25.55833333333330

View File

@@ -0,0 +1,59 @@
1.5, -1, "#NUM!"
-1, 6, 2.2488660949282200E-05
0, 3, 0.0
3, 0, 4.8807925650332900
1, 5, 2.7146314958504900E-04
1.5, 1, 9.8166642847516600E-01
-1.5, 2.5, 3.3783462087443800E-01
-1.5, 14.99, 2.1218581758012900E-13
1, 30, 3.5395005050254700E-42
2.5, 1, 2.5167162420253600
2.5, 1.5, 2.5167162420253600
-2.5, 1.5, -2.5167162420253600
3.5, 1, 6.2058349320630000
0.7, 3, 7.3673733669342700E-03
3.5, 2, 3.8320120716293600
35, 2, 1.0129348967887200E+14
-35, 2, 1.0129348967887200E+14
-35, 3, -9.4217724797020600E+13
-35, 4, 8.5141821583727800E+13
1.5, "XYZ", "#VALUE!"
"ABC", 3, "#VALUE!"
-9, 1, -1.0309147086534900E+03
-3.5, 1, -6.2058349320630000
-0.735, 1, -3.9288151661176300E-01
0, 1, 0.0
0.035, 1, 1.7502679823335300E-02
1, 1, 5.6515909758194300E-01
1.5, 1, 9.8166642847516600E-01
2.5, 1, 2.5167162420253600
3.5, 1, 6.2058349320630000
-9, 2, 8.6449622063929800E+02
-3.5, 2, 3.8320120716293600
-0.735, 2, 7.0619941066585700E-02
0, 2, 0.0
0.035, 2, 1.5314063208086000E-04
0.9, 2, 1.0825972222234100E-01
1, 2, 1.3574766658069900E-01
1.9, 2, 6.0327243548745000E-01
2.5, 2, 1.2764661588156100
3.5, 2, 3.8320120716293600
4, 2, 6.4221894991960900
0.035, 3, 8.9329755645604500E-07
0.7, 3, 7.3673733669342700E-03
0.89, 3, 1.5428502532466100E-02
4, 3, 3.3372758428109200
4, 5, 5.0472437285149600E-01
1.5, 7, 2.8406417355214300E-05
3, 9, 1.3237298826652200E-04
-3.5, 0, 7.3782034775718600
-1.5, 0, 1.6467232021476800
0, 0, 1.0
1, 0, 1.2660658480342600
1.5, 0, 1.6467232021476800
2.5, 0, 3.2898391723912900
3.5, 0, 7.3782034775718600
-3.5, -1, "#NUM!"
TRUE, 1, "#VALUE!"
1, TRUE, "#VALUE!"
21, 2, 1.0477785626593200E+08

View File

@@ -0,0 +1,37 @@
1.5, -1, "#NUM!"
0, 1, 0.0
1, 1, 4.4005058567713000E-01
1, 5, 2.4975773021123400E-04
1.9, 2, 3.2992582866978500E-01
-2.5, 1.5, -4.9709410250442200E-01
3.5, 1, 1.3737752717818600E-01
0.89, 3, 1.3974004027880800E-02
3.5, 2, 4.5862918476829000E-01
35, 2, 1.2935945082689100E-01
-35, 2, 1.2935945082689100E-01
-35, 3, 2.9207004782372000E-02
-35, 4, -1.3436636593244100E-01
1.5, "XYZ", "#VALUE!"
"ABC", 3, "#VALUE!"
-3.5, 1, -1.3737752717818600E-01
-0.735, 1, -3.4323577520309400E-01
0, 1, 0.0
0.035, 1, 1.7497320451918700E-02
1.5, 1, 5.5793650789080400E-01
2.5, 1, 4.9709410250442200E-01
3.5, 1, 1.3737752717818600E-01
-9, 2, 1.4484636919412800E-01
-0.735, 2, 6.4538955636373900E-02
0, 2, 0.0
0.9, 2, 9.4586304292255000E-02
1.9, 2, 3.2992582866978500E-01
0.035, 2, 1.5310936908796500E-04
3.5, 2, 4.5862918476829000E-01
4, 2, 3.6412814319431200E-01
0.035, 3, 8.9316078090293600E-07
0.7, 3, 6.9296548267509400E-03
0.89, 3, 1.3974004027880800E-02
4, 3, 4.3017147115339600E-01
4, 5, 1.3208665605594800E-01
1.5, 7, 2.4679795788287900E-05
3, 9, 8.4395021309091800E-05

View File

@@ -0,0 +1,38 @@
1.5, -1, "#NUM!"
0, 2, "#NUM!"
0.1, 3, 7.9900124326586500E+03
1, 0, 4.2102442108341800E-01
1.5, 0, 2.1380556932365400E-01
-1.5, 2, "#NUM!"
1.5, 1, 2.7738780363225900E-01
1.5, 2, 5.8365597416666600E-01
2.3, 1.5, 9.4982447142959400E-02
2.5, 1, 7.3890815650266900E-02
3.5, 1, 2.2239393224640700E-02
3.5, 3, 5.9161817991348200E-02
3, 9, 3.9795880106238500E+02
3.5, 2, 3.2307121670869000E-02
1.5, "XYZ", "#VALUE!"
"ABC", 3, "#VALUE!"
-3.5, 1, "#NUM!"
-0.735, 1, "#NUM!"
0, 1, "#NUM!"
0.035, 1, 2.8501970000186900E+01
1.5, 1, 2.7738780363225900E-01
2.5, 1, 7.3890815650266900E-02
3.5, 1, 2.2239393224640700E-02
-9, 2, "#NUM!"
-0.735, 2, "#NUM!"
0, 2, "#NUM!"
0.9, 2, 2.0790271301014400
1.9, 2, 2.9690930137427500E-01
0.035, 2, 1.6321537072931900E+03
3.5, 2, 3.2307121670869000E-02
4, 2, 1.7401425543547400E-02
0.035, 3, 1.8656035423207900E+05
0.7, 3, 2.1972168909566600E+01
0.89, 3, 1.0317473075007600E+01
4, 3, 2.9884924431707800E-02
4, 5, 1.5434254881392600E-01
1.5, 7, 2.4577004526116700E+03
3, 9, 3.9795880106238500E+02

View File

@@ -0,0 +1,37 @@
1.5, -1, "#NUM!"
1.23, 45.67, -2.7027311261175000E+63
2.5, 0, 4.9807035844668900E-01
2.5, 1, 1.4591813750831300E-01
2.5, 2, -3.8133584844003800E-01
3.5, 1, 4.1018841662769800E-01
3.5, 3, -3.5833534643622900E-01
4, 2, 2.1590359910699000E-01
3.5, 2, 4.5371436417535000E-02
12.5, 0, -1.7121430684466900E-01
12.5, 1, -1.5383825635163900E-01
12.5, 2, 1.4660018586805400E-01
12.5, 22, -3.5760343503878700E+02
1.5, "XYZ", "#VALUE!"
"ABC", 3, "#VALUE!"
-3.5, 1, "#NUM!"
-0.735, 1, "#NUM!"
0, 1, "#NUM!"
0.035, 1, -1.8233338940000000E+01
1.5, 1, -4.1230862700000000E-01
2.5, 1, 1.4591813800000000E-01
3.5, 1, 4.1018841700000000E-01
-9, 2, "#NUM!"
-0.735, 2, "#NUM!"
0, 2, "#NUM!"
0.9, 2, -1.9459096070000000
1.9, 2, -6.6987867400000000E-01
0.035, 2, -1.0396979410000000E+03
3.5, 2, 4.5371436000000000E-02
4, 2, 2.1590359900000000E-01
0.035, 3, -1.1880438840000000E+05
0.7, 3, -1.5819479070000000E+01
0.89, 3, -8.0204412520000000
4, 3, -1.8202211000000000E-01
4, 5, -7.9585141800000000E-01
1.5, 7, -1.8873970340000000E+03
3, 9, -4.4495950710000000E+02

View File

@@ -0,0 +1,10 @@
"10110010", "178"
"1100100", "100"
"111001010101", "#NUM!" // Too large
"101", "5"
"10", "2"
"0", "0"
"21", "#NUM!" // Invalid binary number
TRUE, "#VALUE!" // Non string
"1110010101", "-107" // 2's Complement
"1111111111", "-1" // 2's Complement

View File

@@ -0,0 +1,14 @@
"10110010", "B2"
"111001010101", "#NUM!" // Too large
"11111011", 4, "00FB" // Leading places
"11111011", 3.75, "0FB" // Leading places as a float
"11111011", -1, "#NUM!" // Leading places negative
"11111011", "ABC", "#VALUE!" // Leading places non-numeric
"1110", "E"
"101", "5"
"10", "2"
"0", "0"
"21", "#NUM!" // Invalid binary number
TRUE, "#VALUE!" // Non string
"1110010101", "FFFFFFFF95" // 2's Complement
"1111111111", "FFFFFFFFFF" // 2's Complement

View File

@@ -0,0 +1,15 @@
"1100100", "144"
"10110010", "262"
"111001010101", "#NUM!" // Too large
"1001", 3, "011" // Leading places
"1001", 4.75, "0011" // Leading places as a float
"1001", -1, "#NUM!" // Leading places negative
"1001", "ABC", "#VALUE!" // Leading places non-numeric
"00000010", "2"
"00000101", "5"
"00001101", "15"
"0", "0"
"21", "#NUM!" // Invalid binary number
TRUE, "#VALUE!" // Non string
"1110010101", "7777777625" // 2's Complement
"1111111111", "7777777777" // 2's Complement

View File

@@ -0,0 +1,547 @@
3, 4, "3+4i"
3, 4, "j", "3+4j"
12.34, 5.67, "j", "12.34+5.67j"
3.5, "A", "#VALUE!"
1.234E-5, 6.78E9, "1.234E-5+6780000000i"
1.234E5, 6.78E-9, "123400+6.78E-9i"
3.5, 2.5, "3.5+2.5i"
3.5, 1, "3.5+i"
3.5, 0, 3.5
3.5, -1, "3.5-i"
3.5, -2.5, "3.5-2.5i"
1, 2.5, "1+2.5i"
1, 1, "1+i"
1, 0, 1
1, -1, "1-i"
1, -2.5, "1-2.5i"
0, 2.5, "2.5i"
0, 1, "i"
0, 0, 0
0, -1, "-i"
0, -2.5, "-2.5i"
-1, 2.5, "-1+2.5i"
-1, 1, "-1+i"
-1, 0, -1
-1, -1, "-1-i"
-1, -2.5, "-1-2.5i"
-3.5, 2.5, "-3.5+2.5i"
-3.5, 1, "-3.5+i"
-3.5, 0, "-3.5"
-3.5, -1, "-3.5-i"
-3.5, -2.5, "-3.5-2.5i"
-2.5, -2.5, "-2.5-2.5i"
-2.5, -2.5, "-2.5-2.5i"
-1.5, -2.5, "-1.5-2.5i"
-1.5, -2.5, "-1.5-2.5i"
-0.5, -2.5, "-0.5-2.5i"
0, -2.5, "-2.5i"
0.5, -2.5, "0.5-2.5i"
1, -2.5, "1-2.5i"
1.5, -2.5, "1.5-2.5i"
2, -2.5, "2-2.5i"
2.5, -2.5, "2.5-2.5i"
3, -2.5, "3-2.5i"
3.5, -2.5, "3.5-2.5i"
-2.5, -2.5, "-2.5-2.5i"
-2.5, -2.5, "-2.5-2.5i"
-1.5, -2.5, "-1.5-2.5i"
-1.5, -2.5, "-1.5-2.5i"
-0.5, -2.5, "-0.5-2.5i"
0, -2.5, "-2.5i"
0.5, -2.5, "0.5-2.5i"
1, -2.5, "1-2.5i"
1.5, -2.5, "1.5-2.5i"
2, -2.5, "2-2.5i"
2.5, -2.5, "2.5-2.5i"
3, -2.5, "3-2.5i"
3.5, -2.5, "3.5-2.5i"
-2.5, -1.5, "-2.5-1.5i"
-2.5, -1.5, "-2.5-1.5i"
-1.5, -1.5, "-1.5-1.5i"
-1.5, -1.5, "-1.5-1.5i"
-0.5, -1.5, "-0.5-1.5i"
0, -1.5, "-1.5i"
0.5, -1.5, "0.5-1.5i"
1, -1.5, "1-1.5i"
1.5, -1.5, "1.5-1.5i"
2, -1.5, "2-1.5i"
2.5, -1.5, "2.5-1.5i"
3, -1.5, "3-1.5i"
3.5, -1.5, "3.5-1.5i"
-2.5, -1.5, "-2.5-1.5i"
-2.5, -1.5, "-2.5-1.5i"
-1.5, -1.5, "-1.5-1.5i"
-1.5, -1.5, "-1.5-1.5i"
-0.5, -1.5, "-0.5-1.5i"
0, -1.5, "-1.5i"
0.5, -1.5, "0.5-1.5i"
1, -1.5, "1-1.5i"
1.5, -1.5, "1.5-1.5i"
2, -1.5, "2-1.5i"
2.5, -1.5, "2.5-1.5i"
3, -1.5, "3-1.5i"
3.5, -1.5, "3.5-1.5i"
-2.5, -0.5, "-2.5-0.5i"
-2.5, -0.5, "-2.5-0.5i"
-1.5, -0.5, "-1.5-0.5i"
-1.5, -0.5, "-1.5-0.5i"
-0.5, -0.5, "-0.5-0.5i"
0, -0.5, "-0.5i"
0.5, -0.5, "0.5-0.5i"
1, -0.5, "1-0.5i"
1.5, -0.5, "1.5-0.5i"
2, -0.5, "2-0.5i"
2.5, -0.5, "2.5-0.5i"
3, -0.5, "3-0.5i"
3.5, -0.5, "3.5-0.5i"
-2.5, 0, -2.5
-2.5, 0, -2.5
-1.5, 0, -1.5
-1.5, 0, -1.5
-0.5, 0, -0.5
0, 0, 0
0.5, 0, 0.5
1, 0, 1
1.5, 0, 1.5
2, 0, 2
2.5, 0, 2.5
3, 0, 3
3.5, 0, 3.5
-2.5, 0.5, "-2.5+0.5i"
-2.5, 0.5, "-2.5+0.5i"
-1.5, 0.5, "-1.5+0.5i"
-1.5, 0.5, "-1.5+0.5i"
-0.5, 0.5, "-0.5+0.5i"
0, 0.5, "0.5i"
0.5, 0.5, "0.5+0.5i"
1, 0.5, "1+0.5i"
1.5, 0.5, "1.5+0.5i"
2, 0.5, "2+0.5i"
2.5, 0.5, "2.5+0.5i"
3, 0.5, "3+0.5i"
3.5, 0.5, "3.5+0.5i"
-2.5, 1, "-2.5+i"
-2.5, 1, "-2.5+i"
-1.5, 1, "-1.5+i"
-1.5, 1, "-1.5+i"
-0.5, 1, "-0.5+i"
0, 1, "i"
0.5, 1, "0.5+i"
1, 1, "1+i"
1.5, 1, "1.5+i"
2, 1, "2+i"
2.5, 1, "2.5+i"
3, 1, "3+i"
3.5, 1, "3.5+i"
-2.5, 1.5, "-2.5+1.5i"
-2.5, 1.5, "-2.5+1.5i"
-1.5, 1.5, "-1.5+1.5i"
-1.5, 1.5, "-1.5+1.5i"
-0.5, 1.5, "-0.5+1.5i"
0, 1.5, "1.5i"
0.5, 1.5, "0.5+1.5i"
1, 1.5, "1+1.5i"
1.5, 1.5, "1.5+1.5i"
2, 1.5, "2+1.5i"
2.5, 1.5, "2.5+1.5i"
3, 1.5, "3+1.5i"
3.5, 1.5, "3.5+1.5i"
-2.5, 2, "-2.5+2i"
-2.5, 2, "-2.5+2i"
-1.5, 2, "-1.5+2i"
-1.5, 2, "-1.5+2i"
-0.5, 2, "-0.5+2i"
0, 2, "2i"
0.5, 2, "0.5+2i"
1, 2, "1+2i"
1.5, 2, "1.5+2i"
2, 2, "2+2i"
2.5, 2, "2.5+2i"
3, 2, "3+2i"
3.5, 2, "3.5+2i"
-2.5, 2.5, "-2.5+2.5i"
-2.5, 2.5, "-2.5+2.5i"
-1.5, 2.5, "-1.5+2.5i"
-1.5, 2.5, "-1.5+2.5i"
-0.5, 2.5, "-0.5+2.5i"
0, 2.5, "2.5i"
0.5, 2.5, "0.5+2.5i"
1, 2.5, "1+2.5i"
1.5, 2.5, "1.5+2.5i"
2, 2.5, "2+2.5i"
2.5, 2.5, "2.5+2.5i"
3, 2.5, "3+2.5i"
3.5, 2.5, "3.5+2.5i"
-2.5, 3, "-2.5+3i"
-2.5, 3, "-2.5+3i"
-1.5, 3, "-1.5+3i"
-1.5, 3, "-1.5+3i"
-0.5, 3, "-0.5+3i"
0, 3, "3i"
0.5, 3, "0.5+3i"
1, 3, "1+3i"
1.5, 3, "1.5+3i"
2, 3, "2+3i"
2.5, 3, "2.5+3i"
3, 3, "3+3i"
3.5, 3, "3.5+3i"
-2.5, 3.5, "-2.5+3.5i"
-2.5, 3.5, "-2.5+3.5i"
-1.5, 3.5, "-1.5+3.5i"
-1.5, 3.5, "-1.5+3.5i"
-0.5, 3.5, "-0.5+3.5i"
0, 3.5, "3.5i"
0.5, 3.5, "0.5+3.5i"
1, 3.5, "1+3.5i"
1.5, 3.5, "1.5+3.5i"
2, 3.5, "2+3.5i"
2.5, 3.5, "2.5+3.5i"
3, 3.5, "3+3.5i"
3.5, 3.5, "3.5+3.5i"
-2.5, -2.5, "i", "-2.5-2.5i"
-2.5, -2.5, "i", "-2.5-2.5i"
-1.5, -2.5, "i", "-1.5-2.5i"
-1.5, -2.5, "i", "-1.5-2.5i"
-0.5, -2.5, "i", "-0.5-2.5i"
0, -2.5, "i", "-2.5i"
0.5, -2.5, "i", "0.5-2.5i"
1, -2.5, "i", "1-2.5i"
1.5, -2.5, "i", "1.5-2.5i"
2, -2.5, "i", "2-2.5i"
2.5, -2.5, "i", "2.5-2.5i"
3, -2.5, "i", "3-2.5i"
3.5, -2.5, "i", "3.5-2.5i"
-2.5, -2.5, "i", "-2.5-2.5i"
-2.5, -2.5, "i", "-2.5-2.5i"
-1.5, -2.5, "i", "-1.5-2.5i"
-1.5, -2.5, "i", "-1.5-2.5i"
-0.5, -2.5, "i", "-0.5-2.5i"
0, -2.5, "i", "-2.5i"
0.5, -2.5, "i", "0.5-2.5i"
1, -2.5, "i", "1-2.5i"
1.5, -2.5, "i", "1.5-2.5i"
2, -2.5, "i", "2-2.5i"
2.5, -2.5, "i", "2.5-2.5i"
3, -2.5, "i", "3-2.5i"
3.5, -2.5, "i", "3.5-2.5i"
-2.5, -1.5, "i", "-2.5-1.5i"
-2.5, -1.5, "i", "-2.5-1.5i"
-1.5, -1.5, "i", "-1.5-1.5i"
-1.5, -1.5, "i", "-1.5-1.5i"
-0.5, -1.5, "i", "-0.5-1.5i"
0, -1.5, "i", "-1.5i"
0.5, -1.5, "i", "0.5-1.5i"
1, -1.5, "i", "1-1.5i"
1.5, -1.5, "i", "1.5-1.5i"
2, -1.5, "i", "2-1.5i"
2.5, -1.5, "i", "2.5-1.5i"
3, -1.5, "i", "3-1.5i"
3.5, -1.5, "i", "3.5-1.5i"
-2.5, -1.5, "i", "-2.5-1.5i"
-2.5, -1.5, "i", "-2.5-1.5i"
-1.5, -1.5, "i", "-1.5-1.5i"
-1.5, -1.5, "i", "-1.5-1.5i"
-0.5, -1.5, "i", "-0.5-1.5i"
0, -1.5, "i", "-1.5i"
0.5, -1.5, "i", "0.5-1.5i"
1, -1.5, "i", "1-1.5i"
1.5, -1.5, "i", "1.5-1.5i"
2, -1.5, "i", "2-1.5i"
2.5, -1.5, "i", "2.5-1.5i"
3, -1.5, "i", "3-1.5i"
3.5, -1.5, "i", "3.5-1.5i"
-2.5, -0.5, "i", "-2.5-0.5i"
-2.5, -0.5, "i", "-2.5-0.5i"
-1.5, -0.5, "i", "-1.5-0.5i"
-1.5, -0.5, "i", "-1.5-0.5i"
-0.5, -0.5, "i", "-0.5-0.5i"
0, -0.5, "i", "-0.5i"
0.5, -0.5, "i", "0.5-0.5i"
1, -0.5, "i", "1-0.5i"
1.5, -0.5, "i", "1.5-0.5i"
2, -0.5, "i", "2-0.5i"
2.5, -0.5, "i", "2.5-0.5i"
3, -0.5, "i", "3-0.5i"
3.5, -0.5, "i", "3.5-0.5i"
-2.5, 0, "i", -2.5
-2.5, 0, "i", -2.5
-1.5, 0, "i", -1.5
-1.5, 0, "i", -1.5
-0.5, 0, "i", -0.5
0, 0, "i", 0
0.5, 0, "i", 0.5
1, 0, "i", 1
1.5, 0, "i", 1.5
2, 0, "i", 2
2.5, 0, "i", 2.5
3, 0, "i", 3
3.5, 0, "i", 3.5
-2.5, 0.5, "i", "-2.5+0.5i"
-2.5, 0.5, "i", "-2.5+0.5i"
-1.5, 0.5, "i", "-1.5+0.5i"
-1.5, 0.5, "i", "-1.5+0.5i"
-0.5, 0.5, "i", "-0.5+0.5i"
0, 0.5, "i", "0.5i"
0.5, 0.5, "i", "0.5+0.5i"
1, 0.5, "i", "1+0.5i"
1.5, 0.5, "i", "1.5+0.5i"
2, 0.5, "i", "2+0.5i"
2.5, 0.5, "i", "2.5+0.5i"
3, 0.5, "i", "3+0.5i"
3.5, 0.5, "i", "3.5+0.5i"
-2.5, 1, "i", "-2.5+i"
-2.5, 1, "i", "-2.5+i"
-1.5, 1, "i", "-1.5+i"
-1.5, 1, "i", "-1.5+i"
-0.5, 1, "i", "-0.5+i"
0, 1, "i", "i"
0.5, 1, "i", "0.5+i"
1, 1, "i", "1+i"
1.5, 1, "i", "1.5+i"
2, 1, "i", "2+i"
2.5, 1, "i", "2.5+i"
3, 1, "i", "3+i"
3.5, 1, "i", "3.5+i"
-2.5, 1.5, "i", "-2.5+1.5i"
-2.5, 1.5, "i", "-2.5+1.5i"
-1.5, 1.5, "i", "-1.5+1.5i"
-1.5, 1.5, "i", "-1.5+1.5i"
-0.5, 1.5, "i", "-0.5+1.5i"
0, 1.5, "i", "1.5i"
0.5, 1.5, "i", "0.5+1.5i"
1, 1.5, "i", "1+1.5i"
1.5, 1.5, "i", "1.5+1.5i"
2, 1.5, "i", "2+1.5i"
2.5, 1.5, "i", "2.5+1.5i"
3, 1.5, "i", "3+1.5i"
3.5, 1.5, "i", "3.5+1.5i"
-2.5, 2, "i", "-2.5+2i"
-2.5, 2, "i", "-2.5+2i"
-1.5, 2, "i", "-1.5+2i"
-1.5, 2, "i", "-1.5+2i"
-0.5, 2, "i", "-0.5+2i"
0, 2, "i", "2i"
0.5, 2, "i", "0.5+2i"
1, 2, "i", "1+2i"
1.5, 2, "i", "1.5+2i"
2, 2, "i", "2+2i"
2.5, 2, "i", "2.5+2i"
3, 2, "i", "3+2i"
3.5, 2, "i", "3.5+2i"
-2.5, 2.5, "i", "-2.5+2.5i"
-2.5, 2.5, "i", "-2.5+2.5i"
-1.5, 2.5, "i", "-1.5+2.5i"
-1.5, 2.5, "i", "-1.5+2.5i"
-0.5, 2.5, "i", "-0.5+2.5i"
0, 2.5, "i", "2.5i"
0.5, 2.5, "i", "0.5+2.5i"
1, 2.5, "i", "1+2.5i"
1.5, 2.5, "i", "1.5+2.5i"
2, 2.5, "i", "2+2.5i"
2.5, 2.5, "i", "2.5+2.5i"
3, 2.5, "i", "3+2.5i"
3.5, 2.5, "i", "3.5+2.5i"
-2.5, 3, "i", "-2.5+3i"
-2.5, 3, "i", "-2.5+3i"
-1.5, 3, "i", "-1.5+3i"
-1.5, 3, "i", "-1.5+3i"
-0.5, 3, "i", "-0.5+3i"
0, 3, "i", "3i"
0.5, 3, "i", "0.5+3i"
1, 3, "i", "1+3i"
1.5, 3, "i", "1.5+3i"
2, 3, "i", "2+3i"
2.5, 3, "i", "2.5+3i"
3, 3, "i", "3+3i"
3.5, 3, "i", "3.5+3i"
-2.5, 3.5, "i", "-2.5+3.5i"
-2.5, 3.5, "i", "-2.5+3.5i"
-1.5, 3.5, "i", "-1.5+3.5i"
-1.5, 3.5, "i", "-1.5+3.5i"
-0.5, 3.5, "i", "-0.5+3.5i"
0, 3.5, "i", "3.5i"
0.5, 3.5, "i", "0.5+3.5i"
1, 3.5, "i", "1+3.5i"
1.5, 3.5, "i", "1.5+3.5i"
2, 3.5, "i", "2+3.5i"
2.5, 3.5, "i", "2.5+3.5i"
3, 3.5, "i", "3+3.5i"
3.5, 3.5, "i", "3.5+3.5i"
-2.5, -2.5, "j", "-2.5-2.5j"
-2.5, -2.5, "j", "-2.5-2.5j"
-1.5, -2.5, "j", "-1.5-2.5j"
-1.5, -2.5, "j", "-1.5-2.5j"
-0.5, -2.5, "j", "-0.5-2.5j"
0, -2.5, "j", "-2.5j"
0.5, -2.5, "j", "0.5-2.5j"
1, -2.5, "j", "1-2.5j"
1.5, -2.5, "j", "1.5-2.5j"
2, -2.5, "j", "2-2.5j"
2.5, -2.5, "j", "2.5-2.5j"
3, -2.5, "j", "3-2.5j"
3.5, -2.5, "j", "3.5-2.5j"
-2.5, -2.5, "j", "-2.5-2.5j"
-2.5, -2.5, "j", "-2.5-2.5j"
-1.5, -2.5, "j", "-1.5-2.5j"
-1.5, -2.5, "j", "-1.5-2.5j"
-0.5, -2.5, "j", "-0.5-2.5j"
0, -2.5, "j", "-2.5j"
0.5, -2.5, "j", "0.5-2.5j"
1, -2.5, "j", "1-2.5j"
1.5, -2.5, "j", "1.5-2.5j"
2, -2.5, "j", "2-2.5j"
2.5, -2.5, "j", "2.5-2.5j"
3, -2.5, "j", "3-2.5j"
3.5, -2.5, "j", "3.5-2.5j"
-2.5, -1.5, "j", "-2.5-1.5j"
-2.5, -1.5, "j", "-2.5-1.5j"
-1.5, -1.5, "j", "-1.5-1.5j"
-1.5, -1.5, "j", "-1.5-1.5j"
-0.5, -1.5, "j", "-0.5-1.5j"
0, -1.5, "j", "-1.5j"
0.5, -1.5, "j", "0.5-1.5j"
1, -1.5, "j", "1-1.5j"
1.5, -1.5, "j", "1.5-1.5j"
2, -1.5, "j", "2-1.5j"
2.5, -1.5, "j", "2.5-1.5j"
3, -1.5, "j", "3-1.5j"
3.5, -1.5, "j", "3.5-1.5j"
-2.5, -1.5, "j", "-2.5-1.5j"
-2.5, -1.5, "j", "-2.5-1.5j"
-1.5, -1.5, "j", "-1.5-1.5j"
-1.5, -1.5, "j", "-1.5-1.5j"
-0.5, -1.5, "j", "-0.5-1.5j"
0, -1.5, "j", "-1.5j"
0.5, -1.5, "j", "0.5-1.5j"
1, -1.5, "j", "1-1.5j"
1.5, -1.5, "j", "1.5-1.5j"
2, -1.5, "j", "2-1.5j"
2.5, -1.5, "j", "2.5-1.5j"
3, -1.5, "j", "3-1.5j"
3.5, -1.5, "j", "3.5-1.5j"
-2.5, -0.5, "j", "-2.5-0.5j"
-2.5, -0.5, "j", "-2.5-0.5j"
-1.5, -0.5, "j", "-1.5-0.5j"
-1.5, -0.5, "j", "-1.5-0.5j"
-0.5, -0.5, "j", "-0.5-0.5j"
0, -0.5, "j", "-0.5j"
0.5, -0.5, "j", "0.5-0.5j"
1, -0.5, "j", "1-0.5j"
1.5, -0.5, "j", "1.5-0.5j"
2, -0.5, "j", "2-0.5j"
2.5, -0.5, "j", "2.5-0.5j"
3, -0.5, "j", "3-0.5j"
3.5, -0.5, "j", "3.5-0.5j"
-2.5, 0, "j", -2.5
-2.5, 0, "j", -2.5
-1.5, 0, "j", -1.5
-1.5, 0, "j", -1.5
-0.5, 0, "j", -0.5
0, 0, "j", 0
0.5, 0, "j", 0.5
1, 0, "j", 1
1.5, 0, "j", 1.5
2, 0, "j", 2
2.5, 0, "j", 2.5
3, 0, "j", 3
3.5, 0, "j", 3.5
-2.5, 0.5, "j", "-2.5+0.5j"
-2.5, 0.5, "j", "-2.5+0.5j"
-1.5, 0.5, "j", "-1.5+0.5j"
-1.5, 0.5, "j", "-1.5+0.5j"
-0.5, 0.5, "j", "-0.5+0.5j"
0, 0.5, "j", "0.5j"
0.5, 0.5, "j", "0.5+0.5j"
1, 0.5, "j", "1+0.5j"
1.5, 0.5, "j", "1.5+0.5j"
2, 0.5, "j", "2+0.5j"
2.5, 0.5, "j", "2.5+0.5j"
3, 0.5, "j", "3+0.5j"
3.5, 0.5, "j", "3.5+0.5j"
-2.5, 1, "j", "-2.5+j"
-2.5, 1, "j", "-2.5+j"
-1.5, 1, "j", "-1.5+j"
-1.5, 1, "j", "-1.5+j"
-0.5, 1, "j", "-0.5+j"
0, 1, "j", "j"
0.5, 1, "j", "0.5+j"
1, 1, "j", "1+j"
1.5, 1, "j", "1.5+j"
2, 1, "j", "2+j"
2.5, 1, "j", "2.5+j"
3, 1, "j", "3+j"
3.5, 1, "j", "3.5+j"
-2.5, 1.5, "j", "-2.5+1.5j"
-2.5, 1.5, "j", "-2.5+1.5j"
-1.5, 1.5, "j", "-1.5+1.5j"
-1.5, 1.5, "j", "-1.5+1.5j"
-0.5, 1.5, "j", "-0.5+1.5j"
0, 1.5, "j", "1.5j"
0.5, 1.5, "j", "0.5+1.5j"
1, 1.5, "j", "1+1.5j"
1.5, 1.5, "j", "1.5+1.5j"
2, 1.5, "j", "2+1.5j"
2.5, 1.5, "j", "2.5+1.5j"
3, 1.5, "j", "3+1.5j"
3.5, 1.5, "j", "3.5+1.5j"
-2.5, 2, "j", "-2.5+2j"
-2.5, 2, "j", "-2.5+2j"
-1.5, 2, "j", "-1.5+2j"
-1.5, 2, "j", "-1.5+2j"
-0.5, 2, "j", "-0.5+2j"
0, 2, "j", "2j"
0.5, 2, "j", "0.5+2j"
1, 2, "j", "1+2j"
1.5, 2, "j", "1.5+2j"
2, 2, "j", "2+2j"
2.5, 2, "j", "2.5+2j"
3, 2, "j", "3+2j"
3.5, 2, "j", "3.5+2j"
-2.5, 2.5, "j", "-2.5+2.5j"
-2.5, 2.5, "j", "-2.5+2.5j"
-1.5, 2.5, "j", "-1.5+2.5j"
-1.5, 2.5, "j", "-1.5+2.5j"
-0.5, 2.5, "j", "-0.5+2.5j"
0, 2.5, "j", "2.5j"
0.5, 2.5, "j", "0.5+2.5j"
1, 2.5, "j", "1+2.5j"
1.5, 2.5, "j", "1.5+2.5j"
2, 2.5, "j", "2+2.5j"
2.5, 2.5, "j", "2.5+2.5j"
3, 2.5, "j", "3+2.5j"
3.5, 2.5, "j", "3.5+2.5j"
-2.5, 3, "j", "-2.5+3j"
-2.5, 3, "j", "-2.5+3j"
-1.5, 3, "j", "-1.5+3j"
-1.5, 3, "j", "-1.5+3j"
-0.5, 3, "j", "-0.5+3j"
0, 3, "j", "3j"
0.5, 3, "j", "0.5+3j"
1, 3, "j", "1+3j"
1.5, 3, "j", "1.5+3j"
2, 3, "j", "2+3j"
2.5, 3, "j", "2.5+3j"
3, 3, "j", "3+3j"
3.5, 3, "j", "3.5+3j"
-2.5, 3.5, "j", "-2.5+3.5j"
-2.5, 3.5, "j", "-2.5+3.5j"
-1.5, 3.5, "j", "-1.5+3.5j"
-1.5, 3.5, "j", "-1.5+3.5j"
-0.5, 3.5, "j", "-0.5+3.5j"
0, 3.5, "j", "3.5j"
0.5, 3.5, "j", "0.5+3.5j"
1, 3.5, "j", "1+3.5j"
1.5, 3.5, "j", "1.5+3.5j"
2, 3.5, "j", "2+3.5j"
2.5, 3.5, "j", "2.5+3.5j"
3, 3.5, "j", "3+3.5j"
3.5, 3.5, "j", "3.5+3.5j"
-1.23, -4.56, "-1.23-4.56i"
0, -3.21, "i", "-3.21i"
1.23, -2.34, "j", "1.23-2.34j"
-1.23, 0, -1.23
0, 0, "i", 0
1.23, 0, "j", 1.23
-1.23, 4.56, "-1.23+4.56i"
0, 3.21, "i", "3.21i"
1.23, 2.34, "j", "1.23+2.34j"

View File

@@ -0,0 +1,24 @@
1.0, "lbm", "kg", 0.45359230974881
123.45, "kg", "kg", 123.45
68, "F", "C", 20
20, "C", "F", 68
68, "F", "K", 293.15
293.15, "K", "F", 68
22, "C", "K", 295.15
295.65, "K", "C", 22.5
2.5, "ft", "sec", "#N/A"
12345, "m", "km", 12.345
12.345, "km", "m", 12345
1, "km", "mi", 0.62137119223733
"three","ft", "yds", "#VALUE!"
123.45, "K", "kel", 123.45
123.45, "C", "cel", 123.45
123.45, "F", "fah", 123.45
1, "ft", "day", "#N/A"
123.45, "m", "m", 123.45
234.56, "km", "km", 234.56
234.56, "kpt", "lt", "#N/A"
234.56, "sm", "m", "#N/A"
234.56, "lt", "kpt", "#N/A"
234.56, "m", "sm", "#N/A"
12.345, "km", "mm", 12345000

View File

@@ -0,0 +1,16 @@
357, "101100101"
1357, "#NUM!" // Too large
9, 4, "1001"
9, 8, "00001001"
9, 6.75, "001001" // Leading places as a float
9, -1, "#NUM!" // Leading places negative
9, "ABC", "#VALUE!" // Leading places non-numeric
246, "11110110"
12345, "#NUM!"
123456789, "#NUM!"
123.45, "1111011"
0, "0"
"3579A", "#VALUE!" // Invalid decimal
TRUE, "#VALUE!" // Non string
-100, "1110011100" // 2's Complement
-107, "1110010101" // 2's Complement

View File

@@ -0,0 +1,15 @@
"357", "165"
"1357", "54D"
"246", "F6"
"12345", "3039"
"123456789", "75BCD15"
"100", 4, "0064"
"100", 5.75, "00064" // Leading places as a float
"100", -1, "#NUM!" // Leading places negative
"100", "ABC", "#VALUE!" // Leading places non-numeric
"123.45", "7B"
"0", "0"
"3579A", "#VALUE!" // Invalid decimal
TRUE, "#VALUE!" // Non string
"-54", "FFFFFFFFCA" // 2's Complement
"-107", "FFFFFFFF95" // 2's Complement

View File

@@ -0,0 +1,12 @@
"357", "545"
"1357", "2515"
"246", "366"
"12345", "30071"
"123456789", "726746425"
"123.45", "173"
"58, 3, "072"
"0", "0"
"3579A", "#VALUE!" // Invalid decimal
TRUE, "#VALUE!" // Non string
"-100", "7777777634" // 2's Complement
"-107", "7777777625" // 2's Complement

View File

@@ -0,0 +1,25 @@
-1.5, -1.5, 1
-0.75, -1.5, 0
0, -1.5, 0
0.75, -1.5, 0
1.5, -1.5, 0
-1.5, -0.75, 0
-0.75, -0.75, 1
0, -0.75, 0
0.75, -0.75, 0
1.5, -0.75, 0
-1.5, 0, 0
-0.75, 0, 0
0, 0, 1
0.75, 0, 0
1.5, 0, 0
-1.5, 0.75, 0
-0.75, 0.75, 0
0, 0.75, 0
0.75, 0.75, 1
1.5, 0.75, 0
-1.5, 1.5, 0
-0.75, 1.5, 0
0, 1.5, 0
0.75, 1.5, 0
1.5, 1.5, 1

View File

@@ -0,0 +1,124 @@
# lower bound upper bound Result
0, 0.0
0.01, 0.0112834155558496
0.05, 0.0563719777970166
0.1, 0.1124629160182850
0.125, 0.1403162048013340
0.15, 0.1679959714273630
0.2, 0.2227025892104780
0.25, 0.2763263901682370
0.3, 0.3286267594591270
0.35, 0.3793820535623100
0.4, 0.4283923550466680
0.45, 0.4754817197869240
0.5, 0.5204998778130470
0.6, 0.6038560908479260
0.7, 0.6778011938374180
0.8, 0.7421009647076610
0.9, 0.7969082124228320
1, 0.8427007929497150
1.1, 0.8802050695740820
1.2, 0.9103139782296350
1.3, 0.9340079449406520
1.4, 0.9522851197626490
1.5, 0.9661051464753110
1.75, 0.9866716712191820
2, 0.9953222650189530
2.5, 0.9995930479825550
3, 0.9999779095030010
3.5, 0.9999992569016280
4, 0.9999999845827420
4.5, 0.9999999998033840
5, 0.9999999999984630
5.5, 0.9999999999999930
6, 1.0
32, 1.0
-0.1, -0.1124629160182850
-1, -0.8427007929497150
TRUE, "#VALUE!"
FALSE, "#VALUE!"
"2", 0.9953222650189530
"TWO", "#VALUE!"
-1.5, -1.5, 0.0
-0.75, -1.5, -0.2549495128217960
0, -1.5, -0.9661051464753110
0.75, -1.5, -1.6772607801288300
1.5, -1.5, -1.9322102929506200
2.25, -1.5, -1.9646424298886300
3, -1.5, -1.9660830559783100
3.75, -1.5, -1.9661050327480500
4.5, -1.5, -1.9661051462786900
-1.5, -0.75, 0.2549495128217960
-0.75, -0.75, 0.0
0, -0.75, -0.7111556336535150
0.75, -0.75, -1.4223112673070300
1.5, -0.75, -1.6772607801288300
2.25, -0.75, -1.7096929170668300
3, -0.75, -1.7111335431565200
3.75, -0.75, -1.7111555199262600
4.5, -0.75, -1.7111556334569000
-1.5, 0, 0.9661051464753110
-0.75, 0, 0.7111556336535150
0, 0, 0.0
0.75, 0, -0.7111556336535150
1.5, 0, -0.9661051464753110
2.25, 0, -0.9985372834133190
3, 0, -0.9999779095030010
3.75, 0, -0.9999998862727430
4.5, 0, -0.9999999998033840
-1.5, 0.75, 1.6772607801288300
-0.75, 0.75, 1.4223112673070300
0, 0.75, 0.7111556336535150
0.75, 0.75, 0.0
1.5, 0.75, -0.2549495128217960
2.25, 0.75, -0.2873816497598040
3, 0.75, -0.2888222758494860
3.75, 0.75, -0.2888442526192280
4.5, 0.75, -0.2888443661498690
-1.5, 1.5, 1.9322102929506200
-0.75, 1.5, 1.6772607801288300
0, 1.5, 0.9661051464753110
0.75, 1.5, 0.2549495128217960
1.5, 1.5, 0.0
2.25, 1.5, -0.0324321369380081
3, 1.5, -0.0338727630276906
3.75, 1.5, -0.0338947397974326
4.5, 1.5, -0.0338948533280732
-1.5, 2.25, 1.9646424298886300
-0.75, 2.25, 1.7096929170668300
0, 2.25, 0.9985372834133190
0.75, 2.25, 0.2873816497598040
1.5, 2.25, 0.0324321369380081
2.25, 2.25, 0.0
3, 2.25, -0.0014406260896825
3.75, 2.25, -0.0014626028594246
4.5, 2.25, -0.0014627163900651
-1.5, 3, 1.9660830559783100
-0.75, 3, 1.7111335431565200
0, 3, 0.9999779095030010
0.75, 3, 0.2888222758494860
1.5, 3, 0.0338727630276906
2.25, 3, 0.0014406260896825
3, 3, 0.0
3.75, 3, -0.0000219767697420
4.5, 3, -0.0000220903003826
-1.5, 3.75, 1.9661050327480500
-0.75, 3.75, 1.7111555199262600
0, 3.75, 0.9999998862727430
0.75, 3.75, 0.2888442526192280
1.5, 3.75, 0.0338947397974326
2.25, 3.75, 0.0014626028594246
3, 3.75, 0.0000219767697420
3.75, 3.75, 0.0
4.5, 3.75, -0.0000001135306406
-1.5, 4.5, 1.9661051462786900
-0.75, 4.5, 1.7111556334569000
0, 4.5, 0.9999999998033840
0.75, 4.5, 0.2888443661498690
1.5, 4.5, 0.0338948533280732
2.25, 4.5, 0.0014627163900651
3, 4.5, 0.0000220903003826
3.75, 4.5, 0.0000001135306406
4.5, 4.5, 0.0
5, -1, -1.8427007929481800
-5, 1, 1.8427007929481800

View File

@@ -0,0 +1,41 @@
# x value Result
0, 1.0
0.01, 0.9887165844441500
0.05, 0.9436280222029830
0.1, 0.8875370839817150
0.125, 0.8596837951986660
0.15, 0.8320040285726360
0.2, 0.7772974107895220
0.25, 0.7236736098317630
0.3, 0.6713732405408730
0.35, 0.6206179464376900
0.4, 0.5716076449533320
0.45, 0.5245182802130760
0.5, 0.4795001221869530
0.6, 0.3961439091520740
0.7, 0.3221988061625820
0.8, 0.2578990352923390
0.9, 0.2030917875771680
1, 0.1572992070502850
1.1, 0.1197949304259180
1.2, 0.0896860217703646
1.3, 0.0659920550593475
1.4, 0.0477148802373512
1.5, 0.0338948535246893
1.75, 0.0133283287808176
2, 0.0046777349810473
2.5, 0.0004069520174450
3, 0.0000220904969986
3.5, 0.0000007430983723
4, 0.0000000154172579
4.5, 0.0000000001966160
5, 0.0000000000015375
5.5, 0.0000000000000074
6, 0.0
32, 0.0
-0.1, 1.1124629160182900
-1, 1.8427007929497100
TRUE, "#VALUE!"
FALSE, "#VALUE!"
"2", 0.0046777349810473
"TWO", "#VALUE!"

View File

@@ -0,0 +1,81 @@
-1.5, -1.5, 1
-0.75, -1.5, 1
0, -1.5, 1
0.75, -1.5, 1
1.5, -1.5, 1
2.25, -1.5, 1
3, -1.5, 1
3.75, -1.5, 1
4.5, -1.5, 1
-1.5, -0.75, 0
-0.75, -0.75, 1
0, -0.75, 1
0.75, -0.75, 1
1.5, -0.75, 1
2.25, -0.75, 1
3, -0.75, 1
3.75, -0.75, 1
4.5, -0.75, 1
-1.5, 0, 0
-0.75, 0, 0
0, 0, 1
0.75, 0, 1
1.5, 0, 1
2.25, 0, 1
3, 0, 1
3.75, 0, 1
4.5, 0, 1
-1.5, 0.75, 0
-0.75, 0.75, 0
0, 0.75, 0
0.75, 0.75, 1
1.5, 0.75, 1
2.25, 0.75, 1
3, 0.75, 1
3.75, 0.75, 1
4.5, 0.75, 1
-1.5, 1.5, 0
-0.75, 1.5, 0
0, 1.5, 0
0.75, 1.5, 0
1.5, 1.5, 1
2.25, 1.5, 1
3, 1.5, 1
3.75, 1.5, 1
4.5, 1.5, 1
-1.5, 2.25, 0
-0.75, 2.25, 0
0, 2.25, 0
0.75, 2.25, 0
1.5, 2.25, 0
2.25, 2.25, 1
3, 2.25, 1
3.75, 2.25, 1
4.5, 2.25, 1
-1.5, 3, 0
-0.75, 3, 0
0, 3, 0
0.75, 3, 0
1.5, 3, 0
2.25, 3, 0
3, 3, 1
3.75, 3, 1
4.5, 3, 1
-1.5, 3.75, 0
-0.75, 3.75, 0
0, 3.75, 0
0.75, 3.75, 0
1.5, 3.75, 0
2.25, 3.75, 0
3, 3.75, 0
3.75, 3.75, 1
4.5, 3.75, 1
-1.5, 4.5, 0
-0.75, 4.5, 0
0, 4.5, 0
0.75, 4.5, 0
1.5, 4.5, 0
2.25, 4.5, 0
3, 4.5, 0
3.75, 4.5, 0
4.5, 4.5, 1

View File

@@ -0,0 +1,13 @@
"01AB", "110101011"
"ABCD", "#NUM!"
"F6", "11110110"
"F", 8, "00001111"
"B7", "10110111"
"12345", "#NUM!"
"123456789", "#NUM!"
"123.45", "#NUM!"
"0", "0"
"G3579A", "#NUM!"
TRUE, "#VALUE!"
"-107", "#NUM!"
"FFFFFFFFFF", "1111111111" // 2's Complement

View File

@@ -0,0 +1,13 @@
"01AB", "427"
"ABCD", "43981"
"F6", "246"
"12345", "74565"
"123456789", "4886718345"
"123.45", "#NUM!"
"0", "0"
"G3579A", "#NUM!"
TRUE, "#VALUE!"
"-107", "#NUM!"
"A5", "165"
"FFFFFFFF5B", "-165"
"3DA408B9", "1034160313" // 2's Complement

View File

@@ -0,0 +1,13 @@
"01AB", "653"
"ABCD", "125715"
"F6", "366"
"3B4E", "35516"
"F", 3, "017"
"12345", "221505"
"123456789", "#NUM!"
"123.45", "#NUM!"
"0", "0"
"G3579A", "#NUM!"
TRUE, "#VALUE!"
"-107", "#NUM!"
"FFFFFFFF00", "7777777400" // 2's Complement

View File

@@ -0,0 +1,27 @@
"12.34+5.67j", 13.580298229420
"1.234E-5+6.78E9i", 6.78E9
"3.5+2.5i", 4.301162633521
"3.5+i", 3.640054944640
"3.5", 3.5
"3.5-i", 3.640054944640
"3.5-2.5i", 4.301162633521
"1+2.5i", 2.692582403567
"1+i", 1.414213562373
"1", 1
"1-i", 1.414213562373
"1-2.5i", 2.692582403567
"2.5i", 2.5
"i", 1
"0", 0
"-i", 1
"-2.5i", 2.5
"-1+2.5i", 2.692582403567
"-1+i", 1.414213562373
"-1", 1
"-1-i", 1.414213562373
"-1-2.5i", 2.692582403567
"-3.5+2.5i", 4.301162633521
"-3.5+i", 3.640054944640
"-3.5", 3.5
"-3.5-i", 3.640054944640
"-3.5-2.5i", 4.301162633521

View File

@@ -0,0 +1,30 @@
"12.34+5.67j", 5.67
"1.234E-5+6.78E9i", 6.78E9
"3.5+2.5i", 2.5
"3.5+i", 1
"3.5", 0
"3.5-i", -1
"3.5-2.5i", -2.5
"1+2.5i", 2.5
"1+i", 1
"1", 0
1, 0
"1-i", -1
"1-2.5i", -2.5
"2.5i", 2.5
"i", 1
"0", 0
0, 0
0.0, 0
"-i", -1
"-2.5i", -2.5
"-1+2.5i", 2.5
"-1+i", 1
"-1", 0
"-1-i", -1
"-1-2.5i", -2.5
"-3.5+2.5i", 2.5
"-3.5+i", 1
"-3.5", 0
"-3.5-i", -1
"-3.5-2.5i", -2.5

View File

@@ -0,0 +1,26 @@
"12.34+5.67j", 0.430710595550
"3.5+2.5i", 0.620249485983
"3.5+i", 0.278299659005
"3.5", 0
"3.5-i", -0.278299659005
"3.5-2.5i", -0.620249485983
"1+2.5i", 1.190289949683
"1+i", 0.785398163397
"1", 0
"1-i", -0.785398163397
"1-2.5i", -1.190289949683
"2.5i", 1.570796326795
"i", 1.570796326795
"0", "#DIV/0!"
"-i", -1.570796326795
"-2.5i", -1.570796326795
"-1+2.5i", 1.951302703907
"-1+i", 2.356194490192
"-1", 3.141592653590
"-1-i", -2.356194490192
"-1-2.5i", -1.951302703907
"-3.5+2.5i", 2.521343167607
"-3.5+i", 2.863292994585
"-3.5", 3.141592653590
"-3.5-i", -2.863292994585
"-3.5-2.5i", -2.521343167607

View File

@@ -0,0 +1,26 @@
"12.34+5.67j", "12.34-5.67j"
"3.5+2.5i", "3.5-2.5i"
"3.5+i", "3.5-i"
"3.5", "3.5"
"3.5-i", "3.5+i"
"3.5-2.5i", "3.5+2.5i"
"1+2.5i", "1-2.5i"
"1+i", "1-i"
"1", "1"
"1-i", "1+i"
"1-2.5i", "1+2.5i"
"2.5i", "-2.5i"
"i", "-i"
"0", "0"
"-i", "i"
"-2.5i", "2.5i"
"-1+2.5i", "-1-2.5i"
"-1+i", "-1-i"
"-1", "-1"
"-1-i", "-1+i"
"-1-2.5i", "-1+2.5i"
"-3.5+2.5i", "-3.5-2.5i"
"-3.5+i", "-3.5-i"
"-3.5", "-3.5"
"-3.5-i", "-3.5+i"
"-3.5-2.5i", "-3.5+2.5i"

View File

@@ -0,0 +1,27 @@
"12.34+5.67j", "141.319179436356+32.547610312508j"
"3.5+2.5i", "-5.74262349163406+2.12231025604134i"
"3.5+i", "-1.44502817950166+0.412240867891067i"
"3.5", "-0.936456687290796"
"3.5-i", "-1.44502817950166-0.412240867891067i"
"3.5-2.5i", "-5.74262349163406-2.12231025604134i"
"1+2.5i", "3.31329014611322-5.0910715229497i"
"1+i", "0.833730025131149-0.988897705762865i"
"1", "0.54030230586814"
"1-i", "0.833730025131149+0.988897705762865i"
"1-2.5i", "3.31329014611322+5.0910715229497i"
"2.5i", "6.13228947966369"
"i", "1.54308063481524"
"0", "1"
"-i", "1.54308063481524"
"-2.5i", "6.13228947966369"
"-1+2.5i", "3.31329014611322+5.0910715229497i"
"-1+i", "0.833730025131149+0.988897705762865i"
"-1", "0.54030230586814"
"-1-i", "0.833730025131149-0.988897705762865i"
"-1-2.5i", "3.31329014611322-5.0910715229497i"
"-3.5+2.5i", "-5.74262349163406-2.12231025604134i"
"-3.5+i", "-1.44502817950166-0.412240867891067i"
"-3.5", "-0.936456687290796"
"-3.5-i", "-1.44502817950166+0.412240867891067i"
"-3.5-2.5i", "-5.74262349163406+2.12231025604134i"
"3", "-0.989992496600445"

View File

@@ -0,0 +1,20 @@
"12.34+5.67j", "123.45+67.89i", "#NUM!"
"12.34+5.67j", "123.45+67.89j", "0.0961415519586104-0.00694248653276682j"
"-12.34+5.67i", "-123.45+67.89i", "0.0961415519586104+0.00694248653276682i"
"-12.34-5.67i", "-123.45+67.89i", "0.0573549954111941+0.0774712890924744i"
"-12.34+5.67i", "-123.45-67.89i", "0.0573549954111941-0.0774712890924744i"
"-12.34-5.67i", "-123.45-67.89i", "0.0961415519586104-0.00694248653276682i"
"12.34+5.67i", "-123.45+67.89i", "-0.0573549954111941-0.0774712890924744i"
"12.34-5.67i", "-123.45+67.89i", "-0.0961415519586104-0.00694248653276682i"
"12.34+5.67i", "-123.45-67.89i", "-0.0961415519586104+0.00694248653276682i"
"12.34-5.67i", "-123.45-67.89i", "-0.0573549954111941+0.0774712890924744i"
"-12.34+5.67i", "123.45+67.89i", "-0.0573549954111941+0.0774712890924744i"
"-12.34-5.67i", "123.45+67.89i", "-0.0961415519586104+0.00694248653276682i"
"-12.34+5.67i", "123.45-67.89i", "-0.0961415519586104-0.00694248653276682i"
"-12.34-5.67i", "123.45-67.89i", "-0.0573549954111941-0.0774712890924744i"
"-12.34-5.67i", "123.45-67.89", "#NUM!"
"-12.34-5.67j", "123.45-67.89", "#NUM!"
"-12.34-5.67", "123.45-67.89j", "#NUM!"
"-12.34-5.67i", "-12.34-5.67i", "1"
"-12.34", "123.45-67.89i", "-0.0767482736849023-0.0422068878126206i"
"-12.34-5.67i", "-12.34", "1+0.459481361426256i"

View File

@@ -0,0 +1,27 @@
"12.34+5.67j", "187004.11273906-131589.323796073j"
"-12.34E-5+6.78E9i", "1.79747131321615E+308+1.79747131321615E+308i"
"3.5+2.5i", "-26.5302329126575+19.8186755366902i"
"3.5+i", "17.8923550531471+27.8656919720394i"
"3.5", "33.1154519586923"
"3.5-i", "17.8923550531471-27.8656919720394i"
"3.5-2.5i", "-26.5302329126575-19.8186755366902i"
"1+2.5i", "-2.17773413212721+1.62681595415671i"
"1+i", "1.46869393991589+2.28735528717884i"
"1", "2.71828182845905"
"1-i", "1.46869393991589-2.28735528717884i"
"1-2.5i", "-2.17773413212721-1.62681595415671i"
"2.5i", "-0.801143615546934+0.598472144103957i"
"i", "0.54030230586814+0.841470984807897i"
"0", "1"
"-i", "0.54030230586814-0.841470984807897i"
"-2.5i", "-0.801143615546934-0.598472144103957i"
"-1+2.5i", "-0.294724265585475+0.220165597929638i"
"-1+i", "0.198766110346413+0.309559875653112i"
"-1", "0.367879441171442"
"-1-i", "0.198766110346413-0.309559875653112i"
"-1-2.5i", "-0.294724265585475-0.220165597929638i"
"-3.5+2.5i", "-0.0241924409350133+0.0180722928030842i"
"-3.5+i", "0.016315715894263+0.025410221967i"
"-3.5", "0.0301973834223185"
"-3.5-i", "0.016315715894263-0.025410221967i"
"-3.5-2.5i", "-0.0241924409350133-0.0180722928030842i"

View File

@@ -0,0 +1,27 @@
"12.34+5.67j", "2.60862008281875+0.430710595550204j"
"-1.234E-5+6.78E9i", "22.6372429388987+1.5707963267949i"
"3.5+2.5i", "1.45888536604214+0.620249485982821i"
"3.5+i", "1.29199877621612+0.278299659005111i"
"3.5", "1.25276296849537"
"3.5-i", "1.29199877621612-0.278299659005111i"
"3.5-2.5i", "1.45888536604214-0.620249485982821i"
"1+2.5i", "0.990500734433292+1.19028994968253i"
"1+i", "0.346573590279973+0.785398163397448i"
"1", "0"
"1-i", "0.346573590279973-0.785398163397448i"
"1-2.5i", "0.990500734433292-1.19028994968253i"
"2.5i", "0.916290731874155+1.5707963267949i"
"i", "1.5707963267949i"
"0", "#NUM!"
"-i", "-1.5707963267949i"
"-2.5i", "0.916290731874155-1.5707963267949i"
"-1+2.5i", "0.990500734433292+1.95130270390726i"
"-1+i", "0.346573590279973+2.35619449019234i"
"-1", "3.14159265358979i"
"-1-i", "0.346573590279973-2.35619449019234i"
"-1-2.5i", "0.990500734433292-1.95130270390726i"
"-3.5+2.5i", "1.45888536604214+2.52134316760697i"
"-3.5+i", "1.29199877621612+2.86329299458468i"
"-3.5", "1.25276296849537+3.14159265358979i"
"-3.5-i", "1.29199877621612-2.86329299458468i"
"-3.5-2.5i", "1.45888536604214-2.52134316760697i"

View File

@@ -0,0 +1,27 @@
"12.34+5.67j", "1.13290930735019+0.187055234944717j"
"-12.34E-5+6.78E9i", "9.83122969386706+0.682188176920927i"
"3.5+2.5i", "0.633585864201507+0.269370929165668i"
"3.5+i", "0.561107939136413+0.120864006221476i"
"3.5", "0.544068044350276"
"3.5-i", "0.561107939136413-0.120864006221476i"
"3.5-2.5i", "0.633585864201507-0.269370929165668i"
"1+2.5i", "0.430169003285497+0.516936357012023i"
"1+i", "0.150514997831991+0.34109408846046i"
"1", "0"
"1-i", "0.150514997831991-0.34109408846046i"
"1-2.5i", "0.430169003285497-0.516936357012023i"
"2.5i", "0.397940008672038+0.68218817692092i"
"i", "0.68218817692092i"
"0", "#NUM!"
"-i", "-0.68218817692092i"
"-2.5i", "0.397940008672038-0.68218817692092i"
"-1+2.5i", "0.430169003285497+0.847439996829817i"
"-1+i", "0.150514997831991+1.02328226538138i"
"-1", "1.36437635384184i"
"-1-i", "0.150514997831991-1.02328226538138i"
"-1-2.5i", "0.430169003285497-0.847439996829817i"
"-3.5+2.5i", "0.633585864201507+1.09500542467617i"
"-3.5+i", "0.561107939136413+1.24351234762036i"
"-3.5", "0.544068044350276+1.36437635384184i"
"-3.5-i", "0.561107939136413-1.24351234762036i"
"-3.5-2.5i", "0.633585864201507-1.09500542467617i"

View File

@@ -0,0 +1,27 @@
"12.34+5.67j", "3.76344325733562+0.621384040306436j"
"-12.34E-5+6.78E9i", "32.6586381298614+2.26618007108803i"
"3.5+2.5i", "2.10472668297646+0.894830857610216i"
"3.5+i", "1.86396022742506+0.401501537958665i"
"3.5", "1.80735492219671"
"3.5-i", "1.86396022742506-0.401501537958665i"
"3.5-2.5i", "2.10472668297646-0.894830857610216i"
"1+2.5i", "1.42899049767377+1.71722540775913i"
"1+i", "0.500000000038482+1.13309003554401i"
"1", "0"
"1-i", "0.500000000038482-1.13309003554401i"
"1-2.5i", "1.42899049767377-1.71722540775913i"
"2.5i", "1.3219280949891+2.26618007108801i"
"i", "2.26618007108801i"
"0", "#NUM!"
"-i", "-2.26618007108801i"
"-2.5i", "1.3219280949891-2.26618007108801i"
"-1+2.5i", "1.42899049767377+2.81513473441689i"
"-1+i", "0.500000000038482+3.39927010663201i"
"-1", "4.53236014217602i"
"-1-i", "0.500000000038482-3.39927010663201i"
"-1-2.5i", "1.42899049767377-2.81513473441689i"
"-3.5+2.5i", "2.10472668297646+3.63752928456581i"
"-3.5+i", "1.86396022742506+4.13085860421736i"
"-3.5", "1.80735492219671+4.53236014217602i"
"-3.5-i", "1.86396022742506-4.13085860421736i"
"-3.5-2.5i", "2.10472668297646-3.63752928456581i"

View File

@@ -0,0 +1,18 @@
"12.34+5.67j", 2, "120.1267+139.9356j"
"12.34+5.67j", 3, "688.928626+2407.923693j"
"12.34+5.67j", -1, "6.69108496973016E-002-3.07442883131037E-002j"
"12.34+5.67j", -2, "3.53185054333564E-003-4.11425290873718E-003j"
"12.34+5.67j", 0.5, "3.60002071031685+0.787495469644252j"
"12.34+5.67j", -0.25, "0.517904976730581-5.59833234375533E-002j"
"12.34+5.67j", 0, "1"
"-i", 2, "-1-1.34451369308841E-014i"
"1-i", 2, "1.22460635382238E-016-2i"
"2.5i", 2, "-6.25+8.40321058180257E-014i"
"2.5i", "2.5", "-6.98771242968685-6.98771242968684i"
"2.5i", "2.5i", "#VALUE!"
"2.5", "2.5", 9.88211768802619
"2", "2", 4
"-12.34-5.67i", "-12.34", "-4.69972844488573E-15+9.35464904349343E-15i"
"12.34-5.67i", "-12.34", "5.93343000067521E-15-8.62503997728057E-15i"
"-12.34-5.67i", "12.34", "-42881944468901.9-85355046682682.3i"
"12.34-5.67i", "12.34", "54138663282971.3+78697841733874.3i"

View File

@@ -0,0 +1,15 @@
"12.34+5.67j", "123.45+67.89i", "#NUM!"
"12.34+5.67j", "12.34+5.67j"
"12.34+5.67i", "123.45+67.89i", "5.67", "6454.936089+8718.895647i"
"12.34+5.67j", "123.45+67.89j", "5.67", "6454.936089+8718.895647j"
"12.34+5.67j", "123.45+67.89j", "1138.4367+1537.7241j"
"12.34-5.67i", "123.45+67.89i", "1908.3093+137.8011i"
"12.34+5.67i", "123.45-67.89i", "1908.3093-137.8011i"
"12.34-5.67i", "123.45-67.89i", "1138.4367-1537.7241i"
"-12.34+5.67i", "123.45+67.89i", "-1908.3093-137.8011i"
"-12.34-5.67i", "123.45+67.89i", "-1138.4367-1537.7241i"
"12.34+5.67i", "-123.45+67.89i", "-1908.3093+137.8011i"
"-12.34+5.67i", "-123.45+67.89i", "1138.4367-1537.7241i"
"-12.34-5.67i", "-123.45-67.89i", "1138.4367+1537.7241i"
"-12.34", "123.45-67.89i", "-1523.373+837.7626i"
"-12.34-5.67i", "-12.34", "152.2756+69.9678i"

View File

@@ -0,0 +1,30 @@
12.34+5.67j", 12.34
"-1.234E-5+6.78E9i", -1.234E-5
"3.5+2.5i", 3.5
"3.5+i", 3.5
"3.5", 3.5
3.5, 3.5
"3.5-i", 3.5
"3.5-2.5i", 3.5
"1+2.5i", 1
"1+i", 1
"1", 1
1, 1
"1-i", 1
"1-2.5i", 1
"2.5i", 0
"i", 0
"0", 0
0, 0
"-i", 0
"-2.5i", 0
"-1+2.5i", -1
"-1+i", -1
"-1", -1
"-1-i", -1
"-1-2.5i", -1
"-3.5+2.5i", -3.5
"-3.5+i", -3.5
"-3.5", -3.5
"-3.5-i", -3.5
"-3.5-2.5i", -3.5

View File

@@ -0,0 +1,27 @@
"12.34+5.67j", "-32.5483841590412+141.315819535092j"
"3.5+2.5i", "-2.15110429680353-5.66575444574645i"
"3.5+i", "-0.541286805665839-1.10052501669986i"
"3.5", "-0.35078322768962"
"3.5-i", "-0.541286805665839+1.10052501669986i"
"3.5-2.5i", "-2.15110429680353+5.66575444574645i"
"1+2.5i", "5.16014366757971+3.26893943207955i"
"1+i", "1.29845758141598+0.634963914784736i"
"1", "0.841470984807897"
"1-i", "1.29845758141598-0.634963914784736i"
"1-2.5i", "5.16014366757971-3.26893943207955i"
"2.5i", "6.05020448103979i"
"i", "1.1752011936438i"
"0", "0"
"-i", "-1.1752011936438i"
"-2.5i", "-6.05020448103979i"
"-1+2.5i", "-5.16014366757971+3.26893943207955i"
"-1+i", "-1.29845758141598+0.634963914784736i"
"-1", "-0.841470984807897"
"-1-i", "-1.29845758141598-0.634963914784736i"
"-1-2.5i", "-5.16014366757971-3.26893943207955i"
"-3.5+2.5i", "2.15110429680353-5.66575444574645i"
"-3.5+i", "0.541286805665839-1.10052501669986i"
"-3.5", "0.35078322768962"
"-3.5-i", "0.541286805665839+1.10052501669986i"
"-3.5-2.5i", "2.15110429680353+5.66575444574645i"
"3", "0.141120008059867"

View File

@@ -0,0 +1,28 @@
"12.34+5.67j", "3.60002071031685+0.787495469644252j"
"-1.234E-5+6.78E9i", "58223.7065120385+58223.7065120386i"
"3.5+2.5i", "1.9749889409211+0.632914936433528i"
"3.5+i", "1.88945163270197+0.264627043818521i"
"3.5", "1.87082869338697"
"3.5-i", "1.88945163270197-0.264627043818521i"
"3.5-2.5i", "1.9749889409211-0.632914936433528i"
"1+2.5i", "1.35878298553655+0.919940868634298i"
"1+i", "1.09868411346781+0.455089860562227i"
"1", "1"
"1-i", "1.09868411346781-0.455089860562227i"
"1-2.5i", "1.35878298553655-0.919940868634298i"
"2.5i", "1.11803398874989+1.11803398874989i"
"i", "0.707106781186548+0.707106781186547i"
"0", "0"
"-i", "0.707106781186548-0.707106781186547i"
"-2.5i", "1.11803398874989-1.11803398874989i"
"-1+2.5i", "0.919940868634298+1.35878298553655i"
"-1+i", "0.455089860562227+1.09868411346781i"
"-1", "6.12303176911189E-017+i"
"-1-i", "0.455089860562227-1.09868411346781i"
"-1-2.5i", "0.919940868634298-1.35878298553655i"
"-3.5+2.5i", "0.632914936433528+1.9749889409211i"
"-3.5+i", "0.264627043818521+1.88945163270197i"
"-3.5", "1.14551435241745E-016+1.87082869338697i"
"-3.5-i", "0.264627043818521-1.88945163270197i"
"-3.5-2.5i", "0.632914936433528-1.9749889409211i"
"9", "3"

View File

@@ -0,0 +1,10 @@
"12.34+5.67j", "123.45+67.89i", "#NUM!"
"123.45+67.89j", "12.34+5.67j", "111.11+62.22j"
"12.34+5.67j", "123.45+67.89j", "-111.11-62.22j"
"12.34+5.67i", "123.45+67.89i", "123.45+67.89i", "-111.11-62.22i"
"-12.34-5.67i", "123.45-67.89i", "-135.79+62.22i"
"12.34-5.67i", "-123.45-67.89i", "135.79+62.22i"
"-12.34-5.67i", "-123.45-67.89i", "111.11+62.22i"
"-12.34-5.67i", "-123.45-67.89", "#NUM!"
"-12.34-5.67j", "-123.45-67.89", "#NUM!"
"-12.34-5.67", "-123.45-67.89j", "#NUM!"

View File

@@ -0,0 +1,10 @@
"12.34+5.67j", "123.45+67.89i", "#NUM!"
"12.34+5.67j", "123.45+67.89j", "135.79+73.56j"
"12.34-5.67i", "123.45+67.89i", "135.79+62.22i"
"12.34+5.67i", "123.45-67.89i", "135.79-62.22i"
"12.34-5.67i", "123.45-67.89i", "135.79-73.56i"
"12.34+5.67i", "123.45+67.89i", "123.45+67.89i", "259.24+141.45i"
"12.34+5.67i", "123.45+67.89i", "123.45+67.89j", "#NUM!"
"-12.34-5.67i", "123.45-67.89i", "111.11-73.56i"
"12.34-5.67i", "-123.45-67.89i", "-111.11-73.56i"
"-12.34-5.67i", "-123.45-67.89i", "-135.79-73.56i"

View File

@@ -0,0 +1,9 @@
"1357", "#NUM!"
"246", "10100110"
"3", 3, "011"
"12345", "#NUM!"
"123.45", "#NUM!"
"0", "0"
TRUE, "#VALUE!"
"3579", "#NUM!"
"7777777000", "1000000000" // 2's Complement

Some files were not shown because too many files have changed in this diff Show More