add validation error type, fix tests, add number tests

This commit is contained in:
Aneurin Barker Snook
2023-11-19 20:27:33 +00:00
parent d94f155714
commit 7f3dc0c79d
5 changed files with 25 additions and 10 deletions
+5 -2
View File
@@ -1,6 +1,9 @@
package qs
import "testing"
import (
"errors"
"testing"
)
func TestReadPagination(t *testing.T) {
type TestCase struct {
@@ -34,7 +37,7 @@ func TestReadPagination(t *testing.T) {
pag, err := ReadStringPagination(tc.Input, tc.Opt)
if err != tc.Err {
if !errors.Is(err, tc.Err) {
t.Errorf("Expected error %v, got %v", tc.Err, err)
continue
}