summaryrefslogtreecommitdiffstats
path: root/src/options_test.go
diff options
context:
space:
mode:
authorJunegunn Choi <junegunn.c@gmail.com>2015-10-09 12:16:47 +0900
committerJunegunn Choi <junegunn.c@gmail.com>2015-10-09 12:16:47 +0900
commita4eb3323dafcb290ed68f6a70327bfc3b5e39f29 (patch)
tree0314fc462d470e1b718057bf8e2663ebb2a22ebf /src/options_test.go
parent1da065e50e2b1270bec1f62f46daf6e84e9ca991 (diff)
Fix #370 - Panic when trying to set colors when colors are disabled
Diffstat (limited to 'src/options_test.go')
-rw-r--r--src/options_test.go12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/options_test.go b/src/options_test.go
index 1f96f785..1e9ede4e 100644
--- a/src/options_test.go
+++ b/src/options_test.go
@@ -316,3 +316,15 @@ func TestColorSpec(t *testing.T) {
t.Errorf("using default colors")
}
}
+
+func TestParseNilTheme(t *testing.T) {
+ var theme *curses.ColorTheme
+ newTheme := parseTheme(theme, "prompt:12")
+ if newTheme != nil {
+ t.Errorf("color is disabled. keep it that way.")
+ }
+ newTheme = parseTheme(theme, "prompt:12,dark,prompt:13")
+ if newTheme.Prompt != 13 {
+ t.Errorf("color should now be enabled and customized")
+ }
+}