snapshot

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2019 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

type Cache struct {
	Filepath   string
	Existed    bool
	IsUpdating bool
	// contains filtered or unexported fields
}

Cache manage snapshot caching

func CreateSnapshotOfSuite

func CreateSnapshotOfSuite(path string, isUpdating bool) (*Cache, error)

CreateSnapshotOfSuite retruns snapshot.Cache for suite file, create `__snapshot__` dir if not existed

func (*Cache) Changed

func (s *Cache) Changed() bool

Changed check if content have changed according to all Compare called

func (*Cache) Compare

func (s *Cache) Compare(test string, idx uint, content interface{}) *CompareResult

Compare compare content to cached last time, return CompareResult

func (*Cache) CurrentCount

func (s *Cache) CurrentCount() uint

CurrentCount return total snapshot count of current time

func (*Cache) FailedCount

func (s *Cache) FailedCount() uint

FailedCount return snapshot count that was failed when Compare

func (*Cache) InsertedCount

func (s *Cache) InsertedCount() uint

InsertedCount return snapshot count that was newly inserted current time

func (*Cache) RestoreFromFile

func (s *Cache) RestoreFromFile() error

RestoreFromFile restore cached snapshot from cache file

func (*Cache) StoreToFileIfNeeded

func (s *Cache) StoreToFileIfNeeded() (bool, error)

StoreToFileIfNeeded store current cache to file if snapshot content changed

func (*Cache) UpdatedCount

func (s *Cache) UpdatedCount() uint

UpdatedCount return snapshot count that was cached before and updated current time

func (*Cache) VanishedCount

func (s *Cache) VanishedCount() uint

VanishedCount return snapshot count that was cached last time but not exists this time

type CompareResult

type CompareResult struct {
	Passed         bool
	Test           string
	Index          uint
	NewSnapshot    string
	CachedSnapshot string
}

CompareResult result return by Cache.Compare

Jump to

Keyboard shortcuts

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