bahaghari/tests/lib: add more unit tests

This commit is contained in:
Gabriel Arazas 2024-06-14 23:46:01 +08:00
parent 3e7cc9c7db
commit e119d84731
No known key found for this signature in database
GPG Key ID: 62104B43D00AA360
2 changed files with 15 additions and 0 deletions

View File

@ -56,6 +56,11 @@ lib.runTests {
expected = [ "A" "B" "C" "D" "E" "F" "10" "11" ];
};
testCreateHexRange2 = {
expr = self.hex.range 64 76;
expected = [ "40" "41" "42" "43" "44" "45" "46" "47" "48" "49" "4A" "4B" "4C" ];
};
testCreateHexWithHigherStart = {
expr = self.hex.range 49 17;
expected = [ ];

View File

@ -96,6 +96,16 @@ in lib.runTests {
expected = "173A69";
};
testsToHex3 = {
expr = self.colors.rgb.toHex (RGB {
r = 23;
g = 58;
b = 105;
a = 21;
});
expected = "173A69";
};
testsToHexVariant = {
expr = self.colors.rgb.toHex' (RGB {
r = 255;