forked from fyne-io/fyne
-
Notifications
You must be signed in to change notification settings - Fork 0
/
animation_test.go
29 lines (23 loc) · 823 Bytes
/
animation_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
package fyne
import (
"testing"
"github.com/stretchr/testify/assert"
)
func TestAnimationLinear(t *testing.T) {
assert.Equal(t, float32(0.25), animationLinear(0.25))
}
func TestAnimationEaseInOut(t *testing.T) {
assert.Equal(t, float32(0.125), animationEaseInOut(0.25))
assert.Equal(t, float32(0.5), animationEaseInOut(0.5))
assert.Equal(t, float32(0.875), animationEaseInOut(0.75))
}
func TestAnimationEaseIn(t *testing.T) {
assert.Equal(t, float32(0.0625), animationEaseIn(0.25))
assert.Equal(t, float32(0.25), animationEaseIn(0.5))
assert.Equal(t, float32(0.5625), animationEaseIn(0.75))
}
func TestAnimationEaseOut(t *testing.T) {
assert.Equal(t, float32(0.4375), animationEaseOut(0.25))
assert.Equal(t, float32(0.75), animationEaseOut(0.5))
assert.Equal(t, float32(0.9375), animationEaseOut(0.75))
}