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

Use string.format to fix floating point error in test output #2854

Merged

Conversation

sparr
Copy link
Contributor

@sparr sparr commented Sep 15, 2024

Floating point error causes some test benchmark times to have a bunch of trailing 9s or 0s before some noise at the end.

Before:

诊断文件耗时:  0.0048709999999978      file:///Users/sparr/src/lua-language-server/script/SDBMHash.lua
诊断文件耗时:  0.545929        file:///Users/sparr/src/lua-language-server/script/await.lua
诊断文件耗时:  0.0079290000000007      file:///Users/sparr/src/lua-language-server/script/brave/log.lua

After:

诊断文件耗时:  0.004871        file:///Users/sparr/src/lua-language-server/script/SDBMHash.lua
诊断文件耗时:  0.545929        file:///Users/sparr/src/lua-language-server/script/await.lua
诊断文件耗时:  0.007929        file:///Users/sparr/src/lua-language-server/script/brave/log.lua

@sparr sparr force-pushed the format_floating_point_error_in_test_output branch from 9feb624 to 3e90f68 Compare September 15, 2024 14:25
@sumneko sumneko merged commit fbd5bb1 into LuaLS:master Sep 18, 2024
11 checks passed
@sumneko
Copy link
Collaborator

sumneko commented Sep 18, 2024

Thank you!

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

Successfully merging this pull request may close these issues.

2 participants