Skip to content

Commit

Permalink
tests(noop): adds test to cover zipkin.IsNoop. (openzipkin#182)
Browse files Browse the repository at this point in the history
  • Loading branch information
jcchavezs committed Nov 11, 2020
1 parent f113cc0 commit 705fed4
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions noop_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,23 @@ func TestNoopContext(t *testing.T) {
span.SetRemoteEndpoint(nil)
span.Flush()
}

func TestIsNoop(t *testing.T) {
sc := model.SpanContext{
TraceID: model.TraceID{High: 1, Low: 2},
ID: model.ID(3),
Sampled: new(bool),
}

ns := &noopSpan{sc}

if want, have := true, IsNoop(ns); want != have {
t.Error("unexpected noop")
}

span := &spanImpl{SpanModel: model.SpanModel{SpanContext: sc}}

if want, have := false, IsNoop(span); want != have {
t.Error("expected noop")
}
}

0 comments on commit 705fed4

Please sign in to comment.