Skip to content

Language Fortran

kazk edited this page Apr 13, 2018 · 12 revisions

Status

Beta

Versions

Fortran 95

Test Frameworks

CW2

NOTE: Unlike other Codewars test frameworks, assertions take expected value first.

module Solution
implicit none
contains
  function add(a, b)
    integer(kind=4),intent(in)::a
    integer(kind=4),intent(in)::b
    integer(kind=4)::add
    add = a + b
  end function
end module
program TestCases
implicit none
  use CW2
  use Solution
  call assertEquals(2, add(1, 1))
end program

Module names can be anything valid. Preloaded can be used to add another module.

Using describe and it:

program TestCases
implicit none
  use CW2
  use Solution
  call describe("add")
    call it("adds integers")
      call assertEquals(2, add(1, 1))
    call endContext()
  call endContext()
end program

Timeout

12 seconds

Packages

None

Services

None

Clone this wiki locally