mirror of
https://github.com/foo-dogsquared/nixos-config.git
synced 2025-01-31 04:58:01 +00:00
bahaghari/tests/lib: init hex subset
This commit is contained in:
parent
e8bdb850bc
commit
b7ac964082
@ -4,6 +4,7 @@ let
|
|||||||
lib = import ../../lib { inherit pkgs; };
|
lib = import ../../lib { inherit pkgs; };
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
|
hex = import ./hex.nix { inherit pkgs lib; };
|
||||||
trivial = import ./trivial { inherit pkgs lib; };
|
trivial = import ./trivial { inherit pkgs lib; };
|
||||||
tinted-theming = import ./tinted-theming { inherit pkgs lib; };
|
tinted-theming = import ./tinted-theming { inherit pkgs lib; };
|
||||||
}
|
}
|
||||||
|
30
subprojects/bahaghari/tests/lib/hex.nix
Normal file
30
subprojects/bahaghari/tests/lib/hex.nix
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
{ pkgs, lib }:
|
||||||
|
|
||||||
|
pkgs.lib.runTests {
|
||||||
|
# Even though this is basically borrowing from nixpkgs', we still to test
|
||||||
|
# them for consistency.
|
||||||
|
testConvertToHex1 = {
|
||||||
|
expr = lib.hex.toHexString 534;
|
||||||
|
expected = "216";
|
||||||
|
};
|
||||||
|
|
||||||
|
testConvertToHex2 = {
|
||||||
|
expr = lib.hex.toHexString 864954;
|
||||||
|
expected = "D32BA";
|
||||||
|
};
|
||||||
|
|
||||||
|
testConvertToHex3 = {
|
||||||
|
expr = lib.hex.toHexString 293454837;
|
||||||
|
expected = "117DC3F5";
|
||||||
|
};
|
||||||
|
|
||||||
|
testCreateHexRange = {
|
||||||
|
expr = lib.hex.range 10 17;
|
||||||
|
expected = [ "A" "B" "C" "D" "E" "F" "10" "11" ];
|
||||||
|
};
|
||||||
|
|
||||||
|
testCreateHexWithHigherStart = {
|
||||||
|
expr = lib.hex.range 49 17;
|
||||||
|
expected = [ ];
|
||||||
|
};
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user