Add example
This commit is contained in:
parent
c8acc534a9
commit
a0ba82ab38
7 changed files with 146 additions and 0 deletions
19
examples/testy/test/src/Main.idr
Normal file
19
examples/testy/test/src/Main.idr
Normal file
|
@ -0,0 +1,19 @@
|
|||
module Main
|
||||
|
||||
import System
|
||||
|
||||
-- @@test Main Test
|
||||
main : IO ()
|
||||
main = putStrLn "Test successful!"
|
||||
|
||||
-- @@test Failing integration with error message
|
||||
ohNo : IO ()
|
||||
ohNo = do
|
||||
putStrLn "Something horrible has happened"
|
||||
exitFailure
|
||||
|
||||
-- @@test Passing integration with output
|
||||
ohYes : IO ()
|
||||
ohYes = do
|
||||
putStrLn "Something amazing has happened"
|
||||
exitSuccess
|
9
examples/testy/test/src/TestModule/Booleans.idr
Normal file
9
examples/testy/test/src/TestModule/Booleans.idr
Normal file
|
@ -0,0 +1,9 @@
|
|||
module TestModule.Booleans
|
||||
|
||||
-- @@test Boolean Integration passes
|
||||
passes : IO Bool
|
||||
passes = pure True
|
||||
|
||||
-- @@test Boolean Integration fails
|
||||
fails : IO Bool
|
||||
fails = pure False
|
48
examples/testy/test/test.ipkg
Normal file
48
examples/testy/test/test.ipkg
Normal file
|
@ -0,0 +1,48 @@
|
|||
package testytest
|
||||
version = 0.1.0
|
||||
authors = "Nathan McCarty"
|
||||
-- maintainers =
|
||||
-- license =
|
||||
-- brief =
|
||||
-- readme =
|
||||
-- homepage =
|
||||
-- sourceloc =
|
||||
-- bugtracker =
|
||||
|
||||
-- the Idris2 version required (e.g. langversion >= 0.5.1)
|
||||
-- langversion
|
||||
|
||||
-- packages to add to search path
|
||||
depends = testy
|
||||
|
||||
-- modules to install
|
||||
modules = Main
|
||||
, TestModule.Booleans
|
||||
|
||||
-- main file (i.e. file to load at REPL)
|
||||
main = Main
|
||||
|
||||
-- name of executable
|
||||
executable = "testy-test"
|
||||
-- opts =
|
||||
sourcedir = "src"
|
||||
-- builddir =
|
||||
-- outputdir =
|
||||
|
||||
-- script to run before building
|
||||
-- prebuild =
|
||||
|
||||
-- script to run after building
|
||||
-- postbuild =
|
||||
|
||||
-- script to run after building, before installing
|
||||
-- preinstall =
|
||||
|
||||
-- script to run after installing
|
||||
-- postinstall =
|
||||
|
||||
-- script to run before cleaning
|
||||
-- preclean =
|
||||
|
||||
-- script to run after cleaning
|
||||
-- postclean =
|
Loading…
Add table
Add a link
Reference in a new issue