mirror of
https://github.com/wasp-lang/wasp.git
synced 2024-12-25 18:13:52 +03:00
20 lines
599 B
Haskell
20 lines
599 B
Haskell
module AnalyzerTest where
|
|
|
|
import Analyzer
|
|
import Analyzer.StdTypeDefinitions (App (..), AuthMethod (..))
|
|
import Test.Tasty.Hspec
|
|
|
|
spec_Analyzer :: Spec
|
|
spec_Analyzer = do
|
|
describe "Analyzer" $ do
|
|
it "Analyzes a well-typed example" $ do
|
|
let source =
|
|
unlines
|
|
[ "app Todo {",
|
|
" title: \"Todo App\",",
|
|
" authMethod: EmailAndPassword,",
|
|
"}"
|
|
]
|
|
let expectedApps = [("Todo", App {title = "Todo App", authMethod = EmailAndPassword})]
|
|
takeDecls <$> analyze source `shouldBe` Right expectedApps
|