27 lines
357 B
Go
27 lines
357 B
Go
package newrelic
|
|
|
|
import "testing"
|
|
|
|
func TestParseIDs_Basic(t *testing.T) {
|
|
ids, err := parseIDs("1:2", 2)
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
|
|
if len(ids) != 2 {
|
|
t.Fatal(len(ids))
|
|
}
|
|
|
|
if ids[0] != 1 || ids[1] != 2 {
|
|
t.Fatal(ids)
|
|
}
|
|
}
|
|
|
|
func TestSerializeIDs_Basic(t *testing.T) {
|
|
id := serializeIDs([]int{1, 2})
|
|
|
|
if id != "1:2" {
|
|
t.Fatal(id)
|
|
}
|
|
}
|