test

package
v1.7.17 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2025 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package test provides functions for general testing use

Package test provides functions for general testing use

Copyright (C) 2019-2025 vdaas.org vald team <vald@vdaas.org>

Licensed under the Apache License, Version 2.0 (the "License"); You may not use this file except in compliance with the License. You may obtain a copy of the License at

https://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

View Source
const (
	ValidIndex = "agent/ngt/validIndex"
)

Variables

This section is empty.

Functions

func DefaultCheck added in v1.7.17

func DefaultCheck[T any](tt *testing.T, want Result[T], got Result[T]) error

func GetTestdataPath

func GetTestdataPath(filename string) string

GetTestdataPath returns the test data file path under `internal/test/data`.

func Run added in v1.7.17

func Run[T, A any](ctx context.Context, t *testing.T, do Do[T, A], tests ...Case[T, A]) error

Types

type AfterFunc added in v1.7.17

type AfterFunc[T, A any] func(context.Context, *testing.T, A, T, error) error

type BeforeFunc added in v1.7.17

type BeforeFunc[A any] func(context.Context, *testing.T, A) A

type Case added in v1.7.17

type Case[T, A any] struct {
	Want       Result[T]
	Args       A
	BeforeFunc BeforeFunc[A]
	AfterFunc  AfterFunc[T, A]
	CheckFunc  CheckFunc[T]
	Name       string
}

type CheckFunc added in v1.7.17

type CheckFunc[T any] func(tt *testing.T, want Result[T], got Result[T]) error

type Do added in v1.7.17

type Do[T, A any] func(*testing.T, A) (T, error)

type Result added in v1.7.17

type Result[T any] struct {
	Val T
	Err error
}

Directories

Path Synopsis
data
hdf5
Package hdf5 is load hdf5 file
Package hdf5 is load hdf5 file
request
Package request provides functions to generate proto request for testing
Package request provides functions to generate proto request for testing
strings
Package strings provides functionality for Vald.
Package strings provides functionality for Vald.
vector
Package vector provides functionality for Vald.
Package vector provides functionality for Vald.
vector/noise
Package noise provides functionality for Vald.
Package noise provides functionality for Vald.
Package goleak provides functionality for Vald.
Package goleak provides functionality for Vald.
grpc
Package grpc provides functionality for Vald.
Package grpc provides functionality for Vald.
k8s
Package testify provides functionality for Vald.
Package testify provides functionality for Vald.

Jump to

Keyboard shortcuts

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