Description: Test fix unsaved changes
 test for the above patch
Origin: upstream
Applied-Upstream: yes
--- a/t/hash_id_of_values.t
+++ b/t/hash_id_of_values.t
@@ -3,7 +3,7 @@
 use warnings FATAL => qw(all);
 
 use ExtUtils::testlib;
-use Test::More tests => 88;
+use Test::More tests => 94;
 use Test::Memory::Cycle;
 use Config::Model ;
 use Test::Exception ;
@@ -322,6 +322,7 @@
 $inst->clear_changes ;
 
 $oh ->swap(qw/z x/) ;
+is($inst->needs_save,1,"verify instance needs_save status after swap") ;
 print scalar $inst->list_changes,"\n" if $trace ;
 $inst->clear_changes ;
 
@@ -333,12 +334,19 @@
 eq_or_diff([$oh->fetch_all_indexes], [qw/x a z/],
 	 "check index order of ordered_hash after swap(a z)") ;
 
+$inst->clear_changes ;
 $oh ->move_up(qw/a/) ;
+is($inst->needs_save,1,"verify instance needs_save status after move_up") ;
+print scalar $inst->list_changes,"\n" if $trace ;
+$inst->clear_changes ;
 
 eq_or_diff([$oh->fetch_all_indexes], [qw/a x z/],
 	 "check index order of ordered_hash after move_up(a)") ;
 
 $oh ->move_down(qw/x/) ;
+is($inst->needs_save,1,"verify instance needs_save status after move_down") ;
+print scalar $inst->list_changes,"\n" if $trace ;
+$inst->clear_changes ;
 
 eq_or_diff([$oh->fetch_all_indexes], [qw/a z x/],
 	 "check index order of ordered_hash after move_down(x)") ;
@@ -346,6 +354,10 @@
 is($oh->fetch_with_id('x')->fetch, '2x',"Check copied value") ;
 
 $oh->copy(qw/x d/) ;
+is($inst->needs_save,1,"verify instance needs_save status after copy") ;
+print scalar $inst->list_changes,"\n" if $trace ;
+$inst->clear_changes ;
+
 eq_or_diff([$oh->fetch_all_indexes], [qw/a z x d/],
 	 "check index order of ordered_hash after copy(x d)") ;
 is($oh->fetch_with_id('d')->fetch, '2x',"Check copied value") ;
@@ -355,13 +367,20 @@
 	 "check index order of ordered_hash after copy(a e)") ;
 is($oh->fetch_with_id('e')->fetch, '3a',"Check copied value") ;
 
+$inst->clear_changes ;
 $oh->move_after('d') ;
 eq_or_diff([$oh->fetch_all_indexes], [qw/d a z x e/],
 	 "check index order of ordered_hash after move_after(d)") ;
+is($inst->needs_save,1,"verify instance needs_save status after move_after") ;
+print scalar $inst->list_changes,"\n" if $trace ;
+$inst->clear_changes ;
 
 $oh->move_after('d','z') ;
 eq_or_diff([$oh->fetch_all_indexes], [qw/a z d x e/],
 	 "check index order of ordered_hash after move_after(d z)") ;
+is($inst->needs_save,1,"verify instance needs_save status after move_after") ;
+print scalar $inst->list_changes,"\n" if $trace ;
+$inst->clear_changes ;
 
 $oh->move_after('d','e') ;
 eq_or_diff([$oh->fetch_all_indexes], [qw/a z x e d/],
--- a/t/array_id.t
+++ b/t/array_id.t
@@ -12,7 +12,7 @@
 use Config::Model::AnyId;
 use Log::Log4perl qw(:easy :levels) ;
 
-BEGIN { plan tests => 105; }
+BEGIN { plan tests => 107; }
 
 use strict;
 
@@ -246,7 +246,13 @@
     $ol->fetch_with_id( $i++ )->fetch_element($e)->store($v);
 }
 
+$inst->clear_changes ;
+
 $ol->move( 3, 4 );
+is($inst->needs_save,1,"verify instance needs_save status after move") ;
+print scalar $inst->list_changes,"\n" if $trace ;
+$inst->clear_changes ;
+
 is( $ol->fetch_with_id(3)->fetch_element('Z')->fetch,
     undef, "check after move idx 3 in 4" );
 is( $ol->fetch_with_id(4)->fetch_element('Z')->fetch,
@@ -256,6 +262,10 @@
 } ( 0 .. 4 );
 
 $ol->swap( 0, 2 );
+is($inst->needs_save,1,"verify instance needs_save status after move") ;
+print scalar $inst->list_changes,"\n" if $trace ;
+$inst->clear_changes ;
+
 is( $ol->fetch_with_id(0)->fetch_element('X')->fetch,
     undef, "check after move idx 0 in 2" );
 is( $ol->fetch_with_id(0)->fetch_element('Y')->fetch, 'Av',
@@ -401,4 +411,4 @@
 eq_or_diff( [ $pl->fetch_all_indexes ], [0] ,"check that only layered stuff was cleared");
 is($pl->fetch_with_id(0)->fetch,'bar',"check that bar was moved from 1 to 0");
 $pl->clear ;
-memory_cycle_ok($model);
+memory_cycle_ok($model,"memory cycles");
