nt/tests/default.nix
Emile Clark-Boman 9db1e24987 export unwrapMaybe, unwrapSome, unwrapNone in tests/maybe.nix
NOTE: nix-unit does NOT handle lambda partial equality well...
2026-01-28 09:15:49 +10:00

44 lines
788 B
Nix

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)
unwrapSome
Some
;
in {
expr = Some true;
expected = {
_''traps''_ = {
_'nt = {
derive = ["nt::&Maybe"];
instance = true;
ops = {
"nt::&Maybe".unwrap = unwrapSome;
};
req = {};
sig = "nt::Some";
};
_'ntDyn = {value = true;};
};
};
};
}