Correctly parse all valid test cases #9
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Except for these four valid test cases ("toplevel_defaults_deme_01.yaml", "successors_predecessors_01.yaml", "deme_end_time_01.yaml", "unicode_deme_name_04.yaml"), all valid test cases in the deme spec can now be parsed correctly and pass all tests.
The files that cannot be parsed correctly are for reasons outside the validate_demes() function. The first three don't pass because they have a deme named "y" and that is interpreted as TRUE in yaml 1.1 which is what the yaml reader is based on. For the last one it is the pre-parsed file that causes issues. It cannot be read by yaml::read_yaml without causing an error unless fileEncoding = UTF-16 is specified.