github.com/danp/terraform@v0.9.5-0.20170426144147-39d740081351/builtin/providers/circonus/metric_test.go (about)

     1  package circonus
     2  
     3  import "testing"
     4  
     5  func Test_MetricChecksum(t *testing.T) {
     6  	unit := "qty"
     7  	m := interfaceMap{
     8  		string(metricActiveAttr): true,
     9  		string(metricNameAttr):   "asdf",
    10  		string(metricTagsAttr):   tagsToState(apiToTags([]string{"foo", "bar"})),
    11  		string(metricTypeAttr):   "json",
    12  		string(metricUnitAttr):   &unit,
    13  	}
    14  
    15  	csum := metricChecksum(m)
    16  	if csum != 4250221491 {
    17  		t.Fatalf("Checksum mismatch")
    18  	}
    19  }