Codebase list golang-github-go-kit-kit / b532d77
Fixed code review comments, adjusted test error output and asserts Nicholas J 8 years ago
1 changed file(s) with 17 addition(s) and 8 deletion(s). Raw diff Collapse all Expand all
00 package zipkin_test
11
22 import (
3 "bytes"
34 "testing"
45
56 "github.com/go-kit/kit/tracing/zipkin"
1516 encodedSpan := span.Encode()
1617 annotations := encodedSpan.GetBinaryAnnotations()
1718
18 if annotations[0].Key != key {
19 t.Errorf("Error: expected %s got %s", key, annotations[0].Key)
19 if len(annotations) == 0 {
20 t.Error("want non-zero length slice, have empty slice")
2021 }
2122
22 if string(annotations[0].Value) != string(value) {
23 t.Errorf("Error: expected %s got %s", string(value), string(annotations[0].Value))
23 if want, have := key, annotations[0].Key; want != have {
24 t.Errorf("want %q, got %q", want, have)
25 }
26
27 if want, have := value, annotations[0].Value; bytes.Compare(want, have) != 0 {
28 t.Errorf("want %s, got %s", want, have)
2429 }
2530 }
2631
3439 encodedSpan := span.Encode()
3540 annotations := encodedSpan.GetBinaryAnnotations()
3641
37 if annotations[0].Key != key {
38 t.Errorf("Error: expected %s got %s", key, annotations[0].Key)
42 if len(annotations) == 0 {
43 t.Error("want non-zero length slice, have empty slice")
3944 }
4045
41 if string(annotations[0].Value) != value {
42 t.Errorf("Error: expected %s got %s", value, string(annotations[0].Value))
46 if want, have := key, annotations[0].Key; want != have {
47 t.Errorf("want %q, got %q", want, have)
48 }
49
50 if want, have := value, annotations[0].Value; bytes.Compare([]byte(want), have) != 0 {
51 t.Errorf("want %s, got %s", want, have)
4352 }
4453 }