remove mkDots test, no longer necessary
This commit is contained in:
parent
ac731ee4a0
commit
cbee241685
|
@ -6,14 +6,11 @@ module Nix.Expr.Shorthands where
|
|||
|
||||
import Prelude
|
||||
import Data.Monoid
|
||||
import Data.Text (Text, unpack)
|
||||
import Data.Text (Text)
|
||||
import Data.Fix
|
||||
import qualified Data.Map as Map
|
||||
import Nix.Atoms
|
||||
import Nix.Parser.Library (reservedNames)
|
||||
import Nix.Expr.Types
|
||||
import Text.Regex.TDFA.Text ()
|
||||
import Text.Regex.TDFA ((=~))
|
||||
|
||||
-- | Make an integer literal expression.
|
||||
mkInt :: Integer -> NExpr
|
||||
|
|
|
@ -1,39 +0,0 @@
|
|||
{-# LANGUAGE TemplateHaskell, OverloadedStrings #-}
|
||||
module ShorthandTests (tests) where
|
||||
|
||||
import Prelude
|
||||
|
||||
import Test.Tasty
|
||||
import Test.Tasty.HUnit
|
||||
import Test.Tasty.TH
|
||||
|
||||
import Control.Monad (forM_)
|
||||
import Data.Monoid ((<>))
|
||||
import Data.Fix
|
||||
|
||||
import Nix.Expr
|
||||
|
||||
|
||||
case_mkDotsSymbolEscaping :: Assertion
|
||||
case_mkDotsSymbolEscaping = do
|
||||
let check xs errmsg assert =
|
||||
forM_ xs $ \x -> assertBool (errmsg <> ": " <> show x) $ assert x
|
||||
check plain "not a plain value" $ assertIsSingle
|
||||
check nonPlain "not a non-plain value" $ not . assertIsSingle
|
||||
where
|
||||
plain = [ "abc09", "_A_'-", "AbC" ]
|
||||
nonPlain = [ "abc def", "\\", "'abc", "\"", "-foo", "a.b.c" ]
|
||||
assertIsSingle = isPlainSingle . getKey . mkDot "dummy"
|
||||
getKey (Fix (NSelect _ [key] _)) = key
|
||||
getKey _ = error "invalid"
|
||||
isPlainSingle (StaticKey _) = True
|
||||
isPlainSingle (DynamicKey (Plain (DoubleQuoted [Plain _]))) = False
|
||||
isPlainSingle _ = error "invalid"
|
||||
|
||||
|
||||
---------------------------
|
||||
|
||||
tests :: TestTree
|
||||
tests = $(testGroupGenerator)
|
||||
|
||||
|
Loading…
Reference in a new issue