Skip to content

Testing Resources

Alen Šiljak edited this page Dec 22, 2022 · 12 revisions

Resources for the test harness.

Existing Suites

ledger2beancount

repository

This is a comprehensive collection of ledger journal samples. A parser should be able to parse all the provided samples correctly. The data files are in the tests subdirectory.

ledger

Ledger-cli contains a test harness.

After building, run ctest.

Ref: Testing With CMake and CTest

hledger

Ledger compatibility test suite contains Ledger tests converted to shelltestrunner format.

Guides

Tools

rexpect

shelltestrunner

Sample syntax:

# Test Ledger
# Multiple tests sample.

# Test 1

$ ledger -f first.ledger bal
>
             -20 EUR  Assets:Bank:MyBank:Checking
              20 EUR  Expenses:Food
--------------------
                   0

# Test 2

$ ledger -f first.ledger reg
>
22-Dec-10 Supermarket           Expenses:Food                20 EUR       20 EUR
                                As:Ban:MyBank:Checking      -20 EUR            0
Clone this wiki locally