Completed event and key libraries.

This commit is contained in:
Jay
2025-10-20 11:00:44 -04:00
parent 0ab4edb45d
commit 2c893f9619
12 changed files with 824 additions and 0 deletions

30
util_test.go Normal file
View File

@@ -0,0 +1,30 @@
package roots
import (
"strings"
"testing"
)
func expectOk(t *testing.T, err error) {
if err != nil {
t.Errorf("got error: %s", err.Error())
}
}
func expectError(t *testing.T, err error) {
if err == nil {
t.Fatal("expected error, got nil")
}
}
func expectErrorSubstring(t *testing.T, err error, expected string) {
if !strings.Contains(err.Error(), expected) {
t.Errorf("error = %q, want substring %q", err.Error(), expected)
}
}
func expectEqualStrings(t *testing.T, got, want string) {
if got != want {
t.Errorf("got %s, want %s", got, want)
}
}