Add more QoL and high prio features
This commit is contained in:
@@ -1,6 +1,9 @@
|
||||
package main
|
||||
|
||||
import "testing"
|
||||
import (
|
||||
"strings"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestApplyThemeChangesAllRenderingThemes(t *testing.T) {
|
||||
defer func() {
|
||||
@@ -18,3 +21,14 @@ func TestApplyThemeChangesAllRenderingThemes(t *testing.T) {
|
||||
t.Fatal("unknown theme was accepted")
|
||||
}
|
||||
}
|
||||
|
||||
func TestNoColorThemeDisablesSyntaxColors(t *testing.T) {
|
||||
defer applyTheme("dark")
|
||||
if err := applyTheme("no-color"); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
rendered := highlightedSource("go", "func main() {}")
|
||||
if strings.Contains(rendered, "\x1b[") || colorEnabled {
|
||||
t.Fatalf("no-color source contains terminal colors: %q", rendered)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user