-
Notifications
You must be signed in to change notification settings - Fork 1
/
test_list.f90
53 lines (37 loc) · 1.2 KB
/
test_list.f90
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
!=====================================================================!
! Test program for list
!=====================================================================!
program test_list
use string_class
use linked_list_class
use iterator_interface
use object_class
class(doubly_linked_list), allocatable :: list
allocate(list, source = doubly_linked_list())
!!$ call list % append(1)
!!$ call list % append(1.2)
call list % append(string("hello"))
call list % append(string("boopathy"))
call list % append(string("komahan boopathy"))
call list % append(string("komahan boopathy"))
!!$ call list % append('komahan boopathy')
call list % append(list)
!!$ call list % append(1.0d0)
!!$ call list % append(.true.)
print *, list % length
STOP
! Sanity check on BDF coeffs
test_iterator: block
class(iterator), allocatable :: it
type(object) :: tmp
allocate(it, source = list % get_iterator())
!allocate(it, source = list_iterator(list%head))
do while(it % has_next())
!tmp = it % next()
end do
! print *, it % has_next()
!call it % next() % print()
deallocate(it)
end block test_iterator
deallocate(list)
end program test_list