RezinaLMS-BackEnd/internal/repository/lms_user_progress_snapshot_test.go
2026-06-18 04:14:34 -07:00

24 lines
514 B
Go

package repository
import "testing"
func TestInt64IDsOrEmptyReturnsEmptySlice(t *testing.T) {
got := int64IDsOrEmpty(nil)
if got == nil {
t.Fatal("expected empty slice, got nil")
}
if len(got) != 0 {
t.Fatalf("expected empty slice, got len=%d", len(got))
}
}
func TestInt64IDsOrEmptyPreservesIDs(t *testing.T) {
got := int64IDsOrEmpty([]int64{10, 20})
if len(got) != 2 {
t.Fatalf("expected 2 ids, got %d", len(got))
}
if got[0] != 10 || got[1] != 20 {
t.Fatalf("unexpected ids: %#v", got)
}
}