fscmp

package module
v0.0.0-...-01fd556 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2021 License: MIT Imports: 5 Imported by: 0

README

fscmp

A library to compare fs.FS implementations.

Installation

go get github.com/eddieowens/fscmp

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FileDiff

type FileDiff struct {
	Path  string
	Error error
	Diffs []LineDiff
}

func (FileDiff) String

func (f FileDiff) String() string

type FsDiff

type FsDiff struct {
	Diffs []FileDiff
}

func EqualFilesystems

func EqualFilesystems(expected, actual fs.FS, opts ...Opt) (FsDiff, error)

func (FsDiff) String

func (f FsDiff) String() string

type LineDiff

type LineDiff struct {
	ExpectedContent string
	ActualContent   string
	ExpectedLineNum int
	ActualLineNum   int
}

func (LineDiff) String

func (l LineDiff) String() string

type Opt

type Opt func(o *equalOpts)

func IgnoreFileSpaces

func IgnoreFileSpaces() Opt

func IgnoreLineSpaces

func IgnoreLineSpaces() Opt

type Scanner

type Scanner struct {
	*bufio.Scanner
	LineNum int
}

func NewScanner

func NewScanner(r io.Reader) *Scanner

func (*Scanner) NextNonEmptyLine

func (s *Scanner) NextNonEmptyLine() string

NextNonEmptyLine scans to the next non-empty line. Non-empty is a line that contains text that is not trimmed from strings.TrimSpace

func (*Scanner) Scan

func (s *Scanner) Scan() bool

Jump to

Keyboard shortcuts

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