nppilot/rover/src/juju.net.nz/mathex/clip_test.go
Michael Hope afa24fb872 Added mathex and testex packages.
Added a test target.
Switched the PID and anything else possible float32.
Changed TiLimit to be the total contribution.
Added a deadband.
2014-01-14 20:56:42 +01:00

13 lines
235 B
Go

package mathex
import (
tx "juju.net.nz/testex"
"testing"
)
func TestClipf(t *testing.T) {
tx.CheckClosef(t, Clipf(0.7, 0.5, 1.0), 0.7)
tx.CheckClosef(t, Clipf(1.1, 0.5, 1.0), 1.0)
tx.CheckClosef(t, Clipf(0.3, 0.5, 1.0), 0.5)
}