-
-
Notifications
You must be signed in to change notification settings - Fork 86
Expand file tree
/
Copy pathtests.nix
More file actions
63 lines (59 loc) · 1.23 KB
/
tests.nix
File metadata and controls
63 lines (59 loc) · 1.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# Tests for flake-compat
# Run with:
# nix-unit ./tests.nix
# or: nix build ./dev#checks.<system>.nix-unit
{
# Test that the main function can be imported
testImport = {
expr = builtins.isFunction (import ./default.nix);
expected = true;
};
# Test that calling with minimal arguments produces an attrset
testBasicCall =
let
result = import ./default.nix {
src = ./.;
system = "x86_64-linux";
};
in
{
expr = builtins.isAttrs result;
expected = true;
};
# Test that result has expected attributes
testHasOutputs =
let
result = import ./default.nix {
src = ./.;
system = "x86_64-linux";
};
in
{
expr = result ? outputs;
expected = true;
};
# Test that result has defaultNix
testHasDefaultNix =
let
result = import ./default.nix {
src = ./.;
system = "x86_64-linux";
};
in
{
expr = result ? defaultNix;
expected = true;
};
# Test that result has shellNix
testHasShellNix =
let
result = import ./default.nix {
src = ./.;
system = "x86_64-linux";
};
in
{
expr = result ? shellNix;
expected = true;
};
}