diff options
Diffstat (limited to 'Biz')
-rw-r--r-- | Biz/Bild.hs | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/Biz/Bild.hs b/Biz/Bild.hs index 5c8e287..a67c1c2 100644 --- a/Biz/Bild.hs +++ b/Biz/Bild.hs @@ -161,7 +161,8 @@ main = Cli.Plan help move test_ pure |> Cli.main [ test_bildBild, test_bildExamples, test_isGitIgnored, - test_isGitHook + test_isGitHook, + test_detectPythonImports ] test_bildBild :: Test.Tree @@ -847,6 +848,19 @@ detectPythonImports contentLines = Regex.string "import" *> Regex.some (Regex.psym Char.isSpace) *> Regex.many (Regex.psym isModuleChar) + <* Regex.many Regex.anySym + +test_detectPythonImports :: Test.Tree +test_detectPythonImports = + Test.group + "detectPythonImports" + [ Test.unit "matches import statements" <| do + set <- detectPythonImports ["import Biz.Log"] + Set.fromList ["Biz/Log.py"] @=? set, + Test.unit "matches import as statements" <| do + set <- detectPythonImports ["import Biz.Log as Log"] + Set.fromList ["Biz/Log.py"] @=? set + ] ghcPkgFindModule :: Set String -> String -> IO (Set String) ghcPkgFindModule acc m = |