groupware: finalize JMAP events integration test, with multiple changes to the model to conform with draft-ietf-calext-jscalendarbis-10 and fields that are currently not implemented in Stalwart

This commit is contained in:
Pascal Bleser
2025-11-20 11:55:46 +01:00
parent fc9279975d
commit 5570d59ffe
12 changed files with 886 additions and 195 deletions
+16
View File
@@ -224,3 +224,19 @@ func AnyItem[K comparable, V any](m map[K]V, predicate func(K, V) bool) bool {
}
return false
}
func Concat[E any](arys ...[]E) []E {
l := 0
for _, ary := range arys {
l += len(ary)
}
r := make([]E, l)
i := 0
for _, ary := range arys {
if ary != nil {
i += copy(r[i:], ary)
}
}
return r
}
+7
View File
@@ -164,3 +164,10 @@ func TestAnyItem(t *testing.T) {
assert.False(t, AnyItem(map[string]bool{"a": true, "b": false}, never))
assert.False(t, AnyItem(nil, never))
}
func TestConcat(t *testing.T) {
assert.Equal(t, []string{"a", "b", "c", "d", "e", "f"}, Concat([]string{"a", "b"}, []string{"c"}, []string{"d", "e", "f"}))
assert.Equal(t, []string{"a"}, Concat([]string{"a"}))
assert.Equal(t, []string{"a"}, Concat([]string{}, nil, []string{"a"}))
assert.Equal(t, []string{}, Concat[string]())
}