-
Notifications
You must be signed in to change notification settings - Fork 0
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
Unit tests #9
Comments
Hello @gllmflndn I am glad that the unit tests were helpful to you. A human-readable format ("pretty" indentation) for JSON is already on the list for |
The https://github.com/gllmflndn/JSONio/blob/6c699a315ac2c578864d8b740a061bff47b718bf/jsonread.m#L6-L9 and for Matlab https://www.mathworks.com/help/matlab/ref/matlab.lang.makevalidname.html#namevaluepairarguments and might be a nice addition to cope with non-alphanumeric characters. The following works in Octave, but is considered as "invalid fieldname" in Matlab R2020b: >> struct ("4number!", 3.14)
ans =
scalar structure containing the fields:
4number! = 3.1400 @Abdallah-Elshamy your >> jsondecode ('{"4number!": 3.14}')
ans =
scalar structure containing the fields:
x4number_ = 3.1400 So the big idea is to just forward Sounds good to me. Maybe you can also implement https://www.mathworks.com/help/matlab/ref/matlab.lang.makevalidname.html#namevaluepairarguments |
Hi, I have added the If you have any comments, please let me know |
Hi @Abdallah-Elshamy
Thanks for the comprehensive list of unit tests. They highlighted one difference between JSONio and jsonencode/jsondecode (test 22: b = instead of b = ) that I was not aware of.
Concerning the other points mentioned on the maintainers mailing list, for JSONio, I have added some extra options,
Indent
andReplacementStyle
, defaulting to Matlab. Perhaps a similar approach could be taken for Octave?The text was updated successfully, but these errors were encountered: