module Niv.Test (tests, test) where

import qualified Niv.Git.Test as Git
import Niv.GitHub.Test
import Niv.Sources.Test
import Niv.Update.Test
import qualified Test.Tasty as Tasty
import qualified Test.Tasty.HUnit as Tasty

test :: IO ()
test :: IO ()
test = TestTree -> IO ()
Tasty.defaultMain TestTree
tests

tests :: Tasty.TestTree
tests :: TestTree
tests =
  TestName -> [TestTree] -> TestTree
Tasty.testGroup
    TestName
"niv"
    [ TestName -> [TestTree] -> TestTree
Tasty.testGroup
        TestName
"update"
        [ TestName -> IO () -> TestTree
Tasty.testCase TestName
"simply runs" IO ()
simplyRuns,
          TestName -> IO () -> TestTree
Tasty.testCase TestName
"picks first" IO ()
picksFirst,
          TestName -> IO () -> TestTree
Tasty.testCase TestName
"loads" IO ()
loads,
          TestName -> IO () -> TestTree
Tasty.testCase TestName
"survives checks" IO ()
survivesChecks,
          TestName -> IO () -> TestTree
Tasty.testCase TestName
"isn't too eager" IO ()
isNotTooEager,
          TestName -> IO () -> TestTree
Tasty.testCase TestName
"dirty forces update" IO ()
dirtyForcesUpdate,
          TestName -> IO () -> TestTree
Tasty.testCase TestName
"should run when no changes" IO ()
shouldNotRunWhenNoChanges,
          TestName -> IO () -> TestTree
Tasty.testCase TestName
"templates expand" IO ()
templatesExpand
        ],
      TestName -> [TestTree] -> TestTree
Tasty.testGroup
        TestName
"github"
        [ TestName -> IO () -> TestTree
Tasty.testCase TestName
"inits properly" IO ()
test_githubInitsProperly,
          TestName -> IO () -> TestTree
Tasty.testCase TestName
"updates" IO ()
test_githubUpdates,
          TestName -> IO () -> TestTree
Tasty.testCase TestName
"updates once" IO ()
test_githubUpdatesOnce,
          TestName -> IO () -> TestTree
Tasty.testCase TestName
"doesn't override rev" IO ()
test_githubDoesntOverrideRev,
          TestName -> IO () -> TestTree
Tasty.testCase TestName
"falls back to URL" IO ()
test_githubURLFallback
        ],
      TestName -> [TestTree] -> TestTree
Tasty.testGroup
        TestName
"sources.nix"
        [ TestName -> IO () -> TestTree
Tasty.testCase TestName
"has latest version" IO ()
test_shippedSourcesNixIsLatest
        ],
      TestName -> [TestTree] -> TestTree
Tasty.testGroup TestName
"git" [TestTree]
Git.tests
    ]