mirror of
https://github.com/wasp-lang/wasp.git
synced 2024-11-24 11:44:51 +03:00
21 lines
688 B
Haskell
21 lines
688 B
Haskell
module Parser.ExternalCodeTest where
|
|
|
|
import Test.Tasty.Hspec
|
|
|
|
import Data.Either (isLeft)
|
|
import Path (relfile)
|
|
|
|
import Parser.ExternalCode (extCodeFilePathString)
|
|
import Parser.Common (runWaspParser)
|
|
|
|
|
|
spec_ParserExternalCode :: Spec
|
|
spec_ParserExternalCode = do
|
|
describe "Parsing external code file path string" $ do
|
|
it "Correctly parses external code path in double quotes" $ do
|
|
runWaspParser extCodeFilePathString "\"@ext/foo/bar.txt\""
|
|
`shouldBe` Right [relfile|foo/bar.txt|]
|
|
|
|
it "When path does not start with @ext/, returns Left" $ do
|
|
isLeft (runWaspParser extCodeFilePathString "\"@ext2/foo/bar.txt\"") `shouldBe` True
|