Files
sanspie 2fcbaa6c12 Stage 11g1: the editor in Russian (D348)
engine/i18n with catalogs, plural forms and module catalogs; tools/i18n extract and check; the editor UI, menus, panels and notices in Russian with the author's terms; overflow test and tooltip wrapping; the English log.
2026-10-25 15:31:22 +03:00

25 lines
578 B
Go

package prefs
import (
"os"
"path/filepath"
"testing"
"aego/ui/theme"
)
func TestSaveLoad(t *testing.T) {
dir := t.TempDir()
if p, err := Load(dir); err != nil || p.Theme != theme.ModeSystem {
t.Fatalf("a missing file loads %v, %v; want System", p.Theme, err)
}
if err := Save(dir, &Prefs{Theme: theme.ModeLight, Language: "ru"}); err != nil {
t.Fatal(err)
}
data, _ := os.ReadFile(filepath.Join(dir, File))
p, err := Load(dir)
if err != nil || p.Theme != theme.ModeLight || p.Language != "ru" {
t.Fatalf("loaded %v, %v from:\n%s", p.Theme, err, data)
}
}