fix test file name and remove old test file

This commit is contained in:
gmega 2023-11-03 16:09:39 -03:00
parent 19d90191d8
commit aa6d8d7b56
No known key found for this signature in database
GPG Key ID: FFD8DAF00660270F
2 changed files with 1 additions and 61 deletions

View File

@ -7,7 +7,7 @@ import codex/utils/asyncprofiler
import ../../helpers import ../../helpers
checksuite "asyncprofiler utils": checksuite "asyncprofiler metrics serializer":
var fooLoc = SrcLoc( var fooLoc = SrcLoc(
procedure: "foo", procedure: "foo",

View File

@ -1,60 +0,0 @@
import std/tables
import std/unittest
import std/json
import codex/utils/asyncprofiler
import ../../helpers
checksuite "asyncprofiler utils":
var fooLoc = SrcLoc(
procedure: "foo",
file: "foo.nim",
line: 1
)
let metric = CallbackMetric(
totalExecTime: 2.seconds,
totalRunTime: 2.seconds,
totalWallTime: 2.seconds,
minSingleTime: 100.nanoseconds,
maxSingleTime: 1500.milliseconds,
count: 10
)
test "should serialize CallbackMetrics":
check %metric == %*{
"totalExecTime": 2000000000,
"totalRunTime": 2000000000,
"totalWallTime": 2000000000,
"minSingleTime": 100,
"maxSingleTime":1500000000,
"count": 10
}
test "should serialize SrcLoc":
check %fooLoc == %*{
"procedure": "foo",
"file": "foo.nim",
"line": 1
}
test "should serialize MetricsSummary":
var summary: MetricsSummary = {
(addr fooLoc): metric
}.toTable
check %summary == [%*{
"location": %*{
"procedure": "foo",
"file": "foo.nim",
"line": 1,
},
"totalExecTime": 2000000000,
"totalRunTime": 2000000000,
"totalWallTime": 2000000000,
"minSingleTime": 100,
"maxSingleTime":1500000000,
"count": 10
}]