mirror of
https://github.com/hanzoai/telemetry.git
synced 2026-10-30 20:01:49 +00:00
* [chore] use license shortform To remain consistent w/ contrib repo, see https://github.com/open-telemetry/opentelemetry-collector-contrib/pull/22052 Signed-off-by: Alex Boten <[email protected]> * make goporto Signed-off-by: Alex Boten <[email protected]> --------- Signed-off-by: Alex Boten <[email protected]>
31 lines
686 B
Go
31 lines
686 B
Go
// Copyright The OpenTelemetry Authors
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
package plog
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
)
|
|
|
|
func TestLogRecordFlags(t *testing.T) {
|
|
flags := LogRecordFlags(1)
|
|
assert.True(t, flags.IsSampled())
|
|
assert.EqualValues(t, uint32(1), flags)
|
|
|
|
flags = flags.WithIsSampled(false)
|
|
assert.False(t, flags.IsSampled())
|
|
assert.EqualValues(t, uint32(0), flags)
|
|
|
|
flags = flags.WithIsSampled(true)
|
|
assert.True(t, flags.IsSampled())
|
|
assert.EqualValues(t, uint32(1), flags)
|
|
}
|
|
|
|
func TestDefaultLogRecordFlags(t *testing.T) {
|
|
flags := DefaultLogRecordFlags
|
|
assert.False(t, flags.IsSampled())
|
|
assert.EqualValues(t, uint32(0), flags)
|
|
}
|