21 lines
510 B
Go
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")
|
|
}
|
|
}
|