MCPcopy
hub / github.com/pre-commit/pre-commit / test_run_example_executable

Function test_run_example_executable

tests/languages/haskell_test.py:11–38  ·  view source on GitHub ↗
(tmp_path)

Source from the content-addressed store, hash-verified

9
10
11def test_run_example_executable(tmp_path):
12 example_cabal = '''\
13cabal-version: 2.4
14name: example
15version: 0.1.0.0
16
17executable example
18 main-is: Main.hs
19
20 build-depends: base >=4
21 default-language: Haskell2010
22'''
23 main_hs = '''\
24module Main where
25
26main :: IO ()
27main = 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
41def test_run_dep(tmp_path):

Callers

nothing calls this directly

Calls 2

run_languageFunction · 0.90
win_exeFunction · 0.90

Tested by

no test coverage detected