module LibTest exposing (specs)

import Lib exposing (..)
import Test exposing (..)
import Expect exposing (Expectation)


specs: Test
specs =
    let runCheck ticks lower upper expected =
            let label = (Debug.toString (lower, upper)) ++ " -> " ++ (Debug.toString expected)
            in test label <| \_ ->
                Expect.equal expected (looseLabels ticks lower upper)
    in
        describe "looseLabels"
        [ runCheck 10  0 100  (0.0, 100.0, 10)
        , runCheck 10  2  98  (0.0, 100.0, 10)
        , runCheck 10  8  91  (0.0, 100.0, 10)
        , runCheck  8  1  32  (0, 40, 10)
        , runCheck  8  1  36  (0, 40, 10)
        , runCheck 10  1   4  (1, 4, 0.5)
        ]
