1
0
mirror of https://github.com/pocketbase/pocketbase.git synced 2025-12-08 02:52:38 +02:00

initial public commit

This commit is contained in:
Gani Georgiev
2022-07-07 00:19:05 +03:00
commit 3d07f0211d
484 changed files with 92412 additions and 0 deletions

View File

@@ -0,0 +1,30 @@
package validators_test
import (
"testing"
"github.com/pocketbase/pocketbase/forms/validators"
)
func TestCompare(t *testing.T) {
scenarios := []struct {
valA string
valB string
expectError bool
}{
{"", "", false},
{"", "456", true},
{"123", "", true},
{"123", "456", true},
{"123", "123", false},
}
for i, s := range scenarios {
err := validators.Compare(s.valA)(s.valB)
hasErr := err != nil
if hasErr != s.expectError {
t.Errorf("(%d) Expected hasErr to be %v, got %v (%v)", i, s.expectError, hasErr, err)
}
}
}