-
Notifications
You must be signed in to change notification settings - Fork 144
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
Yams.serialize converts string in ' to number #174
Comments
sbarow
changed the title
Yams.serialize converts string in '' to float
Yams.serialize converts string in ' to number
Feb 11, 2019
Doesn't look like this is specific to
Looking at this, a possible solution could be in
If you're okay with this I can put up a PR. |
Thank you for filing an issue! Could you provide test code to reproduce the issue? func testSrializeNumberInSingleQuote() throws {
let yaml = """
value1: '10.0'
value2: !!str '10.0'
"""
let node = try Yams.compose(yaml: yaml)
let updatedNode = try node.represented()
let serialized = try Yams.serialize(node: updatedNode)
print(serialized)
} result: Test Suite 'Selected tests' started at 2019-02-16 09:23:46.575
Test Suite 'YamsTests.xctest' started at 2019-02-16 09:23:46.576
Test Suite 'EmitterTests' started at 2019-02-16 09:23:46.578
Test Case '-[YamsTests.EmitterTests testSrializeNumberInSingleQuote]' started.
value1: '10.0'
value2: '10.0'
Test Case '-[YamsTests.EmitterTests testSrializeNumberInSingleQuote]' passed (0.135 seconds).
Test Suite 'EmitterTests' passed at 2019-02-16 09:23:46.714.
Executed 1 test, with 0 failures (0 unexpected) in 0.135 (0.136) seconds
Test Suite 'YamsTests.xctest' passed at 2019-02-16 09:23:46.715.
Executed 1 test, with 0 failures (0 unexpected) in 0.135 (0.139) seconds
Test Suite 'Selected tests' passed at 2019-02-16 09:23:46.716.
Executed 1 test, with 0 failures (0 unexpected) in 0.135 (0.140) seconds
Program ended with exit code: 0``` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Following on #116 when trying to serialise something like
value: '10.0'
the output will bevalue: 10.0
.Unfortunately doing
value: !!str '10.0'
still results in the output being number, tested with"
and the same happens.Example updating:
The text was updated successfully, but these errors were encountered: