-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixed tests to work with windows file separator too using OS agnostic… #23
base: master
Are you sure you want to change the base?
Conversation
… DIRECTORY_SEPARATOR
…hat are failing that I can't figure out.
@@ -26,13 +26,13 @@ class ExtCaseInsensitiveGeneratorTest extends TestBase | |||
public function testGenerator() | |||
{ | |||
$extensions = array(); | |||
$generator = new ExtCaseInsensitiveGenerator('some/FILE.php'); | |||
$generator = new ExtCaseInsensitiveGenerator('some'.DIRECTORY_SEPARATOR.'FILE.php'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would leave the paths as it was before. The constant decreases readability
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will revert these.
@@ -142,15 +143,15 @@ public function setLength($length) { | |||
} | |||
|
|||
/** | |||
* Returns filed decimalCount | |||
* Returns field decimalCount |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for pointing out the typos
array('123', 123.0), | ||
array(123, 123.0), | ||
array(' 2', 2.0), | ||
array('1234.1234', 123.0), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
strange that in this test the fraction part is stripped
Please fix the tests |
* @throws Exception | ||
*/ | ||
public function testReadDbase4() { | ||
$dbf = Table::fromFile('tests/fixtures/dBase4.dbf'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test fails because it cannot find corresponding memo file (fbt)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is that FPT format? How do you choose one over the other?
In readme I see:
Supported memo formats
- DBT
- FPT
In the failed test I see:
- org\majkel\dbase\DBase4Test::testReadDbase4
Failed asserting that two strings are identical.
--- Expected
+++ Actual
@@ @@
-memo1
+▒▒
+memo1
$header = $this->reflect($format)->createHeader($this->getHeaderData(array( | ||
'v' => 666, | ||
))); | ||
self::assertTrue($header->isValid()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please investigate why this test fails. The only case where the header could be invalid is when the calculated records count does not match file size
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see what is going on here.
It is using bitwise logic here.
return $header->setValid($header->getVersion() & $this->getVersion());
So with dBase4 I need to use 668 for the test since it will be doing 668 & 4 in the above setValid method. And 4 in binary is 100. I have to choose a number that has its bit flipped in the 3rd spot and 666 doesn't do this but 668 does.
668 is 0010 1001 1100 in binary.
… DIRECTORY_SEPARATOR