summaryrefslogtreecommitdiff
path: root/internal/gtserror/multi_test.go
diff options
context:
space:
mode:
authorLibravatar kim <89579420+NyaaaWhatsUpDoc@users.noreply.github.com>2023-08-04 12:28:33 +0100
committerLibravatar GitHub <noreply@github.com>2023-08-04 12:28:33 +0100
commit9a291dea843448f78b4b98ea6813739aebe708c6 (patch)
treef1ce643a3c9fe1b13e4c107f15b1ac4b20fe5b86 /internal/gtserror/multi_test.go
parent[feature] simpler cache size configuration (#2051) (diff)
downloadgotosocial-9a291dea843448f78b4b98ea6813739aebe708c6.tar.xz
[performance] add caching of status fave, boost of, in reply to ID lists (#2060)
Diffstat (limited to 'internal/gtserror/multi_test.go')
-rw-r--r--internal/gtserror/multi_test.go18
1 files changed, 9 insertions, 9 deletions
diff --git a/internal/gtserror/multi_test.go b/internal/gtserror/multi_test.go
index 9c16c1a53..10c342415 100644
--- a/internal/gtserror/multi_test.go
+++ b/internal/gtserror/multi_test.go
@@ -15,22 +15,22 @@
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
-package gtserror
+package gtserror_test
import (
"errors"
"testing"
"github.com/superseriousbusiness/gotosocial/internal/db"
+ "github.com/superseriousbusiness/gotosocial/internal/gtserror"
)
func TestMultiError(t *testing.T) {
- errs := MultiError{
- e: []error{
- db.ErrNoEntries,
- errors.New("oopsie woopsie we did a fucky wucky etc"),
- },
- }
+ errs := gtserror.MultiError([]error{
+ db.ErrNoEntries,
+ errors.New("oopsie woopsie we did a fucky wucky etc"),
+ })
+
errs.Appendf("appended + wrapped error: %w", db.ErrAlreadyExists)
err := errs.Combine()
@@ -50,14 +50,14 @@ func TestMultiError(t *testing.T) {
errString := err.Error()
expected := `sql: no rows in result set
oopsie woopsie we did a fucky wucky etc
-appended + wrapped error: already exists`
+TestMultiError: appended + wrapped error: already exists`
if errString != expected {
t.Errorf("errString '%s' should be '%s'", errString, expected)
}
}
func TestMultiErrorEmpty(t *testing.T) {
- err := new(MultiError).Combine()
+ err := new(gtserror.MultiError).Combine()
if err != nil {
t.Errorf("should be nil")
}