Skip to content

Commit

Permalink
SkipIfWindows
Browse files Browse the repository at this point in the history
  • Loading branch information
philderbeast committed Dec 1, 2024
1 parent 13825b0 commit 510e099
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ import Test.Cabal.Prelude
normalizeWindowsOutput :: String -> String
normalizeWindowsOutput = if isWindows then map (\x -> case x of '/' -> '\\'; _ -> x) else id

main = cabalTest . withRepo "repo" . recordMode RecordMarked $ do
main = skipIfWindows "" >>= \_ -> cabalTest . withRepo "repo" . recordMode RecordMarked $ do

Check warning on line 6 in cabal-testsuite/PackageTests/ConditionalAndImport/cabal.test.hs

View workflow job for this annotation

GitHub Actions / hlint

Warning in main in module Main: Use >> ▫︎ Found: "skipIfWindows \"\"\n >>=\n \\ _\n -> cabalTest . withRepo \"repo\" . recordMode RecordMarked\n $ do let log = recordHeader . pure\n cabal \"v2-run\" [\"some-exe\"]\n log \"checking cyclical loopback of a project importing itself\"\n cyclical0 <- fails\n $ cabal' \"v2-build\" [\"--project-file=cyclical-0-self.project\"]\n assertOutputContains\n \"cyclical import of cyclical-0-self.project\" cyclical0\n log \"checking cyclical with hops; out and back\"\n cyclical1a <- fails\n $ cabal' \"v2-build\" [\"--project-file=cyclical-1-out-back.project\"]\n assertOutputContains\n \"cyclical import of cyclical-1-out-back.project\" cyclical1a\n log\n \"checking cyclical with hops; out to a config that imports itself\"\n cyclical1b <- fails\n $ cabal' \"v2-build\" [\"--project-file=cyclical-1-out-self.project\"]\n assertOutputContains\n \"cyclical import of cyclical-1-out-self.config\" cyclical1b\n log \"checking cyclical with hops; out, out, twice back\"\n cyclical2a <- fails\n $ cabal'\n \"v2-build\"\n [\"--project-file=cyclical-2-out-out-backback.project\"]\n assertOutputContains\n \"cyclical import of cyclical-2-out-out-backback.project\" cyclical2a\n log \"checking cyclical with hops; out, out, once back\"\n cyclical2b <- fails\n $ cabal'\n \"v2-build\" [\"--project-file=cyclical-2-out-out-back.project\"]\n assertOutputContains\n \"cyclical import of cyclical-2-out-out-back-a.config\" cyclical2b\n log\n \"checking cyclical with hops; out, out to a config that imports itself\"\n cyclical2c <- fails\n $ cabal'\n \"v2-build\" [\"--project-file=cyclical-2-out-out-self.project\"]\n assertOutputContains\n \"cyclical import of cyclical-2-out-out-self-b.config\" cyclical2c\n log\n \"checking that cyclical check doesn't false-positive on same file names in different folders; hoping within a folder and then into a subfolder\"\n cyclical3b <- cabal'\n \"v2-build\" [\"--project-file=noncyclical-same-filename-a.project\"]\n assertOutputDoesNotContain \"cyclical import of\" cyclical3b\n log\n \"checking that cyclical check doesn't false-positive on same file names in different folders; hoping into a subfolder and then back out again\"\n cyclical3c <- cabal'\n \"v2-build\" [\"--project-file=noncyclical-same-filename-b.project\"]\n assertOutputDoesNotContain \"cyclical import of\" cyclical3c\n log\n \"checking that cyclical check catches a same file name that imports itself\"\n cyclical4a <- fails\n $ cabal'\n \"v2-build\"\n [\"--project-file=cyclical-same-filename-out-out-self.project\"]\n assertOutputContains\n (normalizeWindowsOutput\n \"cyclical import of same-filename/cyclical-same-filename-out-out-self.config\")\n cyclical4a\n log\n \"checking that cyclical check catches importing its importer (with the same file name)\"\n cyclical4b <- fails\n $ cabal'\n \"v2-build\"\n [\"--project-file=cyclical-same-filename-out-out-backback.project\"]\n assertOutputContains\n \"cyclical import of cyclical-same-filename-out-out-backback.project\"\n cyclical4b\n log\n \"checking that cyclical check catches importing its importer's importer (hopping over same file names)\"\n cyclical4c <- fails\n $ cabal'\n \"v2-build\"\n [\"--project-file=cyclical-same-filename-out-out-back.project\"]\n assertOutputContains\n \"cyclical import of cyclical-same-filename-out-out-back.config\"\n cyclical4c\n log\n \"checking that imports work skipping into a subfolder and then back out again and again\"\n hopping <- cabal' \"v2-build\" [\"--project-file=hops-0.project\"]\n assertOutputContains\n \"Configuration is affected by the following files\" hopping\n assertOutputContains \"- hops-0.project\" hopping\n assertOutputContains\n (normalizeWindowsOutput\n \"- hops-2.config \\\n \\ imported by: hops/hops-1.config \\\n \\ imported by: hops-0.project\")\n hopping\n assertOutputContains\n (normalizeWindowsOutput\n \"- hops-4.config \\\n \\ imported by: hops/hops-3.config \\\n \\ imported by: hops-2.config \\\n \\ imported by: hops/hops-1.config \\\n \\ imported by: hops-0.project\")\n hopping\n assertOutputContains\n (normalizeWi

let log = recordHeader . pure

cabal "v2-run" [ "some-exe" ]
Expand Down

0 comments on commit 510e099

Please sign in to comment.