mirror of
https://github.com/gotenberg/gotenberg.git
synced 2026-08-12 18:32:14 +01:00
huge refactoring
This commit is contained in:
32
internal/pkg/xassert/float64_test.go
Normal file
32
internal/pkg/xassert/float64_test.go
Normal 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)
|
||||
}
|
||||
Reference in New Issue
Block a user