subroutine test_mulcnt()
character(len=20),allocatable :: strings(:)
integer,allocatable :: cindx(:)
integer :: csz
call unit_check_start('mulcnt', '-library orderpack') ! start tests
!
strings= [ character(len=20) :: &
& 'two ', 'four ', 'three', 'five', 'five', &
& 'two ', 'four ', 'three', 'five', 'five', &
& 'four ', 'four ', 'three', 'one ', 'five']
csz=size(strings)
if(allocated(cindx))deallocate(cindx)
allocate(cindx(csz))
call mulcnt(strings,cindx)
call unit_check('mulcnt',all(cindx .eq. [2,4,3,5,5,2,4,3,5,5,4,4,3,1,5]) ,'returned values')
call unit_check_done('mulcnt',msg='test completed')
end subroutine test_mulcnt