Contributing Tests
The tests
folder contains functional tests in the form of .vd
scripts, each of which records a session of VisiData commands. These ensure that data processing works consistently and reliably.
dev/test.sh
(run from the git root) will execute all tests. The final sheet of each test is saved as .tsv and compared to the respective expected output checked into the tests/golden
directory.
As of January 2024, to pass all the tests, you will need to install the test
extras:
git clone https://github.com/saulpw/visidata.git cd visidata pip3 install ".[test]"
To show each step of a test with a delay of 1 second between commands:
$ bin/vd -p tests/foo.vd -w 1
To build a .vd
file:
Go through all of the steps of the workflow, ending on the sheet with the final result.
Press
Shift+D
to view theCommandLog Sheet
.Edit the commandlog to minimize the number of commands. Cells may be parameterized like
{foo}
, to be specified on the commandline:$ vd cmdlog.vd --foo=value
Save the cmdlog:
Press
Shift+D
to open thecommanDlog Sheet
, and pressCtrl+S
to save it with a.vd
suffix.
There are also unit tests in visidata/tests. To run the unit tests:
pytest -sv visidata/tests