package_test

package
v0.10.1-0...-635839b Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2024 License: Apache-2.0, MIT Imports: 9 Imported by: 0

Documentation

Overview

package_test demonstrates various Go language features in the context of software testing

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BenchmarkSample

func BenchmarkSample(b *testing.B)

Benchmark function

func ExampleTestCase_Run

func ExampleTestCase_Run()

Example function

func Max

func Max[T int | float64](a, b T) T

Generic function

func TestMain

func TestMain(m *testing.M)

Main test function

func TestSample

func TestSample(t *testing.T)

Sample test function

Types

type Block

type Block interface {
	BlockSize() int
	Encrypt(src, dst []byte)
	Decrypt(src, dst []byte)
}

type ExtendedTestCase

type ExtendedTestCase struct {
	TestCase
	// contains filtered or unexported fields
}

Embedded struct

type GenericPair

type GenericPair[T any] struct {
	First  T
	Second T
}

Generic type

type Point

type Point struct {
	// contains filtered or unexported fields
}

type Polar

type Polar = polar

type Rectangle

type Rectangle struct {
	// contains filtered or unexported fields
}

func (Rectangle) Area

func (r Rectangle) Area() float64

type TestCase

type TestCase struct {
	Name     string      `json:"name,omitempty" db:"name"`
	Input    interface{} `json:"input" db:"input"`
	Expected interface{} `json:"expected" db:"expected"`
	// contains filtered or unexported fields
}

Struct demonstration

func (*TestCase) Run

func (tc *TestCase) Run(t *testing.T)

Method declaration

type TestError

type TestError struct {
	// contains filtered or unexported fields
}

Custom error type

func (*TestError) Error

func (e *TestError) Error() string

type TestFunction

type TestFunction func(*testing.T)

Function type

type TestPointer

type TestPointer *TestCase

Pointer type

type Testable

type Testable interface {
	Test() bool
}

Interface demonstration

type TreeNode

type TreeNode struct {
	// contains filtered or unexported fields
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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