A library to simplify writing golang tests that act on files and directories.
This library was written to help simplify testing for
go-fio's cmp
module. Many of the commands are specifically
for the go-fio
module.
This library implements common script commands:
-
mkfile: Make a file or dir in the test dir; usage:
mkfile [options] name [name...]
The optional arguments are:
-m X | --min-file-size X Make files at least as big X -M Y | --max-file-size Y Make files no bigger than Y -d | --dir Make directories instead of files -t WhERE | --target WhERE Make dirs in 'lhs', 'rhs' or 'both
-
touch: Sync the timestamps of all dirs and files to be the same. The time of start of test is used as the singular reference timestamp.
-
mutate: modify one or more files
mutate name [name ...]
-
symlink: make one or more symlinks in lhs or rhs or both
symlink lhs="newname@oldname new2@old2" rhs="newname@oldname"
Where
lhs=
andrhs=
denote the target where this is made
Take a look at go-fio/cmp; this module extends
the commands by adding the expect
command:
- Implements the
testrunnner.Cmd
interface - Register the command with testrunner by calling
testrunner.RegisterCommand()
from ainit()
function.
GPL v2.0