Skip to content

Commit 890551a

Browse files
committed
temp commit
1 parent 812c18d commit 890551a

File tree

1 file changed

+15
-16
lines changed

1 file changed

+15
-16
lines changed

Diff for: src/tests/stringlist/test_insert_at.f90

+15-16
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
! SPDX-Identifier: MIT
22
module test_insert_at
33
use stdlib_error, only: check
4-
use stdlib_string_type, only: string_type, operator(//), operator(==)
4+
use stdlib_string_type, only: string_type, operator(//), operator(==), char
55
use stdlib_stringlist_type, only: stringlist_type, fidx, bidx, list_head, list_tail, operator(==)
66
use stdlib_strings, only: to_string
77
use stdlib_optval, only: optval
@@ -355,27 +355,26 @@ end subroutine test_constructor
355355
subroutine test_insert_at_same_list
356356
type(stringlist_type) :: work_list
357357
type(stringlist_type) :: temp_list
358-
integer :: i, j
358+
integer :: i
359359
integer, parameter :: first = -100
360360
integer, parameter :: last = 100
361-
integer, parameter :: stride = 4
362361

363362
write (*,*) "test_insert_at_same_list: Starting work_list!"
364363

365364
call work_list%insert_at( list_head, work_list )
366365
call work_list%insert_at( list_tail, work_list )
367366

368-
do j = -10, 10
369-
call work_list%insert_at( fidx(j), work_list )
370-
call work_list%insert_at( bidx(j), work_list )
367+
do i = -10, 10
368+
call work_list%insert_at( fidx(i), work_list )
369+
call work_list%insert_at( bidx(i), work_list )
371370

372371
end do
373372

374373
call compare_list( work_list, 0, 0, 13 )
375-
call check( work_list%len() == 0, "empty list insertion resulted in change in length")
374+
call check( work_list%len() == 0, "test_insert_at_same_list: empty list insertion")
376375

377-
do j = first, last
378-
call work_list%insert_at( list_tail, string_type( to_string(j) ) )
376+
do i = first, last
377+
call work_list%insert_at( list_tail, string_type( to_string(i) ) )
379378
end do
380379
temp_list = work_list
381380

@@ -393,13 +392,13 @@ subroutine test_insert_at_same_list
393392

394393
write (*,*) "test_insert_at_same_list: Starting temp_list!"
395394

396-
do j = 1, last - first + 2
395+
do i = 1, last - first + 2
397396
temp_list = work_list
398-
call temp_list%insert_at( fidx(j), temp_list )
397+
call temp_list%insert_at( fidx(i), temp_list )
399398

400-
call compare_list( temp_list, first, first + j - 1, 19, to=j - 1 )
401-
call compare_list( temp_list, first, last + 1, 20, from=j, to=j + last - first )
402-
call compare_list( temp_list, first + j - 1, last + 1, 21, from=j + last - first + 1 )
399+
call compare_list( temp_list, first, first + i - 1, 19, to=i - 1 )
400+
call compare_list( temp_list, first, last + 1, 20, from=i, to=i + last - first )
401+
call compare_list( temp_list, first + i - 1, last + 1, 21, from=i + last - first + 1 )
403402

404403
end do
405404

@@ -424,13 +423,13 @@ subroutine compare_list(list, first, last, call_number, from, to)
424423
do i = work_from, work_to
425424
call check( list%get( fidx(i) ) == to_string( first + ( ( i - work_from ) * j ) ), &
426425
& "compare_list: call_number " // to_string( call_number ) &
427-
& // " fidx( " // to_string( i ) // " )")
426+
& // " fidx( " // to_string( i ) // " )" // char(list%get( fidx(i) )) )
428427

429428
k = length - ( work_to - ( i - work_from ) ) + 1
430429
call check( list%get( bidx(k) ) == &
431430
& to_string( last - ( ( i - work_from + 1 ) * j ) ), &
432431
& "compare_list: call_number " // to_string( call_number ) &
433-
& // " bidx( " // to_string( k ) // " )")
432+
& // " bidx( " // to_string( k ) // " )" )
434433
end do
435434

436435
end subroutine compare_list

0 commit comments

Comments
 (0)