chore: establish local platform baseline
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
package privacy
|
||||
|
||||
import "testing"
|
||||
|
||||
func TestFilterInventoryUsesRequestedCategories(t *testing.T) {
|
||||
counts := map[string]int64{"profile": 1, "conversations": 3, "memories": 2}
|
||||
filtered := filterInventory(counts, map[string]any{"categories": []any{"profile", "memories", "unknown", 12}})
|
||||
if len(filtered) != 2 || filtered["profile"] != 1 || filtered["memories"] != 2 {
|
||||
t.Fatalf("filtered inventory = %#v", filtered)
|
||||
}
|
||||
if _, exists := filtered["conversations"]; exists {
|
||||
t.Fatal("unrequested category must not be returned")
|
||||
}
|
||||
}
|
||||
|
||||
func TestFilterInventoryDefaultsToAllCategories(t *testing.T) {
|
||||
counts := map[string]int64{"profile": 1, "conversations": 3}
|
||||
filtered := filterInventory(counts, map[string]any{})
|
||||
if len(filtered) != len(counts) || filtered["conversations"] != 3 {
|
||||
t.Fatalf("default inventory = %#v", filtered)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user