aoc

package
v0.0.0-...-3a8fa55 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Benchmark

func Benchmark(f func(string) (string, string, error), b *testing.B, input string)

Benchmark benchmarks a solver function.

func SplitLines

func SplitLines(input string) []string

SplitLines splits an input to its lines except the last few ones if they are empty

func SplitLinesToInts

func SplitLinesToInts(input string) ([]int, error)

SplitLinesToInts splits input via newlines and then turns said slice into a slice of ints.

func StringsToInts

func StringsToInts(strs []string) ([]int, error)

StringsToInts turns a slice of strings to ints. Returns an error if one of the strings cannot be parsed.

Types

type TestCase

type TestCase struct {
	Details string // what is the testcase testing?
	Input   string
	Result1 string
	Result2 string
	WantErr bool // do we want an error to return?
}

TestCase represents a test case. If Result1 or Result2 are empty, do not test for those. This could be done if they are not literal answers and require a human to read them properly.

func (TestCase) Test

func (tc TestCase) Test(f func(string) (string, string, error), a *assert.Assertions)

Test tests a test case.

Jump to

Keyboard shortcuts

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