@@ -667,6 +667,7 @@ subroutine test_move(error)
667
667
! > Error handling
668
668
type (error_type), allocatable , intent (out ) :: error
669
669
type (string_type) :: from_string, to_string
670
+ type (string_type) :: from_string_not
670
671
type (string_type) :: from_strings(2 ), to_strings(2 )
671
672
character (len= :), allocatable :: from_char, to_char
672
673
@@ -706,20 +707,32 @@ subroutine test_move(error)
706
707
call check(error, .not. allocated (from_char) .and. from_string == " new char" , " move: test_case 6" )
707
708
if (allocated (error)) return
708
709
709
- ! character (unallocated ) --> string_type (allocated)
710
+ ! character (not allocated ) --> string_type (allocated)
710
711
call move(from_char, from_string)
711
712
call check(error, from_string == " " , " move: test_case 7" )
712
713
if (allocated (error)) return
713
714
714
715
from_string = " moving to self"
715
716
! string_type (allocated) --> string_type (allocated)
716
717
call move(from_string, from_string)
717
- call check(error, from_string == " " , " move: test_case 8" )
718
+ call check(error, from_string == " moving to self " , " move: test_case 8" )
718
719
if (allocated (error)) return
719
720
720
721
! elemental: string_type (allocated) --> string_type (not allocated)
721
722
call move(from_strings, to_strings)
722
723
call check(error, all (from_strings(:) == " " ) .and. all (to_strings(:) == " Move This String" ), " move: test_case 9" )
724
+
725
+ ! string_type (not allocated) --> string_type (not allocated)
726
+ call move(from_string_not, to_string)
727
+ call check(error, from_string_not == " " .and. to_string == " " , " move: test_case 10" )
728
+ if (allocated (error)) return
729
+
730
+ ! string_type (not allocated) --> string_type (not allocated)
731
+ to_string = " to be deallocated"
732
+ call move(from_string_not, to_string)
733
+ call check(error, from_string_not == " " .and. to_string == " " , " move: test_case 11" )
734
+ if (allocated (error)) return
735
+
723
736
end subroutine test_move
724
737
725
738
end module test_string_intrinsic
0 commit comments