Skip to content

Commit 9feb624

Browse files
committed
Use string.format to fix floating point error in test output
1 parent 6614170 commit 9feb624

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

test/full/projects.lua

Lines changed: 1 addition & 1 deletion
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

test/full/self.lua

Lines changed: 1 addition & 1 deletion
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)