aboutsummaryrefslogtreecommitdiff
path: root/lib/ini/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/
2023-11-12lib/ini: append variable into section before any empty linesShulhan
Previously, appending a new variable into section always create an empty line before after the variable. For example, given the following section, [a] k = v [c] append "k2=v2" to section "a" will result [a] k = v k2=v [c] This changes fix this by appending variable only after non-empty lines, which result to [a] k = v k2= v [c] While at it, add empty space before variable value.
2022-07-27lib/ini: fix parsing and saving multi line variablesShulhan
Previously, if INI file contains multi line variables, for example key = a \ b The Get and saved value is "a \tb", where it should be "a b" for Get and "a \\\n\t\b" again when saved. This changes require refactoring how the variable's value is parsed and stored. A variable value is parsed and stored from character after "=" until new line or comment as raw value, and the real value is derived by trimming white spaces, handle escaped character and double quotes.
2022-07-25lib/test: truncate the last new line at the end of input and outputShulhan
Given the following input and output, >>> input <<< output EOF The input and output content always have new line at the end. This may cause unexpected input or output. If input or output content expecting new line at the end, add two empty lines at the end of it.
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-23lib/ini: convert the Get test using test.DataShulhan
2022-07-22lib/ini: refactoring test to use test.DataShulhan
2018-05-11[test] Add testdata for duplicate section and multiline variableShulhan
2018-05-10Refactor parser using bytes.ReaderShulhan
Previous benchmark result (22dcd07 Move buffer to reader), BenchmarkParse-2 500 19534400 ns/op 4656335 B/op 81163 allocs/op New benchmark result, BenchmarkParse-2 20000 71120 ns/op 35368 B/op 549 allocs/op
2018-05-08[test] TestOpen: add test for variable without sectionShulhan
2018-05-08Add getter methodShulhan
2018-05-08Add library for reading and writing INI file formatShulhan
Package ini implement reading and writing INI configuration as defined by Git configuration file syntax [1]. [1] https://git-scm.com/docs/git-config#_configuration_file