// Copyright 2022 The Gogs Authors. All rights reserved.// Use of this source code is governed by a MIT-style// license that can be found in the LICENSE file.packagedbimport("testing""github.com/stretchr/testify/require""gogs.io/gogs/internal/dbtest")funcTestWatches(t*testing.T){iftesting.Short(){t.Skip()}t.Parallel()tables:=[]interface{}{new(Watch)}db:=&watches{DB:dbtest.NewDB(t,"watches",tables...),}for_,tc:=range[]struct{namestringtestfunc(t*testing.T,db*watches)}{{"ListByRepo",watchesListByRepo},}{t.Run(tc.name,func(t*testing.T){t.Cleanup(func(){err:=clearTables(t,db.DB,tables...)require.NoError(t,err)})tc.test(t,db)})ift.Failed(){break}}}funcwatchesListByRepo(_*testing.T,_*watches){// TODO: Add tests once WatchRepo is migrated to GORM.}