summaryrefslogtreecommitdiff
path: root/tests-clar/config/read.c
Commit message (Collapse)AuthorAgeFilesLines
* Rename tests-clar to testsBen Straub2013-11-141-569/+0
|
* Add negative test cases for config header with invalid charactersLinquize2013-10-011-0/+22
|
* Add test case to test ']' and '\\' characters in config subsectionLinquize2013-10-011-0/+7
|
* config: fix variable overridingCarlos Martín Nieto2013-09-071-0/+15
| | | | | When two or more variables of the same name exist and the user asks for a scalar, we must return the latest value assign to it.
* config: introduce a regex-filtering iteratorCarlos Martín Nieto2013-08-121-0/+33
|
* config: introduce _iterator_new()Carlos Martín Nieto2013-08-121-0/+30
| | | | As the name suggests, it iterates over all the entries
* Parse config headers with quoted quotesEdward Thomson2013-08-071-5/+16
| | | | | Parse config headers that have the last quote on the line quoted instead of walking off the end.
* repo: unconditionally create a global config backendCarlos Martín Nieto2013-05-071-7/+0
| | | | | | | | | | | | | When a repository is initialised, we need to probe to see if there is a global config to load. If this is not the case, the user isn't able to write to the global config without creating the backend and adding it themselves, which is inconvenient and overly complex. Unconditionally create and add a backend for the global config file regardless of whether it exists as a convenience for users. To enable this, we allow creating backends to files that do not exist yet, changing the semantics somewhat, and making some tests invalid.
* Use cl_assert_equal_s() instead of strcmp().Sebastian Bauer2013-01-251-1/+1
| | | | | Replaced all cl_assert(!strcmp()) or semantically equivalent forms by cl_assert_equal_s().
* Proper cleanup jeezVicent Marti2013-01-031-5/+7
|
* Move test cleanup into cleanup functionsBen Straub2013-01-031-1/+5
|
* Cleanup after testsBen Straub2013-01-031-0/+1
|
* Fix a couple of warningsMichael Schubert2012-11-181-1/+0
|
* config: Opening a nonexistent file returns ENOTFOUNDnulltoken2012-11-171-0/+20
|
* config: return an emtpy string when there is no valueCarlos Martín Nieto2012-11-131-1/+3
| | | | | | | | | | | | | Returning NULL for the string when we haven't signaled an error condition is counter-intuitive and causes unnecessary edge cases. Return an empty string when asking for a string value for a configuration variable such as '[section] var' to avoid these edge cases. If the distinction between no value and an empty value is needed, this can be retrieved from the entry directly. As a side-effect, this change stops the int parsing functions from segfaulting on such a variable.
* config: distinguish between a lone variable name and one without rhsCarlos Martín Nieto2012-11-131-0/+6
| | | | | | '[section] variable' and '[section] variable =' behave differently when parsed as booleans, so we need to store that distinction internally.
* config: rename get_config_entry -> config_entryCarlos Martín Nieto2012-11-131-1/+1
| | | | | We're already in the git_config namespace, there is no need to repeat it.
* Add config level support in the config APIyorah2012-10-231-31/+143
| | | | | | | Added `struct git_config_entry`: a git_config_entry contains the key, the value, and the config file level from which a config element was found. Added `git_config_open_level`: build a single-level focused config object from a multi-level one. We are now storing `git_config_entry`s in the khash of the config_file
* Fix config parser boundary logicRussell Belfer2012-08-121-0/+16
| | | | | | The config file parser was not working right if there was no whitespace between the value name and the equals sign. This fixes that.
* Update iterators for consistency across libraryRussell Belfer2012-08-031-1/+1
| | | | | | | | | | | | | | | | | This updates all the `foreach()` type functions across the library that take callbacks from the user to have a consistent behavior. The rules are: * A callback terminates the loop by returning any non-zero value * Once the callback returns non-zero, it will not be called again (i.e. the loop stops all iteration regardless of state) * If the callback returns non-zero, the parent fn returns GIT_EUSER * Although the parent returns GIT_EUSER, no error will be set in the library and `giterr_last()` will return NULL if called. This commit makes those changes across the library and adds tests for most of the iteration APIs to make sure that they follow the above rules.
* Adding git_config_foreach_match() iteration fnRussell Belfer2012-07-101-0/+75
| | | | | | | | | | | | | | Adding a new config iteration function that let's you iterate over just the config entries that match a particular regular expression. The old foreach becomes a simple use of this with an empty pattern. This also fixes an apparent bug in the existing `git_config_foreach` where returning a non-zero value from the iteration callback was not correctly aborting the iteration and the returned value was not being propogated back to the caller of foreach. Added to tests to cover all these changes.
* global: Fix unit tests after reorderingVicent Martí2012-05-181-26/+26
|
* Update test suiteVicent Martí2012-05-021-6/+6
|
* Merge branch 'new-error-handling' into developmentVicent Martí2012-05-021-0/+12
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: .travis.yml include/git2/diff.h src/config_file.c src/diff.c src/diff_output.c src/mwindow.c src/path.c tests-clar/clar_helpers.c tests-clar/object/tree/frompath.c tests/t00-core.c tests/t03-objwrite.c tests/t08-tag.c tests/t10-refs.c tests/t12-repo.c tests/t18-status.c tests/test_helpers.c tests/test_main.c
| * config: also allow escaping outside of a quoted stringCarlos Martín Nieto2012-04-251-0/+12
| | | | | | | | This limitation was a misparsing of the documentation.
* | Discovered cl_git_strequal! Mounted a crusade!Ben Straub2012-03-311-6/+6
|/
* Rename the Clay test suite to ClarVicent Martí2012-01-241-0/+209
Clay is the name of a programming language on the makings, and we want to avoid confusions. Sorry for the huge diff!