debug

package
v0.4.2 Latest Latest
Warning

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

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

Documentation

Overview

Package debug provides an API to add breakpoints to the test to debug its execution.

The functions defined in this package must only be used for local debugging and require that the test be run in Debug Mode. If a breakpoint is reached when not in debug mode, the test will fail there and then. Therefore, no tests with breakpoints should be committed to any persistent repository

To insert a simple breakpoint in your code, use:

ondatra.Debug().Breakpoint(t)

For more informative breakpoints, the Debug.Breakpoint and Debug.Breakpoint functions allow you to include custom text in the breakpoint message:

ondatra.Debug().Breakpoint(t, "this should be unreachable")
ondatra.Debug().Breakpointf(t, "myVar has value %v", myVar)

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Debug

type Debug struct{}

Debug is the Ondatra debug API.

func (*Debug) Breakpoint

func (d *Debug) Breakpoint(t *testing.T, a ...any)

Breakpoint inserts a breakpoint in the test and prints fmt.Sprint(a...) in the breakpoint message.

func (*Debug) Breakpointf

func (d *Debug) Breakpointf(t *testing.T, format string, a ...any)

Breakpointf inserts a breakpoint in the test and prints fmt.Sprintf(a...) in the breakpoint message.

Jump to

Keyboard shortcuts

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