testing

package
v0.2.19 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2024 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CompareOutputWithFixture

func CompareOutputWithFixture(t *testing.T, testerOutput []byte, normalizeOutputFunc func([]byte) []byte, fixturePath string)

func TestTesterOutput

func TestTesterOutput(t *testing.T, testerDefinition tester_definition.TesterDefinition, testCases map[string]TesterOutputTestCase)

func ValidateTesterDefinitionAgainstYAML

func ValidateTesterDefinitionAgainstYAML(t testing.T, testerDefinition tester_definition.TesterDefinition, yamlPath string)

ValidateTesterDefinitionAgainstYAML tests whether the stage slugs in TesterDefintion match those in the course YAML at yamlPath.

Types

type TesterOutputTestCase

type TesterOutputTestCase struct {
	// CodePath is the path to the code that'll be tested.
	CodePath string

	// ExpectedExitCode is the exit code that we expect the tester to return.
	ExpectedExitCode int

	// UntilStageSlug is the slug of the stage that we want to test until. Either this or StageSlug must be provided.
	UntilStageSlug string

	// SkipAntiCheat is a flag that indicates whether we want to skip the anti-cheat check.
	SkipAntiCheat *bool

	// StageSlugs is the list of stages that we want to test. Either this or UntilStageSlug must be provided.
	StageSlugs []string

	// StdoutFixturePath is the path to the fixture file that contains the expected stdout output.
	StdoutFixturePath string

	// NormalizeOutputFunc is a function that normalizes the tester's output. This is useful for removing things like timestamps.
	NormalizeOutputFunc func([]byte) []byte
}

Jump to

Keyboard shortcuts

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