Files
diple/theme_test.go
2026-07-28 09:52:23 +02:00

21 lines
510 B
Go

package main
import "testing"
func TestApplyThemeChangesAllRenderingThemes(t *testing.T) {
defer func() {
if err := applyTheme("dark"); err != nil {
t.Fatal(err)
}
}()
if err := applyTheme("light"); err != nil {
t.Fatal(err)
}
if markdownStyleName != "light" || codeHighlightTheme != "github" {
t.Fatalf("light theme did not propagate: markdown=%q code=%q", markdownStyleName, codeHighlightTheme)
}
if err := applyTheme("unknown"); err == nil {
t.Fatal("unknown theme was accepted")
}
}