mirror of
https://gitlab.com/rensa-nix/devshell.git
synced 2025-12-11 22:00:08 +01:00
55 lines
1.3 KiB
Nix
55 lines
1.3 KiB
Nix
{
|
|
pkgs,
|
|
ntlib,
|
|
devshell,
|
|
...
|
|
}: {
|
|
suites."Devshell Tests" = {
|
|
pos = __curPos;
|
|
tests = [
|
|
{
|
|
name = "basic";
|
|
type = "script";
|
|
script = let
|
|
shell = devshell.mkShell {};
|
|
in
|
|
# sh
|
|
''
|
|
${ntlib.helpers.path [pkgs.gnugrep]}
|
|
${ntlib.helpers.scriptHelpers}
|
|
assert_file_contains ${shell}/env.bash "XDG_DATA_DIRS" "should contain XDG_DATA_DIRS"
|
|
'';
|
|
}
|
|
{
|
|
name = "packages";
|
|
type = "script";
|
|
script = let
|
|
shell = devshell.mkShell {
|
|
packages = [pkgs.hello];
|
|
};
|
|
in
|
|
# sh
|
|
''
|
|
${ntlib.helpers.scriptHelpers}
|
|
assert "-f ${shell}/bin/hello" "/bin/hello should exist"
|
|
'';
|
|
}
|
|
{
|
|
name = "env";
|
|
type = "script";
|
|
script = let
|
|
shell = devshell.mkShell {
|
|
env."HELLO".value = "world";
|
|
};
|
|
in
|
|
# sh
|
|
''
|
|
${ntlib.helpers.path [pkgs.gnugrep]}
|
|
${ntlib.helpers.scriptHelpers}
|
|
assert_file_contains ${shell}/env.bash "HELLO" "should contain HELLO"
|
|
assert_file_contains ${shell}/env.bash "world" "should contain world"
|
|
'';
|
|
}
|
|
];
|
|
};
|
|
}
|