Skip to content

About

Testing large outputs of ordinary exercises

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Latest commit

 

History

104 Commits

Folders and files

Repository files navigation

Go Reference Go Report Card codecov

Build Status Build status Go

Some ordinary exercises using modules

  • Binedit : Produce a copy of a file named "data.bin" that does not fit in memory, while deleting every seventh byte.

  • Modulo37 : Output numbers following some rules. The module outputs sequentially the integers from 1 to 99.

  • Sumofconverts : Convert a set of strings which contains numbers. It returns the sum of the items representing numbers and skips others. A recursive and non-recursive version are benchmarked.

More documentation in each package.

Testing

An ordinary exercise may have a large output for which the easy // Output: becomes unreadable. In this case, output of reduced set of data to a file for which content can be evaluated is more convenient. It is usable even without access to the original code.

Piping Stdout to a file is easier. A helper to compare the file to a reference file. Comparison is done using module github.com/iwdgo/testingfiles which returns errors usable by the testing package.

The original code for piping output is from the commit history of golang.go/src/testing/example.go was using unexported routines. It is adapted to these cases.

About

Testing large outputs of ordinary exercises

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages