<commit_before>{-# LANGUAGE TemplateHaskell #-}
{-| Unittests for constants

-}

{-

Copyright (C) 2013 Google Inc.

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA.

-}

module Test.Ganeti.Constants (testConstants) where

import Test.HUnit (Assertion)
import qualified Test.HUnit as HUnit

import qualified Ganeti.Constants as Constants
import qualified Ganeti.ConstantUtils as ConstantUtils
import qualified Test.Ganeti.TestHelper as TestHelper

case_buildVersion :: Assertion
case_buildVersion = do
  HUnit.assertBool "Config major lower-bound violation"
                   (Constants.configMajor >= 0)
  HUnit.assertBool "Config major upper-bound violation"
                   (Constants.configMajor <= 99)
  HUnit.assertBool "Config minor lower-bound violation"<commit_msg>Disable hlint camelcase on test module<commit_after>{-# LANGUAGE TemplateHaskell #-}
{-| Unittests for constants

-}

{-

Copyright (C) 2013 Google Inc.

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA.

-}

module Test.Ganeti.Constants (testConstants) where

import Test.HUnit (Assertion)
import qualified Test.HUnit as HUnit

import qualified Ganeti.Constants as Constants
import qualified Ganeti.ConstantUtils as ConstantUtils
import qualified Test.Ganeti.TestHelper as TestHelper

{-# ANN module "HLint: ignore Use camelCase" #-}

case_buildVersion :: Assertion
case_buildVersion = do
  HUnit.assertBool "Config major lower-bound violation"
                   (Constants.configMajor >= 0)
  HUnit.assertBool "Config major upper-bound violation"
                   (Constants.configMajor <= 99)
  HUnit.assertBool "Config minor lower-bound violation"
{'fraction_non_alphanumeric': 0.05837651122625216, 'fraction_numerical': 0.013126079447322971, 'mean_word_length': 4.236889692585895, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4206755', 'n_tokens_mistral': 793, 'n_tokens_neox': 739, 'n_words': 358}