aboutsummaryrefslogblamecommitdiffstats
path: root/metrics/writer_test.go
blob: 1aacc287121b4855a5913ead850f7687314fefdf (plain) (tree)





















                                                                   
package metrics

import (
    "sort"
    "testing"
)

func TestMetricsSorting(t *testing.T) {
    var namedMetrics = namedMetricSlice{
        {name: "zzz"},
        {name: "bbb"},
        {name: "fff"},
        {name: "ggg"},
    }

    sort.Sort(namedMetrics)
    for i, name := range []string{"bbb", "fff", "ggg", "zzz"} {
        if namedMetrics[i].name != name {
            t.Fail()
        }
    }
}