about summary refs log tree commit diff
path: root/lib/tests/misc.nix
Commit message (Collapse)AuthorAge
* Merge pull request #83241 from Infinisil/valid-drv-nameSilvan Mosberger2020-04-02
|\ | | | | lib/strings: Add `sanitizeDerivationName` function
| * lib/strings: Add sanitizeDerivationName functionSilvan Mosberger2020-03-30
| |
* | lib/generators: Add toINI option for duplicate keysSilvan Mosberger2020-03-10
| |
* | lib/tests/misc.nix: Fix dependency on currentSystemEelco Dolstra2020-02-10
|/ | | | This doesn't work in pure mode.
* lib/cli,lib/tests/misc: somewhat more standard formattingProfpatsch2020-01-23
|
* lib/cli: encodeGNUCommandLine -> toGNUCommandLineShellProfpatsch2020-01-23
| | | | | | | | | | | | | | The semantic difference between `encode` and `to` is not apparent. Users are likely to confuse both functions (which leads to unexpected error messages about the wrong types). Like in `generators.nix`, all functions should be prefixed by `to`. Furthermore, converting to a string depends on the target context. In this case, it’s a POSIX shell, so we should name it that (compare `escapeShellArg` in `strings.nix`). We can later add versions that escape for embedding in e.g. python scripts or similar.
* Factor out a `toGNUCommandLine` utilityGabriel Gonzalez2020-01-05
| | | | ... as suggested by @roberth
* Use a more realistic example that exercises all encodingsGabriel Gonzalez2019-12-15
| | | | | | ... as suggested by @roberth This also caught a bug in rendering lists, which this change also fixes
* Make behavior of `encodeGNUCommandLine` customizableGabriel Gonzalez2019-12-13
| | | | ... based on feedback from @edolstra
* Rename `renderOptions` to `encodeGNUCommandLine`Gabriel Gonzalez2019-12-13
| | | | ... as suggested by @edolstra
* Add `pkgs.lib.renderOptions`Gabriel Gonzalez2019-12-11
| | | | | | This adds a new utility to intelligently convert Nix records to command line options to reduce boilerplate for simple use cases and to also reduce the likelihood of malformed command lines
* lib/trivial: add `pipe` functionProfpatsch2019-10-21
| | | | | | | | | | | | | | | | | | | | | | | | | | `pipe` is a useful operator for creating pipelines of functions. It works around the usual problem of e.g. string operations becoming deeply nested functions. In principle, there are four different ways this function could be written: pipe val [ f1 .. fn ] pipe val [ fn .. f1 ] compose [ f1 .. fn ] val compose [ fn .. f1 ] val The third and fourth form mirror composition of functions, they would be the same as e.g. `(f1 << f2 << f3 .. << fn) val`. However, it is not clear which direction the list should have (as one can see in the second form, which is the most absurd. In order not to confuse users, we decide for the most “intuitive” form, which mirrors the way unix pipes work (thus the name `pipe`). The flow of data goes from left to right. Co-Authored-By: Silvan Mosberger <infinisil@icloud.com>
* lib: basic tests for lib.versionsJoachim Fasting2019-09-26
|
* Remove composableDerivation, closes #18763Frederik Rietdijk2018-12-30
|
* lib.isStorePath: fix `false` result when passed a path objectTim Cuthbertson2018-10-20
| | | | | Since `isStorePath` relies on comparing against builtins.storeDir (a string), we need to convert the input into a string as well.
* generators: make toPretty handle floats correctlyLéo Gaspard2018-10-15
|
* lib/tests: Add overrideExisting testsSilvan Mosberger2018-09-17
|
* Merge branch 'no-toPath'Shea Levy2018-09-06
|\
| * treewide: Remove uses of builtins.toPath.Shea Levy2018-05-22
| | | | | | | | | | | | | | | | toPath has confusing semantics and is never necessary; it can always either just be omitted or replaced by pre-concatenating `/.`. It has been marked as "!!! obsolete?" for more than 10 years in a C++ comment, hopefully removing it will let us properly deprecate and, eventually, remove it.
* | lib/recursiveUpdateUntil: add a test & release note for fixProfpatsch2018-08-15
| |
* | [bot]: remove unreferenced codevolth2018-07-20
| |
* | lib: bitAnd, bitOr, bitXor (bitsize-agnostic fallback function) (#41491)volth2018-06-10
| | | | | | | | | | | | | | | | | | | | | | | | * lib: bitAnd, bitOr, bitXor * lib: test for bitAnd, bitOr, bitXor * lib: bitsize-agnostic zipIntBits * lib: bitNot * lib: bitNot
* | Revert "lib: bitAnd, bitOr, bitXor"Profpatsch2018-06-05
| |
* | lib: test for bitAnd, bitOr, bitXorvolth2018-06-02
|/
* lib/generators: print paths without quotes & move function downProfpatsch2018-04-25
|
* lib/generators: introduce a sane default for `mkValueString`Profpatsch2018-03-29
| | | | | | | | | So far, `mkValueString` defaulted to `toString`, which is a bad match for most configuration file formats, especially because how booleans are formatted. This also improves error messages for unsupported types. Add a test to codify the formatting.
* lib.isStorePath: Fix derivation detectionShea Levy2018-03-09
|
* lib/generators: add mkValueString to mkKeyValueDefault generatorProfpatsch2017-11-22
| | | | | | | | This means the generation of values can now be influenced, even down from e.g. an INI generator. Breaks the interface of `mkKeyValueDefault` to match its interface to other generator functions. It might me sensible to rename `mkKeyValue` and `mkKeyValueSet` to conform to the `toX`-style of generator functions.
* lib/generators: put more information in toPretty lambdasProfpatsch2017-06-22
| | | | | | With `builtins.functionArgs` we can get some information if the first argument is an attrset and whether the contained fields have default values. Encode that into the pretty-printed lambda.
* lib/generators: toPrettyProfpatsch2017-06-22
| | | | `toPretty` implements a pretty printer for nix values.
* lib-tests: fix test for isStorePathDaiderd Jordan2017-06-09
|
* Add `isStorePath` tests (#26223)Profpatsch2017-05-30
|
* lib: Consolidate tests into one meta jobJohn Ericson2017-05-17