Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions fpm.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ copyright = "2020 Sourcery Institute"
[dev-dependencies]
vegetables = {git = "https://gitlab.com/everythingfunctional/vegetables", tag = "v5.1.1"}

#[[test]]
#name="inputOutput"
#source-dir="tests/unit/input-output"
#main="main.f90"
[[test]]
name="unit"
source-dir="tests"
main="main.f90"
6 changes: 3 additions & 3 deletions src/array_functions_interface.f90
Original file line number Diff line number Diff line change
Expand Up @@ -33,22 +33,22 @@ module array_functions_interface

interface

pure module function column_vectors(vector_field) RESULT(array_of_3D_column_vectors)
pure module function column_vectors(vector_field) result(array_of_3D_column_vectors)
!! Result is array of 3D column vectors of dimension (space_dim,nx*ny*nz) reshaped from vector-field argument
!! of dimension (nx,ny,nz,space_dim)
implicit none
real, dimension(:,:,:,:), intent(in) :: vector_field
real, dimension(:,:), allocatable :: array_of_3D_column_vectors
end function

pure module function concatenate_columns(a, b) RESULT(concatenated)
pure module function concatenate_columns(a, b) result(concatenated)
!! Result contains the concatenation of the columns of argument a with the columns of argument b
implicit none
real, dimension(:,:), intent(in) :: a, b
real, dimension(:,:), allocatable :: concatenated
end function

pure module function concatenate_rows(a, b) RESULT(concatenated)
pure module function concatenate_rows(a, b) result(concatenated)
!! Result contains the concatenation of the rows of argument a with the rows of argument b
implicit none
real, dimension(:,:), intent(in) :: a, b
Expand Down
24 changes: 24 additions & 0 deletions tests/example_test.f90
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
module example_test
use Vegetables_m, only: Result_t, TestItem_t, describe, it, succeed

implicit none
private

public :: test_example
contains
function test_example() result(tests)
type(TestItem_t) :: tests

tests = describe(&
"something", &
[it( &
"does a thing", &
check_example)])
end function

function check_example() result(result_)
type(Result_t) :: result_

result_ = succeed("For now")
end function
end module
18 changes: 18 additions & 0 deletions tests/main.f90
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
program main
use example_test, only : test_example
use Vegetables_m, only: TestItem_t, testThat, runTests

implicit none

call run()
contains
subroutine run()
type(TestItem_t) :: tests
type(TestItem_t) :: individual_tests(1)

individual_tests(1) = test_example()
tests = testThat(individual_tests)

call runTests(tests)
end subroutine run
end program