huge refactoring

This commit is contained in:
Julien Neuhart
2019-07-23 13:57:18 +02:00
parent f6b357691c
commit 7bfbda4490
105 changed files with 4051 additions and 2667 deletions

View File

@@ -0,0 +1,32 @@
package xassert
import (
"testing"
"github.com/stretchr/testify/assert"
"github.com/thecodingmachine/gotenberg/test/internalpkg/xerrortest"
)
func TestFloat64NotInferiorTo(t *testing.T) {
rule := Float64NotInferiorTo(0.0)
// should be OK.
rule.with("FOO", 10.0)
err := rule.validate()
assert.Nil(t, err)
// should not be OK.
rule.with("FOO", -10.0)
err = rule.validate()
xerrortest.AssertError(t, err)
}
func TestFloat64NotSuperiorTo(t *testing.T) {
rule := Float64NotSuperiorTo(0.0)
// should be OK.
rule.with("FOO", -10.0)
err := rule.validate()
assert.Nil(t, err)
// should not be OK.
rule.with("FOO", 10.0)
err = rule.validate()
xerrortest.AssertError(t, err)
}