github.com/vtorhonen/terraform@v0.9.0-beta2.0.20170307220345-5d894e4ffda7/builtin/providers/newrelic/helpers_test.go (about)

     1  package newrelic
     2  
     3  import "testing"
     4  
     5  func TestParseIDs_Basic(t *testing.T) {
     6  	ids, err := parseIDs("1:2", 2)
     7  	if err != nil {
     8  		t.Fatal(err)
     9  	}
    10  
    11  	if len(ids) != 2 {
    12  		t.Fatal(len(ids))
    13  	}
    14  
    15  	if ids[0] != 1 || ids[1] != 2 {
    16  		t.Fatal(ids)
    17  	}
    18  }
    19  
    20  func TestSerializeIDs_Basic(t *testing.T) {
    21  	id := serializeIDs([]int{1, 2})
    22  
    23  	if id != "1:2" {
    24  		t.Fatal(id)
    25  	}
    26  }