-
Notifications
You must be signed in to change notification settings - Fork 2
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
Adding support for commas in active views list #26
Adding support for commas in active views list #26
Conversation
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 adding this Jonathan, I think it will be very helpful for OCIO!
Please add unit tests in tests/cpu/ParseUtils_tests.cpp. This should include the various edge cases, including unmatched quotes.
a3dd78e
to
d53c452
Compare
-Adding test cases and some parsing fixes -Fix for join -Fix for bug in split string and move order of functions
d53c452
to
6c41780
Compare
added a test case for SplitStringEnvStyle and JoinStringEnvStyle.
outputvec.clear(); | ||
|
||
outputvec = { "This", "is \": a: test" }; | ||
OCIO_CHECK_EQUAL( "This, \"is \": a: test\"", OCIO::JoinStringEnvStyle(outputvec) ); |
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 add more tests that use commas and quotes, such as:
outputvec = { "This", "is: ", ""a very good,"", " fine, helpful, and useful ", "test" };
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.
Added this test case and another one
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.
Actually, please make the first word ""This"", to test that quotes are omitted when they aren't necessary.
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.
Join would not remove the quotes in this case, but it would not add another around a string that is already surrounded by quotes. I would expect split to remove the quotes (not join).
I changed two test case to touch what I just described.
07e0c57
to
dcbd876
Compare
outputvec.clear(); | ||
|
||
outputvec = { "This", "is \": a: test" }; | ||
OCIO_CHECK_EQUAL( "This, \"is \": a: test\"", OCIO::JoinStringEnvStyle(outputvec) ); |
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.
Actually, please make the first word ""This"", to test that quotes are omitted when they aren't necessary.
5b0fcc7
to
6df1d60
Compare
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.
If you're able to fix the Windows CI failure, that would be great. Otherwise, go ahead and merge and I will fix it before submitting to OCIO.
Don't worry about the other CI failures. I need to pull over the latest Actions workflow from OCIO main to get that working again on our branch.
8f9854d
to
659b7b3
Compare
659b7b3
to
8e37809
Compare
Added a set/get/clear/remove for the active views and displays.
Made changes to the YAML save to avoid repeating the parsing of the string list.