@@ -667,6 +667,7 @@ subroutine test_move(error)
667667 ! > Error handling
668668 type (error_type), allocatable , intent (out ) :: error
669669 type (string_type) :: from_string, to_string
670+ type (string_type) :: from_string_not
670671 type (string_type) :: from_strings(2 ), to_strings(2 )
671672 character (len= :), allocatable :: from_char, to_char
672673
@@ -706,20 +707,32 @@ subroutine test_move(error)
706707 call check(error, .not. allocated (from_char) .and. from_string == " new char" , " move: test_case 6" )
707708 if (allocated (error)) return
708709
709- ! character (unallocated ) --> string_type (allocated)
710+ ! character (not allocated ) --> string_type (allocated)
710711 call move(from_char, from_string)
711712 call check(error, from_string == " " , " move: test_case 7" )
712713 if (allocated (error)) return
713714
714715 from_string = " moving to self"
715716 ! string_type (allocated) --> string_type (allocated)
716717 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" )
718719 if (allocated (error)) return
719720
720721 ! elemental: string_type (allocated) --> string_type (not allocated)
721722 call move(from_strings, to_strings)
722723 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+
723736 end subroutine test_move
724737
725738end module test_string_intrinsic
0 commit comments