Files
mesh-catalog/modules/mesh-mail-reader/cmd/mesh-mail-reader/copies_test.go
T

34 lines
1.0 KiB
Go

package main
// mesh-mail-reader carries a byte-identical copy of mesh-mail's event shape (novox/hq ADR 0459 §3, issue 1518),
// the way mesh-mail-notifier carries it too (ADR 0378 §9, copies_test.go) and modules/networkmanager's
// uplink-tools carries ifwatchd's own file (ADR 0241): each builds alone, so each holds its own copy, and this
// test holds them to one text.
import (
"bytes"
"os"
"path/filepath"
"testing"
)
// source is where mesh-mail's own copy of the file lives.
var source = filepath.Join("..", "..", "..", "mesh-mail", "cmd", "mesh-mail")
// 1518/AC1.
func TestCarriesTheSameMailEventAsMeshMail(t *testing.T) {
for _, f := range []string{"mailevent.go"} {
mine, err := os.ReadFile(f)
if err != nil {
t.Fatal(err)
}
theirs, err := os.ReadFile(filepath.Join(source, f))
if err != nil {
t.Fatalf("mesh-mail's copy of %s could not be read: %v", f, err)
}
if !bytes.Equal(mine, theirs) {
t.Errorf("1518/AC1: this copy of %s differs from mesh-mail's: change both together", f)
}
}
}