It requires x11-display, names itself in TERMINAL, and contributes its X resources to the xresources slot normal: today's palette and clipboard keys, JetBrainsMono Nerd Font, 10000 lines of scrollback, all scoped to XTerm* instead of every Xt program. It owns no file. The tools are the seat's open, which starts a terminal through the account's service manager so it outlives the runtime's restarts, and font (in force, what fontconfig resolves it to, set for new terminals) and colours.
43 lines
1.2 KiB
Go
43 lines
1.2 KiB
Go
package desktop
|
|
|
|
import (
|
|
"bytes"
|
|
"os"
|
|
"path/filepath"
|
|
"testing"
|
|
)
|
|
|
|
// The desktop modules that carry this package. Each builds alone, so each has its own copy; this
|
|
// test, itself one of the copied files, holds them to one text wherever the siblings are present.
|
|
var carriers = []string{"xorg", "lemurs", "i3", "xterm", "adwaita"}
|
|
|
|
func TestEveryDesktopModuleCarriesTheSameCopy(t *testing.T) {
|
|
mine, err := filepath.Glob("*.go")
|
|
if err != nil || len(mine) == 0 {
|
|
t.Fatal("no files of this package found", err)
|
|
}
|
|
compared := 0
|
|
for _, module := range carriers {
|
|
dir := filepath.Join("..", "..", "..", module, "internal", "desktop")
|
|
if _, err := os.Stat(dir); err != nil {
|
|
continue
|
|
}
|
|
theirs, _ := filepath.Glob(filepath.Join(dir, "*.go"))
|
|
if len(theirs) != len(mine) {
|
|
t.Errorf("%s carries %d files of this package, this copy %d", module, len(theirs), len(mine))
|
|
continue
|
|
}
|
|
for _, f := range mine {
|
|
a, _ := os.ReadFile(f)
|
|
b, err := os.ReadFile(filepath.Join(dir, f))
|
|
if err != nil || !bytes.Equal(a, b) {
|
|
t.Errorf("%s's copy of %s differs from this one: change every copy together", module, f)
|
|
}
|
|
}
|
|
compared++
|
|
}
|
|
if compared == 0 {
|
|
t.Log("no sibling copies beside this module")
|
|
}
|
|
}
|