liblouis: Translation Table Test Harness
1
1 5.1 Translation Table Test Harness
1 ==================================
1
1 Each harness file is a simple UTF8 encoded json file, which has two
1 entries.
1 'tables'
1 A list containing table names, which the tests should be run
1 against. This is usually just one table, but for some situations
1 more than one table is required.
1 'tests'
1 A list of sections of tests, which should be processed
1 independently. Each test section is a dictionary of two items.
1 'flags'
1 The flags that apply for all the test cases in this section. For
1 example, they could all be forward translation tests, or they
1 should all be run as computer braille tests.
1
1 'data'
1 A list of test cases, each one containing the specific test data
1 needed to perform a test.
1
1 These are the valid fields for the flags section:
1 'comment'
1 A field describing the reason for the tests, the transformation
1 rule or any useful info that might be needed in case the test
1 breaks (optional).
1 'cursorPos'
1 The position of the cursor within the given text (optional).
1 Useful when simulating screenreader interaction, to debug
1 contraction and cursor behavior.
1 'mode'
1 The liblouis translation mode that should be used for this test
1 (optional). If not defined defaults to 0.
1 'outputUniBrl'
1 For a forward translation test, the output should be in Unicode
1 braille. For a backward translation test, the input is in Unicode
1 braille.
1 'testmode'
1 The optional testmode field can have three values: "translate"
1 (default if undeclared), "backtranslate" or "hyphenate". Declares
1 what tests should be performed on the test data.
1
1 Each test case has the following entries:
1
1 'input'
1 The Unicode text to be tested (required).
1 'output'
1 The expected braille output (required). The dots should be encoded
1 in the liblouis ASCII-braille like encoding.
1 'brlCursorPos'
1 The expected position of the braille cursor in the braille output
1 (optional). Useful when simulating screenreader interaction, to
1 debug contraction and cursor behavior.
1
1 Variables defined in the flags section can be overridden by
1 individual test cases, but if several tests need the same options, they
1 should ideally be split into their own section, complete with their own
1 flags and data.
1
1 For examples please see '*_harness.txt' in the harness directory in
1 the source distribution.
1