Skip to end of metadata
Go to start of metadata

If you would like to make an extensive test suite more structured, rather than having all the checks in one flat expected file, i.e. you want to run test once, but check many well-structured suites of test cases.

Now, instead of file, you can have a directory called expected.

For example, suppose, you have a test called big-test:

> tree big-test/
├── expected
│   ├── address
│   │   └── check_city
│   └── check_temperature
└── test

with the files looking like this:

> cat big-test/test
echo city=sydney
echo temperature=25
> cat big-test/expected/address/check_city 
> cat big-test/expected/check_temperature 

When you run the test, the conditions in check_city and check_temperature will be checked:

> cd big-test
> comma-test-run
comma-test-run: 1 test[s] in subdirectories of /home/seva/src/comma/big-test: running...
comma-test-run: test 1 of 1: .: started...
comma-test-run: test 1 of 1: .: running...
Test output does not match expected:
expected output:
comma-test-run: .: failed
comma-test-run: 1 test[s] in subdirectories of /home/seva/src/comma/big-test: 1 test[s] out of 1 failed
  • No labels