mirror of
https://github.com/nix-community/nixvim.git
synced 2025-08-01 08:34:41 +02:00
tests: cleanup tests to better use callTest
pattern
e.g. Prefer taking `pkgs.*` attrs directly as function arguments.
This commit is contained in:
parent
4a508ceee2
commit
036e11665f
7 changed files with 33 additions and 20 deletions
|
@ -1,9 +1,10 @@
|
|||
# For shorter test iterations run the following in the root of the repo:
|
||||
# `echo ':b checks.${builtins.currentSystem}.lib-tests' | nix repl .`
|
||||
{
|
||||
lib,
|
||||
pkgs,
|
||||
helpers,
|
||||
lib,
|
||||
runCommandNoCCLocal,
|
||||
writeText,
|
||||
}:
|
||||
let
|
||||
luaNames = {
|
||||
|
@ -45,9 +46,9 @@ let
|
|||
];
|
||||
};
|
||||
|
||||
drv = pkgs.writeText "example-derivation" "hello, world!";
|
||||
drv = writeText "example-derivation" "hello, world!";
|
||||
|
||||
results = pkgs.lib.runTests {
|
||||
results = lib.runTests {
|
||||
testToLuaObject = {
|
||||
expr = helpers.toLuaObject {
|
||||
foo = "bar";
|
||||
|
@ -412,11 +413,11 @@ let
|
|||
};
|
||||
in
|
||||
if results == [ ] then
|
||||
pkgs.runCommand "lib-tests-success" { } "touch $out"
|
||||
runCommandNoCCLocal "lib-tests-success" { } "touch $out"
|
||||
else
|
||||
pkgs.runCommand "lib-tests-failure"
|
||||
runCommandNoCCLocal "lib-tests-failure"
|
||||
{
|
||||
results = pkgs.lib.concatStringsSep "\n" (
|
||||
results = lib.concatStringsSep "\n" (
|
||||
builtins.map (result: ''
|
||||
${result.name}:
|
||||
expected: ${lib.generators.toPretty { } result.expected}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue