aboutsummaryrefslogtreecommitdiff
path: root/lib/test/testdata
AgeCommit message (Collapse)Author
2026-01-15all: convert license and copyright to use SPDX identifiersShulhan
With help of spdxconv tool [1], we able to bulk update all files license and copyright format to comply with SPDX formats. [1] https://kilabit.info/project/spdxconv/
2022-07-23lib/test: load test data files with suffix "_test.txt"Shulhan
Previously, the LoadDataDir load all files from directory that have ".txt" extension. This may cause unknown non-test data files loaded and may cause an error. To distinguish it with other text files, inside the directory to be loaded load only the file that has suffix "_test.txt".
2022-07-22lib/test: implement Data, a type to load formatted file for helping testShulhan
Data contains predefined input and output values that is loaded from file to be used during test. The data provides zero or more flags, an optional description, zero or more input, and zero or more output. The data file name must end with ".txt". The data content use the following format, [FLAG_KEY ":" FLAG_VALUE LF] [LF DESCRIPTION] ">>>" [INPUT_NAME] LF INPUT_CONTENT LF "<<<" [OUTPUT_NAME] LF OUTPUT_CONTENT The data can contains zero or more flag. A flag is key and value separated by ":". The flag key must not contain spaces. The data may contain description. The line that start with "\n>>>" defined the beginning of input. An input can have a name, if its empty it will be set to "default". An input can be defined multiple times, with different names. The line that start with "\n<<<" defined the beginning of output. An output can have a name, if its empty it will be set to "default". An output also can be defined multiple times, with different names.