A prometheus exporter that exposes nftables counters
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

17 lines
440 B

package exporter
import (
"testing"
)
func TestCleanupName(t *testing.T) {
input := []string{"ABC-DEF", "Awesome-Counter-1", "NomÉtrangeAvecDesCaract#r{$Bizares"}
expected := []string{"abc_def", "awesome_counter_1", "nom_trangeavecdescaract_r__bizares"}
for i := range input {
output := cleanupName(input[i])
if output != expected[i] {
t.Errorf("cleanupName(%s): got %s, expected %s", input[i], output, expected[i])
}
}
}