-
Notifications
You must be signed in to change notification settings - Fork 0
Improve tests and extend TableIOPlugin #6
Conversation
…nore misbehaving tests #5 * the new testParser test demonstrates how a table containing Double values are saved to disk by default and loaded as String values by default after opening the same file * testSmallTables and testQuote had to be ignored since they modify the parameters of DefaultTableIOPlugin and that messes with the new testParser test since they share a context
- guess parser, fix remaining tests
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 @frauzufall, I think this PR is almost good to be merged. There are just a few minor changes I'd like to see:
- remove commented code (
DISCUSS) - remove
setValuesinDefaultTableIOPluginTest(line 314-327)
We can also improve test coverage by adding:
- tests opening files with varying row length (throwing
IOException-- or maybe ignoring it as an option?) - test
guessParserforInteger,LongandFloatin addition toDouble - test
save(Table, String)signature - test a few more invalid/error cases
But I guess these things can wait for a later pull request.
* opting against guessing whether row and / or column headers exist in favor of predictable and deterministic behavior
|
Thanks for the comments @imagejan! About testing This test fails, because the String can and therefore will be interpreted as Integer: Using a number too big for an Integer should work, I thought, but this also fails and I don't understand why: Here is the result: Similar problem with |
|
@frauzufall wrote:
I added a slightly modified line: scijava-plugins-io-table/src/test/java/org/scijava/table/DefaultTableIOPluginTest.java Line 258 in 922e925
... and it passes. However, we now still have dead code with the scijava-plugins-io-table/src/main/java/org/scijava/table/DefaultTableIOPlugin.java Lines 255 to 262 in 922e925
|
* the guessParser method is currently always prefers double over float * the float parsing lines are therefore removed since they can't be reached
|
@imagejan Thanks! I removed the dead code. It will just always use double when guessing, that's fine, right? I'm sure the guessing can be further improved, but we probably need to release a new version of this repo too before uploading the most recent version of |
This PR is addressing scijava/scijava-table#22 and making the
DefaultTableIOPlugincompatible with the latestscijava-tableversion.Changes:
DefaultTableIOPluginextendsTableIOPluginTableIOOptionsinstead