Skip to content

Commit

Permalink
Merge pull request #2854 from sparr/format_floating_point_error_in_te…
Browse files Browse the repository at this point in the history
…st_output

Use `string.format` to fix floating point error in test output
  • Loading branch information
sumneko committed Sep 18, 2024
2 parents f95eb32 + cb5783b commit fbd5bb1
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
## Unreleased
<!-- Add all new changes here. They will be moved under a version at release -->
* `NEW` Added support for Japanese locale
* `FIX` Eliminate floating point error in test benchmark output
* `FIX` Remove luamake install from make scripts

## 3.10.6
Expand Down
2 changes: 1 addition & 1 deletion test/full/projects.lua
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ local function doProjects(pathname)
for uri in files.eachFile() do
local fileClock = os.clock()
diag.doDiagnostic(uri, true)
print('诊断文件耗时:', os.clock() - fileClock, uri)
print('诊断文件耗时:', string.format("%.6f", os.clock() - fileClock), uri)
end

local passed = os.clock() - clock
Expand Down
2 changes: 1 addition & 1 deletion test/full/self.lua
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ for uri in files.eachFile() do
end)
local fileClock = os.clock()
diag.doDiagnostic(uri, true)
print('诊断文件耗时:', os.clock() - fileClock, uri)
print('诊断文件耗时:', string.format("%.6f", os.clock() - fileClock), uri)
::CONTINUE::
end

Expand Down

0 comments on commit fbd5bb1

Please sign in to comment.