mirror of
https://github.com/gotenberg/gotenberg.git
synced 2026-08-09 17:12:14 +01:00
huge refactoring
This commit is contained in:
20
internal/pkg/xassert/string_test.go
Normal file
20
internal/pkg/xassert/string_test.go
Normal file
@@ -0,0 +1,20 @@
|
||||
package xassert
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/thecodingmachine/gotenberg/test/internalpkg/xerrortest"
|
||||
)
|
||||
|
||||
func TestStringOfOne(t *testing.T) {
|
||||
rule := StringOneOf([]string{"foo", "bar", "baz"})
|
||||
// should be OK.
|
||||
rule.with("FOO", "foo")
|
||||
err := rule.validate()
|
||||
assert.Nil(t, err)
|
||||
// should not be OK.
|
||||
rule.with("FOO", "qux")
|
||||
err = rule.validate()
|
||||
xerrortest.AssertError(t, err)
|
||||
}
|
||||
Reference in New Issue
Block a user