MCPcopy Create free account
hub / github.com/1Password/for-open-source / runValidationTests

Function runValidationTests

script/validator_test.go:14–25  ·  view source on GitHub ↗
(t *testing.T, testCases []validationTestCase, f ValidatorCallback, funcName string)

Source from the content-addressed store, hash-verified

12}
13
14func runValidationTests(t *testing.T, testCases []validationTestCase, f ValidatorCallback, funcName string) {
15 for _, tc := range testCases {
16 pass, value, _ := f(tc.input)
17 if pass != tc.expectedPass {
18 t.Errorf("%s(%s) passing is %v, expected %v", funcName, tc.input, pass, tc.expectedPass)
19 }
20
21 if value != tc.expectedValue {
22 t.Errorf("%s(%s) got new value %v, expected %v", funcName, tc.input, value, tc.expectedValue)
23 }
24 }
25}
26
27func TestParseInput(t *testing.T) {
28 testCases := []validationTestCase{

Callers 8

TestParseInputFunction · 0.85
TestParsePlainStringFunction · 0.85
TestParseAccountUrlFunction · 0.85
TestParseCheckboxFunction · 0.85
TestIsPresentFunction · 0.85
TestIsEmailFunction · 0.85
TestIsUrlFunction · 0.85
TestIsCheckedFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected