module Test.App.Stuff ( tests ) where

import Test.Hspec

import App.Stuff

tests :: IO ()
tests = hspec $ do
  describe "Stuff.digits" $ do
    it "returns list of digits inside number" $ do
      digits 123490 `shouldBe` [1,2,3,4,9,0]
    it "returns list of digits inside number" $ do
      digits 13490 `shouldBe` [1,3,4,9,0]
  describe "Stuff.delFirstMeet" $ do
    it "should delete only first meeted symbol" $ do
      delFirstMeet ( 3 :: Integer ) [1,2,3,4,3] `shouldBe` [1,2,4,3]
  describe "Stuff.countFreq" $ do
    it "should return right values" $ do
      countFreq ( 3 :: Int ) [1,2,3,3,4,3] `shouldBe` ( 3 :: Int )
    it "should return 0 if list not contain this value" $ do
      countFreq ( 0 :: Int ) [1,2,3,3,4,3] `shouldBe` ( 0 :: Int )
    it "should return 0 for empty list" $ do
      countFreq ( 6 :: Int ) [] `shouldBe` ( 0 :: Int )
