aboutsummaryrefslogtreecommitdiff
path: root/test/functions
diff options
context:
space:
mode:
authorDominik Ritter <dritter03@googlemail.com>2018-08-10 01:47:20 +0300
committerDominik Ritter <dritter03@googlemail.com>2018-08-10 01:47:20 +0300
commit7a1319c2d98da16e0b2bd32dd43f9660a74ed8d7 (patch)
tree73eb40f986f8592236f78f0bccc79cf3f1abb961 /test/functions
parent6daef84c603e3f00058a90c511efc37c1e4bd5cc (diff)
Add tests for color comparisons with none colors
Diffstat (limited to 'test/functions')
-rwxr-xr-xtest/functions/colors.spec16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/functions/colors.spec b/test/functions/colors.spec
index e9ae9803..ce777913 100755
--- a/test/functions/colors.spec
+++ b/test/functions/colors.spec
@@ -22,6 +22,10 @@ function testGetColorCodeWithNumericalColor() {
assertEquals '002' "$(getColorCode '002')"
}
+function testGetColorCodeWithNoneColor() {
+ assertEquals 'none' "$(getColorCode 'NONE')"
+}
+
function testIsSameColorComparesAnsiForegroundAndNumericalColorCorrectly() {
assertTrue "isSameColor 'green' '002'"
}
@@ -38,6 +42,18 @@ function testIsSameColorDoesNotYieldNotEqualColorsTruthy() {
assertFalse "isSameColor 'green' '003'"
}
+function testIsSameColorHandlesNoneCorrectly() {
+ assertTrue "isSameColor 'none' 'NOnE'"
+}
+
+function testIsSameColorCompareTwoNoneColorsCorrectly() {
+ assertTrue "isSameColor 'none' 'none'"
+}
+
+function testIsSameColorComparesColorWithNoneCorrectly() {
+ assertFalse "isSameColor 'green' 'none'"
+}
+
function testBrightColorsWork() {
# We had some code in the past that equalized bright colors
# with normal ones. This code is now gone, and this test should