Parse package names with a period
All checks were successful
Build / audit (push) Successful in 9s
Build / test (push) Successful in 14m10s

This commit is contained in:
2024-11-27 22:41:03 +01:00
parent 468852410e
commit 15cf346c61
2 changed files with 48 additions and 2 deletions

View File

@ -72,6 +72,50 @@ spec = do
it "accepts an empty downloads list" $
parseInfoFile' `shouldSucceedOn` infoDownload0
it "parses a package name with a dot" $
let given =
"PRGNAM=\"pkgnam.yaml\"\n\
\VERSION=\"1.2.3\"\n\
\HOMEPAGE=\"homepage\"\n\
\DOWNLOAD=\"https://dlackware.com/download.tar.gz\"\n\
\MD5SUM=\"0102030405060708090a0b0c0d0e0f10\"\n\
\DOWNLOAD_x86_64=\"\"\n\
\MD5SUM_x86_64=\"\"\n\
\REQUIRES=\"\"\n\
\MAINTAINER=\"Z\"\n\
\EMAIL=\"test@example.com\"\n"
in parseInfoFile' `shouldSucceedOn` given
it "parses to downloads in a single line" $
let given =
"PRGNAM=\"pkgnam.yaml\"\n\
\VERSION=\"1.2.3\"\n\
\HOMEPAGE=\"homepage\"\n\
\DOWNLOAD=\"https://dlackware.com/download1.tar.gz https://dlackware.com/download2.tar.gz\"\n\
\MD5SUM=\"0102030405060708090a0b0c0d0e0f10 0102030405060708090a0b0c0d0e0f11\"\n\
\DOWNLOAD_x86_64=\"\"\n\
\MD5SUM_x86_64=\"\"\n\
\REQUIRES=\"\"\n\
\MAINTAINER=\"Z\"\n\
\EMAIL=\"test@example.com\"\n"
in parseInfoFile' `shouldSucceedOn` given
it "parses downloads continuing on the next line" $
let given =
"PRGNAM=\"pkgnam.yaml\"\n\
\VERSION=\"1.2.3\"\n\
\HOMEPAGE=\"homepage\"\n\
\DOWNLOAD=\"https://dlackware.com/download1.tar.gz \\\n\
\ https://dlackware.com/download2.tar.gz\"\n\
\MD5SUM=\"0102030405060708090a0b0c0d0e0f10 \\\n\
\ 0102030405060708090a0b0c0d0e0f11\"\n\
\DOWNLOAD_x86_64=\"\"\n\
\MD5SUM_x86_64=\"\"\n\
\REQUIRES=\"\"\n\
\MAINTAINER=\"Z\"\n\
\EMAIL=\"test@example.com\"\n"
in parseInfoFile' `shouldSucceedOn` given
describe "generate" $ do
it "generates an .info file without downloads" $
let given = PackageInfo "pkgnam" "1.2.3" "homepage" [] [] [] [] [] "Z" "test@example.com"