forked from xmidt-org/golang-money
-
Notifications
You must be signed in to change notification settings - Fork 1
/
span_test.go
37 lines (30 loc) · 940 Bytes
/
span_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
package money
// import (
// "testing"
// "time"
// "github.com/stretchr/testify/assert"
// "github.com/stretchr/testify/require"
// )
// func TestSpan(t *testing.T) {
// t.Run("String", testSpanString)
// }
// func testSpanString(t *testing.T) {
// startTime, e := time.Parse(time.RFC3339, "1970-01-01T00:00:01+00:00") //1 second into epoch time = 1,000,000 microseconds
// require.Nil(t, e)
// i := &Span{
// Name: "test-span",
// AppName: "test-app",
// TC: &TraceContext{
// TID: "test-trace",
// SID: 1,
// PID: 1,
// },
// Success: true,
// Code: 200,
// StartTime: startTime,
// Duration: time.Second,
// Host: "localhost",
// }
// var expected = "span-name=test-span;app-name=test-app;span-duration=1000000;span-success=true;span-id=1;trace-id=test-trace;parent-id=1;start-time=1000000;host=localhost;http-response-code=200"
// assert.Equal(t, i.String(), expected)
// }