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

wasm: format_int "strings: invalid rounding: internal error" #2923

Closed
patrick-east opened this issue Nov 18, 2020 · 0 comments · Fixed by #2999
Closed

wasm: format_int "strings: invalid rounding: internal error" #2923

patrick-east opened this issue Nov 18, 2020 · 0 comments · Fixed by #2999

Comments

@patrick-east
Copy link
Contributor

There are a handful of test cases which fail with an unexpected error when evaluated with the Wasm SDK

strings: invalid rounding: internal error

This includes the following test cases:

"strings/format_int" --> test/cases/testdata/strings/test-strings-0877.yaml
"strings/format_int: ref dest" --> test/cases/testdata/strings/test-strings-0879.yaml
"strings/format_int: ref dest (2)" -->test/cases/testdata/strings/test-strings-0880.yaml
"strings/format_int: undefined" --> test/cases/testdata/strings/test-strings-0878.yaml

srenatus added a commit to srenatus/opa that referenced this issue Dec 11, 2020
I'm not exactly sure why we had been rounding here before. Topdown truncates
when formatting a decimal number as int:

    format_int(15.9, 16) == "f"
    format_int(-15.9, 16) == "-f"

Fixes open-policy-agent#2923.

Signed-off-by: Stephan Renatus <stephan.renatus@gmail.com>
tsandall pushed a commit that referenced this issue Dec 14, 2020
I'm not exactly sure why we had been rounding here before. Topdown truncates
when formatting a decimal number as int:

    format_int(15.9, 16) == "f"
    format_int(-15.9, 16) == "-f"

Fixes #2923.

Signed-off-by: Stephan Renatus <stephan.renatus@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

1 participant