| 1 | package statement |
| 2 | |
| 3 | import ( |
| 4 | "testing" |
| 5 | |
| 6 | "github.com/influxdata/influxdb/stress/v2/stress_client" |
| 7 | ) |
| 8 | |
| 9 | func TestGoSetID(t *testing.T) { |
| 10 | e := newTestGo() |
| 11 | newID := "oaijnifo" |
| 12 | e.SetID(newID) |
| 13 | if e.StatementID != newID { |
| 14 | t.Errorf("Expected: %v\nGot: %v\n", newID, e.StatementID) |
| 15 | } |
| 16 | } |
| 17 | |
| 18 | func TestGoRun(t *testing.T) { |
| 19 | e := newTestGo() |
| 20 | s, _, _ := stressClient.NewTestStressTest() |
| 21 | e.Run(s) |
| 22 | if e == nil { |
| 23 | t.Fail() |
| 24 | } |
| 25 | } |
| 26 | |
| 27 | func TestGoReport(t *testing.T) { |
| 28 | e := newTestGo() |
| 29 | s, _, _ := stressClient.NewTestStressTest() |
| 30 | report := e.Report(s) |
| 31 | if report != "Go " { |
| 32 | t.Errorf("Expected: %v\nGot: %v\n", "Go ", report) |
| 33 | } |
| 34 | } |
| 35 | |
| 36 | func newTestGo() *GoStatement { |
| 37 | return &GoStatement{ |
| 38 | Statement: newTestExec(), |
| 39 | StatementID: "fooID", |
| 40 | } |
| 41 | } |