aboutsummaryrefslogtreecommitdiff
path: root/src/libutil/tests
AgeCommit message (Collapse)Author
2020-09-16fixup! Add a default value for the settingsregnat
2020-08-31Merge remote-tracking branch 'origin/master' into markdownEelco Dolstra
2020-08-25Fix testsEelco Dolstra
2020-08-24Fix testsEelco Dolstra
2020-07-26libutil/logging: extend `internal-json` logger to make it more machine-readableMaximilian Bosch
The new error-format is pretty nice from a UX point-of-view, however it's fairly hard to parse the output e.g. for editor plugins such as vim-ale[1] that use `nix-instantiate --parse` to determine syntax errors in Nix expression files. This patch extends the `internal-json` logger by adding the fields `line`, `column` and `file` to easily locate an error in a file and the field `raw_msg` which contains the error-message itself without code-lines and additional helpers. An exemplary output may look like this: ``` [nix-shell]$ ./inst/bin/nix-instantiate ~/test.nix --log-format minimal {"action":"msg","column":1,"file":"/home/ma27/test.nix","level":0,"line":4,"raw_msg":"syntax error, unexpected IF, expecting $end","msg":"<full error-msg with code-lines etc>"} ``` [1] https://github.com/dense-analysis/ale
2020-07-06revamp trace code and testBen Burdette
2020-07-02move showTrace to new loggerSettingsBen Burdette
2020-07-01spacingBen Burdette
2020-07-01non-pos trace testBen Burdette
2020-06-30fix tests with the 'from string' changeBen Burdette
2020-06-30Merge branch 'master' into add-traceBen Burdette
2020-06-30invalid pos checkBen Burdette
2020-06-29showTrace flag in loggersBen Burdette
2020-06-25showTrace flag for ErrorInfo; showTrace test.Ben Burdette
2020-06-24add trace test; error formatting refinementsBen Burdette
2020-06-23use plain errPos instead of nixCode; fix testsBen Burdette
2020-06-23re-add Pos origin in testsBen Burdette
2020-06-22with normaltxt, elide yellow color code instead of canceling it; use ↵Ben Burdette
normaltxt on plain_string hintfmt
2020-06-19tidying upBen Burdette
2020-06-19fmt -> hintfmt testBen Burdette
2020-06-19too few, too many argsBen Burdette
2020-06-19add hintfmt testBen Burdette
2020-06-19Merge remote-tracking branch 'upstream/master' into no-hash-type-unknownJohn Ericson
2020-06-19Merge pull request #3669 from gilligan/add-compression-testsEelco Dolstra
Add compression unit tests
2020-06-18Revert the `enum struct` changeJohn Ericson
Not a regular git revert as there have been many merges and things.
2020-06-18Merge branch 'enum-class' into no-hash-type-unknownJohn Ericson
2020-06-18Merge remote-tracking branch 'upstream/master' into enum-classJohn Ericson
2020-06-16Fix logging unit testsTobias Pflug
2020-06-15Merge branch 'errors-phase-2' of https://github.com/bburdette/nixEelco Dolstra
2020-06-12Merge pull request #3670 from gilligan/add-pool-testsEelco Dolstra
Add tests for pool.hh
2020-06-11Merge remote-tracking branch 'upstream/master' into errors-phase-2Ben Burdette
2020-06-10Add tests for pool.hhTobias Pflug
2020-06-08Add compression unit testsTobias Pflug
2020-06-07set verbosity levelsBen Burdette
2020-06-06Add tests for logging.hhTobias Pflug
2020-06-03libutils/hash: remove default encodingzimbatm
This will make it easier to reason about the hash encoding and switch to SRI everywhere where possible.
2020-06-02Remove `hashingWithUnknownAlgoExits`John Ericson
A valid hash type must be provided now. The hash itself can still be invalid, but that doesn't cause an `abort()`.
2020-06-02Merge remote-tracking branch 'upstream/master' into no-hash-type-unknownJohn Ericson
2020-06-02Remove `HashType::Unknown`John Ericson
Instead, `Hash` uses `std::optional<HashType>`. In the future, we may also make `Hash` itself require a known hash type, encoraging people to use `std::optional<Hash>` instead.
2020-06-02src/libutil/tests/lru-cache.cc: Check erase()Eelco Dolstra
Co-authored-by: James Lee <jbit@jbit.net>
2020-05-31Add tests for lru-cache.hhTobias Pflug
2020-05-28Fixing the result of mergeCarlo Nucera
2020-05-27tests/config.cc: add tests for Config::applyConfigAndreas Rammhold
2020-05-27Add unit tests for config.ccAndreas Rammhold
2020-05-27Merge pull request #3621 from gilligan/add-json-testsEelco Dolstra
Add unit tests for "json.hh"
2020-05-27Merge pull request #3625 from gilligan/xml-writer-testsEelco Dolstra
Add unit tests for xml-writer
2020-05-25Add unit tests for xml-writerTobias Pflug
2020-05-25Add unit tests for "json.hh"Tobias Pflug
2020-05-25Add unit tests for hashing functionsTobias Pflug
2020-05-20Add unit testes for url.ccTobias Pflug
This adds tests for - parseURL - percentDecode - decodeQuery