mirror of
https://github.com/hanzoai/telemetry.git
synced 2026-10-30 20:01:49 +00:00
24 lines
483 B
Go
24 lines
483 B
Go
// Copyright The OpenTelemetry Authors
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
package sendertest
|
|
|
|
import (
|
|
"context"
|
|
"errors"
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/require"
|
|
)
|
|
|
|
func TestNewNopSenderFunc(t *testing.T) {
|
|
sender := NewNopSenderFunc[int]()
|
|
require.NoError(t, sender(context.Background(), 1))
|
|
}
|
|
|
|
func TestNewErrSenderFunc(t *testing.T) {
|
|
err := errors.New("test")
|
|
sender := NewErrSenderFunc[int](err)
|
|
require.ErrorIs(t, sender(context.Background(), 1), err)
|
|
}
|