anchor.diff:      ].
   
   test_code_change( S0 ) ->
  +    mock_impl_module_code_change(),
  +
       R1 = code_change( make_ref(), S0, go_well ),
       R2 = code_change( make_ref(), S0, go_wrong ),
  -    [ ?_assertMatch( { ok, _Ctx }, R1 )
  -    , ?_assertMatch( { error, _Error }, R2 )
  -    ].
  -
  +    [ ?_assertMatch( { ok, #state{ context = context1 } }, R1 )
  +    , ?_assertMatch( { error, went_wrong }, R2 )
  +    ].
  +
  +test_no_code_change( S0 ) ->
  +    R1 = code_change( make_ref(), S0, go_well ),
  +    R2 = code_change( make_ref(), S0, go_wrong ),
  +    [ ?_assertMatch( { ok, S0 }, R1 )
  +    , ?_assertMatch( { ok, S0 }, R2 )
  +    ].
  +
  +mock_impl_module_code_change() ->
  +    meck:expect( ?IMPL, code_change,
  +        fun( _OldVsn, _Ctx, go_well ) -> { ok, context1 };
  +           ( _OldVsn, _Ctx, go_wrong ) -> { error, went_wrong }
  +        end ).
   
   mock_impl_module() ->
       meck:new( ?IMPL, [ non_strict ] ),
  
positive.code:         fun( good_event, _Ctx ) -> { ok, value, context1 };
             ( bad_event, _Ctx ) -> { error, reason, context2 }
          end ),
      meck:expect( ?IMPL, code_change,
          fun( _OldVsn, _Ctx, go_well ) -> { ok, new_state };
             ( _OldVsn, _Ctx, go_wrong ) -> { error, went_wrong }
          end ),
      meck:expect( ?IMPL, stop_driver, fun( _, _ ) -> ok end ),
  
      #state{ id = make_ref(), impl = ?IMPL, owner = self() }.
  
negative.code: 
  
  code_change( OldVsn, State, Extra ) ->
      optional_call_impl(
        code_change, [ OldVsn, State#state.context, Extra ], State,
        { ok, State }
       ).
  
  
  %% ===================================================================
  