elmman/tests/Tests.elm

32 lines
1.1 KiB
Elm
Raw Normal View History

2017-06-18 05:14:38 +00:00
module Tests exposing (..)
import Test exposing (..)
import Expect
2017-06-26 21:46:57 +00:00
import AnimationHelpers exposing (calculateAnimation)
2017-06-18 05:14:38 +00:00
all : Test
all =
2017-06-26 21:46:57 +00:00
describe "Elmman Test Suite"
[ describe "Player logic tests"
[ test "Animation frame calculations" <|
2017-06-18 05:14:38 +00:00
\() ->
2017-06-26 21:46:57 +00:00
Expect.equal (calculateAnimation 100 500 ( 0, 200 )) 40
, test "Animation frame calculations 2" <|
2017-06-18 05:14:38 +00:00
\() ->
2017-06-26 21:46:57 +00:00
Expect.equal (calculateAnimation 500 500 ( 0, 200 )) 200
, test "Animation frame calculations 3" <|
2017-06-18 05:14:38 +00:00
\() ->
2017-06-26 21:46:57 +00:00
Expect.equal (calculateAnimation 501 500 ( 0, 200 )) 0
, test "Animation frame calculations 4" <|
\() ->
Expect.equal (calculateAnimation 500 500 ( 100, 300 )) 300
, test "Animation frame calculations 5" <|
\() ->
Expect.equal (calculateAnimation 100 500 ( 100, 300 )) 140
, test "Animation frame calculations 6" <|
\() ->
Expect.equal (calculateAnimation 100 500 ( -100, 100 )) -60
2017-06-18 05:14:38 +00:00
]
]