mirror of
https://github.com/hanzoai/otel-collector.git
synced 2026-10-30 18:26:25 +00:00
* feat: add signozkafkaexporter * feat: select kafka topic based on tenant id * feat: add kafkareceiver * chore: expose sarama client's fetch config to signozkafkareceiver * chore: integrate signozkafkaexporters and receivers with v0.88.0 * chore: update go.mod and go.sum * chore: modify testdata/config.yaml * chore: fix tests --------- Co-authored-by: Prashant Shahi <[email protected]> Co-authored-by: Vishal Sharma <[email protected]>
54 lines
1.1 KiB
Go
54 lines
1.1 KiB
Go
// Copyright The OpenTelemetry Authors
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
package textutils
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
"golang.org/x/text/encoding"
|
|
"golang.org/x/text/encoding/japanese"
|
|
"golang.org/x/text/encoding/korean"
|
|
"golang.org/x/text/encoding/simplifiedchinese"
|
|
"golang.org/x/text/encoding/unicode"
|
|
)
|
|
|
|
func TestUTF8Encoding(t *testing.T) {
|
|
tests := []struct {
|
|
name string
|
|
encoding encoding.Encoding
|
|
encodingName string
|
|
}{
|
|
{
|
|
name: "UTF8 encoding",
|
|
encoding: unicode.UTF8,
|
|
encodingName: "utf8",
|
|
},
|
|
{
|
|
name: "GBK encoding",
|
|
encoding: simplifiedchinese.GBK,
|
|
encodingName: "gbk",
|
|
},
|
|
{
|
|
name: "SHIFT_JIS encoding",
|
|
encoding: japanese.ShiftJIS,
|
|
encodingName: "shift_jis",
|
|
},
|
|
{
|
|
name: "EUC-KR encoding",
|
|
encoding: korean.EUCKR,
|
|
encodingName: "euc-kr",
|
|
},
|
|
}
|
|
for _, test := range tests {
|
|
t.Run(test.name, func(t *testing.T) {
|
|
encCfg := NewEncodingConfig()
|
|
encCfg.Encoding = test.encodingName
|
|
enc, err := encCfg.Build()
|
|
assert.NoError(t, err)
|
|
assert.Equal(t, test.encoding, enc.Encoding)
|
|
})
|
|
}
|
|
}
|