test_index Subroutine

public subroutine test_index()

Arguments

None

Calls

proc~~test_index~~CallsGraph proc~test_index test_index assert_that assert_that proc~test_index->assert_that equal_to equal_to proc~test_index->equal_to

Source Code

   subroutine test_index()
      type(String) :: s, substring

      s = 'abcdabcd'
      @assert_that(s%index('b'), is(equal_to(2)))
      @assert_that(s%index('b', back=.true.), is(equal_to(6)))

      substring = 'bc'
      @assert_that(s%index(substring), is(equal_to(2)))
      @assert_that(s%index(substring, back=.true.), is(equal_to(6)))
      
   end subroutine test_index