// Copyright The OpenTelemetry Authors
// SPDX-License-Identifier: Apache-2.0

// Code generated by "internal/cmd/pdatagen/main.go". DO NOT EDIT.
// To regenerate this file run "make genpdata".

package internal

import (
	"testing"

	"github.com/stretchr/testify/assert"

	v1 "go.opentelemetry.io/collector/pdata/internal/data/protogen/common/v1"
)

func TestCopyOrigKeyValueSlice(t *testing.T) {
	src := []v1.KeyValue{}
	dest := []v1.KeyValue{}
	// Test CopyTo empty
	dest = CopyOrigKeyValueSlice(dest, src)
	assert.Equal(t, []v1.KeyValue{}, dest)

	// Test CopyTo larger slice
	src = GenerateOrigTestKeyValueSlice()
	dest = CopyOrigKeyValueSlice(dest, src)
	assert.Equal(t, GenerateOrigTestKeyValueSlice(), dest)

	// Test CopyTo same size slice
	dest = CopyOrigKeyValueSlice(dest, src)
	assert.Equal(t, GenerateOrigTestKeyValueSlice(), dest)

	// Test CopyTo smaller size slice
	dest = CopyOrigKeyValueSlice(dest, []v1.KeyValue{})
	assert.Len(t, dest, 0)

	// Test CopyTo larger slice with enough capacity
	dest = CopyOrigKeyValueSlice(dest, src)
	assert.Equal(t, GenerateOrigTestKeyValueSlice(), dest)
}
