package seq

import "github.com/amonks/run/internal/seq"

Package seq provides helpers for asserting that a sequence of strings appears in order within a larger list of lines.

Index

Functions

func AssertContainsSequence

func AssertContainsSequence(t *testing.T, lines []string, seq ...string)

AssertContainsSequence is a test helper that asserts lines contains seq as a clean ordered subsequence.

func AssertStringContainsSequence

func AssertStringContainsSequence(t *testing.T, s string, seq ...string)

AssertStringContainsSequence splits s on newlines and asserts the subsequence.

func ContainsSequence

func ContainsSequence(lines []string, seq ...string) (bool, string)

ContainsSequence reports whether lines contains seq as an ordered subsequence, and that no element of seq appears anywhere in lines outside of the matched positions. It returns true if the subsequence is found cleanly, or false with a descriptive reason otherwise.