Skip to content

Commit fbd5bb1

Browse files
authored
Merge pull request #2854 from sparr/format_floating_point_error_in_test_output
Use `string.format` to fix floating point error in test output
2 parents f95eb32 + cb5783b commit fbd5bb1

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

Diff for: changelog.md

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
## Unreleased
44
<!-- Add all new changes here. They will be moved under a version at release -->
55
* `NEW` Added support for Japanese locale
6+
* `FIX` Eliminate floating point error in test benchmark output
67
* `FIX` Remove luamake install from make scripts
78

89
## 3.10.6

Diff for: test/full/projects.lua

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ local function doProjects(pathname)
4949
for uri in files.eachFile() do
5050
local fileClock = os.clock()
5151
diag.doDiagnostic(uri, true)
52-
print('诊断文件耗时:', os.clock() - fileClock, uri)
52+
print('诊断文件耗时:', string.format("%.6f", os.clock() - fileClock), uri)
5353
end
5454

5555
local passed = os.clock() - clock

Diff for: test/full/self.lua

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ for uri in files.eachFile() do
4848
end)
4949
local fileClock = os.clock()
5050
diag.doDiagnostic(uri, true)
51-
print('诊断文件耗时:', os.clock() - fileClock, uri)
51+
print('诊断文件耗时:', string.format("%.6f", os.clock() - fileClock), uri)
5252
::CONTINUE::
5353
end
5454

0 commit comments

Comments
 (0)