Skip to content
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

Output of encodeResult on strings with dash/negative sign #407

Open
LanGit01 opened this issue Nov 13, 2017 · 1 comment
Open

Output of encodeResult on strings with dash/negative sign #407

LanGit01 opened this issue Nov 13, 2017 · 1 comment
Labels

Comments

@LanGit01
Copy link

What does this block of code supposed to do? Specifically the invalidYaml function.

https://github.com/substack/tape/blob/0e68b2d1ff44929ea56c291fa24d9083e3151f84/lib/results.js#L148-L154

The invalidYml function returns true on negative numbers because it has a dash. Thus, if the value of ac is -1, instead of printing

actual: -1

It prints

actual: |-
    -1

Is this the expected behavior?

@ljharb
Copy link
Collaborator

ljharb commented Dec 27, 2019

The implication is that a yaml parser won't work properly with actual: -1, but I'm not sure of the background.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants