(tmp_path)
| 9 | |
| 10 | |
| 11 | def test_run_example_executable(tmp_path): |
| 12 | example_cabal = '''\ |
| 13 | cabal-version: 2.4 |
| 14 | name: example |
| 15 | version: 0.1.0.0 |
| 16 | |
| 17 | executable example |
| 18 | main-is: Main.hs |
| 19 | |
| 20 | build-depends: base >=4 |
| 21 | default-language: Haskell2010 |
| 22 | ''' |
| 23 | main_hs = '''\ |
| 24 | module Main where |
| 25 | |
| 26 | main :: IO () |
| 27 | main = putStrLn "Hello, Haskell!" |
| 28 | ''' |
| 29 | tmp_path.joinpath('example.cabal').write_text(example_cabal) |
| 30 | tmp_path.joinpath('Main.hs').write_text(main_hs) |
| 31 | |
| 32 | result = run_language(tmp_path, haskell, 'example') |
| 33 | assert result == (0, b'Hello, Haskell!\n') |
| 34 | |
| 35 | # should not symlink things into environments |
| 36 | exe = tmp_path.joinpath(win_exe('hs_env-default/bin/example')) |
| 37 | assert exe.is_file() |
| 38 | assert not exe.is_symlink() |
| 39 | |
| 40 | |
| 41 | def test_run_dep(tmp_path): |
nothing calls this directly
no test coverage detected