aboutsummaryrefslogtreecommitdiffhomepage
path: root/fish_tests.cpp
diff options
context:
space:
mode:
authorGravatar ridiculousfish <corydoras@ridiculousfish.com>2012-02-12 18:05:59 -0800
committerGravatar ridiculousfish <corydoras@ridiculousfish.com>2012-02-12 18:05:59 -0800
commit0a4c72e78b929237711717508746390e666f3811 (patch)
treeffd97850c2ffc47b1f27158e3a5459ee23c23ce0 /fish_tests.cpp
parentd66700a0e4d20a9193ea83490781c0858d98c3f6 (diff)
Added color.h, color.cpp. Got term256 colors working.
Diffstat (limited to 'fish_tests.cpp')
-rw-r--r--fish_tests.cpp19
1 files changed, 18 insertions, 1 deletions
diff --git a/fish_tests.cpp b/fish_tests.cpp
index 06f5e6e4..f206cd83 100644
--- a/fish_tests.cpp
+++ b/fish_tests.cpp
@@ -670,12 +670,28 @@ static void test_path()
wcstring path = L"//foo//////bar/";
wcstring canon = path;
path_make_canonical(canon);
- if( canon != L"/foo/bar" ) )
+ if( canon != L"/foo/bar" )
{
err( L"Bug in canonical PATH code" );
}
}
+/** Testing colors */
+static void test_colors()
+{
+ say(L"Testing colors");
+ assert(rgb_color_t(L"#FF00A0").is_rgb());
+ assert(rgb_color_t(L"FF00A0").is_rgb());
+ assert(rgb_color_t(L"#F30").is_rgb());
+ assert(rgb_color_t(L"F30").is_rgb());
+ assert(rgb_color_t(L"f30").is_rgb());
+ assert(rgb_color_t(L"#FF30a5").is_rgb());
+ assert(rgb_color_t(L"3f30").is_none());
+ assert(rgb_color_t(L"##f30").is_none());
+ assert(rgb_color_t(L"magenta").is_named());
+ assert(rgb_color_t(L"MaGeNTa").is_named());
+ assert(rgb_color_t(L"mooganta").is_none());
+}
/**
@@ -808,6 +824,7 @@ int main( int argc, char **argv )
test_lru();
test_expand();
test_path();
+ test_colors();
test_history();
say( L"Encountered %d errors in low-level tests", err_count );