mirror of
https://gitlab.com/rensa-nix/devshell.git
synced 2025-12-11 22:00:08 +01:00
chore: initial commit
This commit is contained in:
commit
fbacfc149b
21 changed files with 748 additions and 0 deletions
53
tests/devshell_test.nix
Normal file
53
tests/devshell_test.nix
Normal file
|
|
@ -0,0 +1,53 @@
|
|||
{
|
||||
pkgs,
|
||||
ntlib,
|
||||
devshell,
|
||||
...
|
||||
}: {
|
||||
suites."Devshell Tests" = {
|
||||
pos = __curPos;
|
||||
tests = [
|
||||
{
|
||||
name = "basic";
|
||||
type = "script";
|
||||
script = let
|
||||
shell = devshell.mkShell {};
|
||||
in
|
||||
# sh
|
||||
''
|
||||
${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.scriptHelpers}
|
||||
assert_file_contains ${shell}/env.bash "HELLO" "should contain HELLO"
|
||||
assert_file_contains ${shell}/env.bash "world" "should contain world"
|
||||
'';
|
||||
}
|
||||
];
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue