NGLess-1.4.0: Tests-Src/Tests/NGLessAPI.hs
{-# LANGUAGE TemplateHaskell, OverloadedStrings, TupleSections #-}
module Tests.NGLessAPI
( tgroup_NGLessAPI
) where
import Test.Tasty.TH
import Test.Tasty.HUnit
import Language
import NGLess
import Tests.Utils
tgroup_NGLessAPI = $(testGroupGenerator)
case_lookupStringError = isError (lookupStringOrScriptError "test" "no" [("yes", NGOString "test")])
case_lookupStringOk = isOk "lookup failed" (lookupStringOrScriptError "test" "yes" [("yes", NGOString "test")])
case_lookupStringDefOk = isOk "default failed" (lookupStringOrScriptErrorDef (return "ok") "test" "not" [("yes", NGOString "test")])