aboutsummaryrefslogtreecommitdiff
path: root/lib/ini/variable_test.go
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/
2024-03-02all: move the repository to "git.sr.ht/~shulhan/pakakeh.go"Shulhan
There are several reasons that why we move from github.com. First, related to the name of package. We accidentally name the package with "share" a common word in English that does not reflect the content of repository. By moving to other repository, we can rename it to better and unique name, in this "pakakeh.go". Pakakeh is Minang word for tools, and ".go" suffix indicate that the repository related to Go programming language. Second, supporting open source. The new repository is hosted under sourcehut.org, the founder is known to support open source, and all their services are licensed under AGPL, unlike GitHub that are closed sources. Third, regarding GitHub CoPilot. The GitHub Terms of Service [1], allow any public content that are hosted there granted them to parse the content. On one side, GitHub helps and flourish the open source, but on another side have an issues regarding scraping the copyleft license [2]. [1]: https://docs.github.com/en/site-policy/github-terms/github-terms-of-service#4-license-grant-to-us [2]: https://githubcopilotinvestigation.com
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-26lib/ini: parse comment as part of formatShulhan
Previously, the comment is parsed and stored separately. This changes make the comment as part of format.
2021-03-14all: refactoring the test.Assert and test.AssertBench signatureShulhan
Previously, the test.Assert and test.AssertBench functions has the boolean parameter to print the stack trace of test in case its not equal. Since this parameter is not mandatory and its usually always set to "true", we remove them from function signature to simplify the call to Assert and AssertBench.
2020-05-16ini: fix inconsistencies between empty string and boolean trueShulhan
In Git specification, an empty variable is equal to boolean true. This cause inconsistency between empty string and boolean true. This changes make the empty value become an empty string instead of boolean true.
2019-05-26ini: escape the variable value when printing with StringShulhan
If the variable is quoted, the value must be escaped so the following character are allowed: '\b', '\n', '\t', '\\', and '\"'.
2019-05-26ini: remove unused cases in variable's StringShulhan
The lineModeSection and lineModeSubsection on variable's String switch cases is previously used to print section and/or subsection before the section is moved to its own type.
2019-05-25ini: rename varModeXXX to lineModeXXXShulhan
This is the second part of refactoring to provide clean and readable code.
2019-05-25ini: unexport Variable and SectionShulhan
This is the first part to refactoring ini package to provide a clean and simple API.
2018-09-26lib/ini: move IsValueBoolTrue as common functionShulhan
2018-06-02variable: add method to check if value is boolean and trueShulhan
2018-05-13Replace field type in Section and Variable from []byte to stringShulhan
2018-05-13Export variable key and valueShulhan
2018-05-12Add copyright and license informationShulhan
2018-05-11variable: fix stringer on mode empty, comment, and subsectionShulhan