mirror of
https://github.com/wasp-lang/wasp.git
synced 2024-11-24 03:35:17 +03:00
22 lines
839 B
Haskell
22 lines
839 B
Haskell
module Parser.ExternalCodeTest where
|
|
|
|
import Test.Tasty.Hspec
|
|
|
|
import Data.Either (isLeft)
|
|
import qualified Path.Posix as PPosix
|
|
|
|
import Parser.Common (runWaspParser)
|
|
import Parser.ExternalCode (extCodeFilePathString)
|
|
import qualified StrongPath as SP
|
|
|
|
|
|
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 (SP.fromPathRelFileP [PPosix.relfile|foo/bar.txt|])
|
|
|
|
it "When path does not start with @ext/, returns Left" $ do
|
|
isLeft (runWaspParser extCodeFilePathString "\"@ext2/foo/bar.txt\"") `shouldBe` True
|