Skip to content

Commit 8f2cca4

Browse files
author
Damian Rouson
committed
test(unit): add trivial passing test
1 parent a51a5a2 commit 8f2cca4

File tree

3 files changed

+46
-4
lines changed

3 files changed

+46
-4
lines changed

fpm.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ copyright = "2020 Sourcery Institute"
88
[dev-dependencies]
99
vegetables = {git = "https://gitlab.com/everythingfunctional/vegetables", tag = "v5.1.1"}
1010

11-
#[[test]]
12-
#name="inputOutput"
13-
#source-dir="tests/unit/input-output"
14-
#main="main.f90"
11+
[[test]]
12+
name="unit"
13+
source-dir="tests"
14+
main="main.f90"

tests/example_test.f90

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
module example_test
2+
use Vegetables_m, only: Result_t, TestItem_t, describe, it, succeed
3+
4+
implicit none
5+
private
6+
7+
public :: test_example
8+
contains
9+
function test_example() result(tests)
10+
type(TestItem_t) :: tests
11+
12+
tests = describe(&
13+
"something", &
14+
[it( &
15+
"does a thing", &
16+
check_example)])
17+
end function
18+
19+
function check_example() result(result_)
20+
type(Result_t) :: result_
21+
22+
result_ = succeed("For now")
23+
end function
24+
end module

tests/main.f90

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
program main
2+
use example_test, only : test_example
3+
use Vegetables_m, only: TestItem_t, testThat, runTests
4+
5+
implicit none
6+
7+
call run()
8+
contains
9+
subroutine run()
10+
type(TestItem_t) :: tests
11+
type(TestItem_t) :: individual_tests(1)
12+
13+
individual_tests(1) = test_example()
14+
tests = testThat(individual_tests)
15+
16+
call runTests(tests)
17+
end subroutine run
18+
end program

0 commit comments

Comments
 (0)