testutil

package
v0.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 12, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssertFileExists

func AssertFileExists(t *testing.T, path string)

AssertFileExists проверяет что файл существует и падает если нет

func AssertJPEGValid

func AssertJPEGValid(t *testing.T, path string)

AssertJPEGValid проверяет что файл является валидным JPEG

func CleanupFiles

func CleanupFiles(t *testing.T, paths ...string)

CleanupFiles удаляет список файлов (для defer)

func CompareFileSizes

func CompareFileSizes(t *testing.T, path1, path2 string) (size1, size2 int64)

CompareFileSizes сравнивает размеры двух файлов

func CreateCheckerboardImage

func CreateCheckerboardImage(width, height, blockSize int) image.Image

CreateCheckerboardImage создает изображение в виде шахматной доски

func CreateSolidColorImage

func CreateSolidColorImage(width, height int, c color.Color) image.Image

CreateSolidColorImage создает изображение одного цвета

func CreateTempFile

func CreateTempFile(t *testing.T, dir, pattern string, content []byte) string

CreateTempFile создает временный файл с заданным содержимым

func CreateTestImage

func CreateTestImage(width, height int) image.Image

CreateTestImage создает тестовое изображение с градиентом

func CreateTestJPEG

func CreateTestJPEG(t *testing.T, path string, width, height, quality int)

CreateTestJPEG создает тестовый JPEG файл с заданными параметрами

func FileExists

func FileExists(t *testing.T, path string) bool

FileExists проверяет существование файла

func GetFileSize

func GetFileSize(t *testing.T, path string) int64

GetFileSize возвращает размер файла в байтах

func ReadJPEGImage

func ReadJPEGImage(t *testing.T, path string) image.Image

ReadJPEGImage читает JPEG файл и возвращает image.Image

func SkipIfShort

func SkipIfShort(t *testing.T, reason string)

SkipIfShort пропускает тест если установлен флаг -short

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL