// Copyright 2026 The Gitea Authors. All rights reserved. // SPDX-License-Identifier: MIT package container import ( "bufio" "os" "path/filepath" "strings" "testing" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "golang.org/x/text/encoding/unicode" ) func newTestHostEnv(t *testing.T) (*HostEnvironment, string) { t.Helper() e := &HostEnvironment{Path: t.TempDir()} return e, filepath.Join(e.Path, "envfile") } func TestParseEnvFile(t *testing.T) { t.Parallel() largeValue := strings.Repeat("x", 2*1024*1024) encodeUTF16 := func(endianness unicode.Endianness) string { content, err := unicode.UTF16(endianness, unicode.UseBOM).NewEncoder().Bytes([]byte("FOO=bar\r\nMULTI<