add nix-unit tests
This commit is contained in:
parent
e31dc6dea8
commit
14f30ce5d7
2 changed files with 129 additions and 0 deletions
47
tests/default.nix
Normal file
47
tests/default.nix
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
let
|
||||
bootstrap = import ../nt/primitives/bootstrap;
|
||||
|
||||
nt = import ../nt {
|
||||
mix = import ../nt/mix {
|
||||
this = bootstrap;
|
||||
};
|
||||
# flake.nix passes `flake = inputs.self`
|
||||
flake = builtins.getFlake ../.;
|
||||
};
|
||||
|
||||
dummyTest = {
|
||||
expr = 1;
|
||||
expected = 1;
|
||||
};
|
||||
in {
|
||||
testPass = dummyTest;
|
||||
|
||||
testMaybe = let
|
||||
maybe-mod = import ./maybe.nix {this = bootstrap;};
|
||||
|
||||
inherit
|
||||
(maybe-mod)
|
||||
Maybe
|
||||
Some
|
||||
None
|
||||
;
|
||||
in {
|
||||
expr = Some true;
|
||||
expected = {
|
||||
_''traps''_ = {
|
||||
_'nt = {
|
||||
derive = ["nt::&Maybe"];
|
||||
instance = true;
|
||||
ops = {
|
||||
"nt::&Maybe" = {
|
||||
unwrap = f: self: f self.${bootstrap.ntDynamicTrapdoorKey}.value;
|
||||
};
|
||||
};
|
||||
req = {};
|
||||
sig = "nt::Some";
|
||||
};
|
||||
_'ntDyn = {value = true;};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue