Skip to content

Commit

Permalink
test: test ratio value
Browse files Browse the repository at this point in the history
Signed-off-by: Utku Ozdemir <uoz@protonmail.com>
  • Loading branch information
utkuozdemir committed Jun 24, 2021
1 parent ae42442 commit 8d58587
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions internal/exporter/exporter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,12 @@ func TestBuildFQNameAndMultiplierMHZ(t *testing.T) {
assert.Equal(t, "prefix_clocks_current_graphics_clock_hz", fqName)
}

func TestBuildFQNameAndMultiplierRatio(t *testing.T) {
fqName, multiplier := buildFQNameAndMultiplier("prefix", "fan.speed [%]")
assertFloat(t, 0.01, multiplier)
assert.Equal(t, "prefix_fan_speed_ratio", fqName)
}

func TestBuildFQNameAndMultiplierNoPrefix(t *testing.T) {
fqName, multiplier := buildFQNameAndMultiplier("", "encoder.stats.sessionCount")
assertFloat(t, 1, multiplier)
Expand Down

0 comments on commit 8d58587

Please sign in to comment.