anchor.diff:  eqc_name_checking(_UsedFrameWorks, _OldModName, _NewModName)->
       ok.   %% are there any contraints on module names imposed by quickcheck?
   
  -	 
   testserver_name_checking(UsedFrameWorks, OldModName, NewModName) ->
       case lists:suffix(?DEFAULT_TS_MODULE_SUFFIX, atom_to_list(OldModName)) of
  -	true -> case lists:suffix(?DEFAULT_TS_MODULE_SUFFIX, atom_to_list(NewModName)) of
  -		    true -> ok;
  -		    _ ->
  - 			case lists:member(testserver, UsedFrameWorks) or 
  -			    lists:member(commontest, UsedFrameWorks) of 
  -			    true ->
  - 				throw({warning, "A Test Server/Common Test test suite module should have a name on the form '*_SUITE.erl', still continue?"});
  -			    false ->
  -				throw({warning, "A module with a name of the form '*_SUITE.erl' could be a Test Server/Common Test test suite module, continue?"})
  -			end
  -		end;
  -	_ -> case (lists:suffix(?DEFAULT_TS_MODULE_SUFFIX, atom_to_list(NewModName))) of 
  -		 false -> ok;
  -		 _ ->
  -		     throw({warning, "A module name on the form '*_SUITE.erl' is"
  -			    " usually treated as a Test Server/Common Test test suite module, continue?"})
  -	     end
  -    end.
  -    
  - 
  -mod_name_as_pars_1() ->
  -    [{{erlang, apply, 3}, [modulenmae, functionname, arglist], term},
  -     {{erlang, spawn, 3}, [modulename, functionname, arglist], term},
  -     {{erlang, spawn_link, 3}, [modulename, functionname, arglist], term},
  -     {{erlang, spawn_opt, 4}, [modulename, functionname, arglist, term], term},
  -     {{eqc, module, 1}, [modulename], term},
  -     {{eqc_ct, compile, 1}, [modulename], term},
  -     {{eqc_ct, compile, 2}, [mdoulename, term], term},
  -     {{eqc_ct, module, 1}, [modulename], term},
  -     {{eqc_statem, commands, 1}, [modulename], term},
  -     {{eqc_statem, commands, 2}, [modulename, term], term},
  -     {{eqc_statem, postconditions, 3}, [modulename, term, term], term},
  -     {{eqc_statem, run_commands, 2}, [modulename, term], term},
  -     {{eqc_statem, run_commands, 3}, [modulename, term, term], term},
  -     {{test_server, timecall, 3}, [modulename, functionname, arglist], term},
  -     {{test_server, call_crash, 3}, [modulename, functionname, arglist], term},
  -     {{test_server, is_native, 1}, [modulename], term},
  -     {{test_server_ctrl, add_module, 1}, [modulename], term},
  -     {{test_server_ctrl, add_case, 2}, [modulename, functionname], term},
  -     {{test_server_ctrl, add_cases, 2}, [modulename, [functionname]], term},
  -     {{rs, r, 2}, [modulename, functionname], term},
  -     {{rs, r, 3}, [modulename, functionname, term], term}].
  -
  -mod_name_as_pars_2() ->
  -    [ {{erlang, spawn, 4}, [node, modulename, functionname, arglist], term},
  -      {{erlang, spawn_link, 4}, [term, modulename, functioname, arglist], term},
  -      {{erlang, spawn_monitor, 3}, [term, modulename,functionname, arglist], term},			       
  -      {{eralng, spawn_opt, 4}, [term, modulename, functionname, arglist, term], term},
  -      {{test_server, do_times, 4}, [integer, modulename, functionname, arglist], term},
  -      {{test_server, call_crash, 4}, [term, modulename, functionname, arglist], term},
  -      {{test_server_ctrl, add_case, 3}, [term, modulename, functionname], term},
  -      {{test_server_ctrl, add_cases,3}, [term, modulename, [functionname]], term},
  -      {{ts, run, 2}, [term, modulename], term},
  -      {{ts, run, 3}, [term, modulename, functionname], term},
  -      {{ts, run, 4}, [term, modulename, functionname, term], term}].
  -      
  -mod_name_as_pars_3() ->
  -    [{{test_server, call_crash, 5}, [term, term, modulename, functionname, arglist], term}].
  -    
  -
  -    
  +      true -> case lists:suffix(?DEFAULT_TS_MODULE_SUFFIX, atom_to_list(NewModName)) of
  +		true -> ok;
  +		_ ->
  +		    case lists:member(testserver, UsedFrameWorks) orelse
  +			lists:member(commontest, UsedFrameWorks) of
  +		      true ->
  +			  throw({warning, "A Test Server/Common Test test suite module "
  +				 "should have a name on the form '*_SUITE.erl', still continue?"});
  +		      false ->
  +			  throw({warning, "A module with a name of the form '*_SUITE.erl' could "
  +				 "be a Test Server/Common Test test suite module, continue?"})
  +		    end
  +	      end;
  +      _ -> case lists:suffix(?DEFAULT_TS_MODULE_SUFFIX, atom_to_list(NewModName)) of
  +	     false -> ok;
  +	     _ ->
  +		 throw({warning, "A module name on the form '*_SUITE.erl' is"
  +			" usually treated as a Test Server/Common Test test suite module, continue?"})
  +	   end
  +    end.
  +    
  +  
   renamed_warn_msg(OldModNames) ->
       case OldModNames of 
   	[M] ->
  
positive.code: 	true ->
  	    case lists:suffix(?DEFAULT_EUNIT_TESTMODULE_SUFFIX, atom_to_list(OldModName)) of 
  		true ->
  		    throw({warning, "The module to be renamed is an EUnit test module, do you really want to continue the refactoring?"});
  		false ->
  		    case lists:suffix(?DEFAULT_EUNIT_TESTMODULE_SUFFIX, atom_to_list(NewModName)) of 
  			true ->
  
negative.code: 	    do_rename_mod(FileName, [{OldModName, NewModName}], AnnAST, SearchPaths, Editor, TabWidth, Cmd)
      end.
  
  do_rename_mod(FileName, OldNewModPairs, AnnAST, SearchPaths, Editor, TabWidth, Cmd) ->
      {OldModName, NewModName} = hd(OldNewModPairs),
      NewFileName = filename:dirname(FileName) ++ "/" ++ atom_to_list(NewModName) ++ ".erl",
      {TestFileName, NewTestFileName} 
  	= case find_eunit_test_file(OldModName, SearchPaths) of
  	     [F] -> {F, filename:dirname(F) ++ "/" ++ atom_to_list(NewModName) ++ "_tests.erl"};
  	      _ -> {none, none}
  	  end,
      Pid = start_atom_process(),
      ?wrangler_io("The current file under refactoring is:\n~p\n", [FileName]),
      {AnnAST1, _C1} = do_rename_mod_1(AnnAST, {FileName, OldNewModPairs, Pid}),
      OldModNames = element(1, lists:unzip(OldNewModPairs)),
      check_atoms(FileName, AnnAST1, OldModNames, Pid),
      TestModRes = case length(OldNewModPairs) of
  		   2 -> ?wrangler_io("The current file under refactoring is:\n~p\n", [TestFileName]),
  			{TestAnnAST,_Info} =  parse_file_with_type_ann(TestFileName, SearchPaths, TabWidth),
  			{TestAnnAST1, _C2} = do_rename_mod_1(TestAnnAST, {FileName, OldNewModPairs, Pid}),
  			check_atoms(FileName, TestAnnAST1, OldModNames, Pid),
  			[{{TestFileName, NewTestFileName}, TestAnnAST1}];
  		   _ -> []
  		 end,
      
      ?wrangler_io("\nChecking client modules in the following search paths: \n~p\n", [SearchPaths]),
      ClientFiles1 = refac_util:get_client_files(FileName, SearchPaths),
      ClientFiles2 = case length(OldNewModPairs) == 2 of
  		     true -> refac_util:get_client_files(TestFileName, SearchPaths);
  		     _ -> []
  		   end,
      ClientFiles = case length(OldNewModPairs) of
  		    2 -> lists:usort(ClientFiles1 ++ ClientFiles2) -- [FileName, TestFileName];
  		    _ -> ClientFiles1
  		  end,
      Results = rename_mod_in_client_modules(ClientFiles, OldModName, OldNewModPairs, SearchPaths, TabWidth, Pid),
      case Editor of
  	emacs ->
  	    HasWarningMsg = refac_rename_fun:has_warning_msg(Pid),
  	    case HasWarningMsg of
  	      true ->
  		    output_atom_warning_msg(Pid, not_renamed_warn_msg(OldModNames), renamed_warn_msg(OldModNames));
  		false ->
  		    ok
  	    end,
  	    stop_atom_process(Pid),
  	    refac_util:write_refactored_files_for_preview([{{FileName, NewFileName}, AnnAST1}| TestModRes ++ Results], Cmd),
  	    ChangedClientFiles = lists:map(fun ({{F, _F}, _AST}) -> F end, Results),
  	    ChangedFiles = case length(OldNewModPairs) of
  			       2 -> [FileName, TestFileName| ChangedClientFiles];
  			       1 -> [FileName| ChangedClientFiles]
  			   end,
  	    ?wrangler_io("The following files are to be changed by this refactoring:\n~p\n", [ChangedFiles]),
  	    {ok, ChangedFiles, HasWarningMsg};
  	eclipse ->
  	    Results1 = [{{FileName, NewFileName}, AnnAST1}| TestModRes ++ Results],
  	    Res = lists:map(fun ({{FName, NewFName}, AST}) -> {FName, NewFName,
  							       refac_prettypr:print_ast(refac_util:file_format(FName), AST)}
  			    end, Results1),
  	    {ok, Res}
      end.
    
   
     
  do_rename_mod_1(Tree, {FileName, OldNewModPairs,Pid}) ->
      TestFrameWorkUsed =refac_util:test_framework_used(FileName),
      {AnnAST1, C1}=refac_util:full_tdTP(fun do_rename_mod_2/2, Tree, {FileName,OldNewModPairs, Pid}),
      {AnnAST2, C2} = case lists:member(eunit, TestFrameWorkUsed) of 
  			true ->do_rename_mod_in_eunit_funs(FileName, AnnAST1, OldNewModPairs,Pid);
  			_ -> {AnnAST1, C1}
  		    end,
      {AnnAST2, C1 or C2}.
  
  do_rename_mod_2(Tree, {_FileName, OldNewModPairs, _Pid}) ->
      case refac_syntax:type(Tree) of
        attribute ->
  	  AttrName = refac_syntax:attribute_name(Tree),
  	  case refac_syntax:atom_value(AttrName) of
  	    module -> Args = refac_syntax:attribute_arguments(Tree),
  		      F = fun (Arg) -> case lists:keysearch(refac_syntax:atom_value(Arg), 1, OldNewModPairs) of
  					 {value, {_OldModName, NewModName}} ->
  					     copy_pos_attrs(Arg, refac_syntax:atom(NewModName));
  					 _ -> Arg
  				       end
  			  end,
  		      Args1 = lists:map(F, Args),
  		      Tree1 = copy_pos_attrs(Tree, refac_syntax:attribute(AttrName, Args1)),
  		      {Tree1, Tree =/= Tree1};
  	    import -> Args = refac_syntax:attribute_arguments(Tree),
  		      case Args of
  			[H| T] ->
  			    case refac_syntax:type(H) of
  			      atom ->
  				  M = refac_syntax:atom_value(H),
  				  case lists:keysearch(M, 1, OldNewModPairs) of
  				    {value, {_OldModName, NewModName}} ->
  					H1 = copy_pos_attrs(H, refac_syntax:atom(NewModName)),
  					Tree1 = copy_pos_attrs(Tree, refac_syntax:attribute(AttrName, [H1| T])),
  					{Tree1, true};
  				    _ -> {Tree, false}
  				  end;
  			      qualified_name ->
  				  M = list_to_atom(packages:concat(
  						     [refac_syntax:atom_value(A)
  						      || A <- refac_syntax:qualified_name_segments(H)])),
  				  case lists:keysearch(M, 1, OldNewModPairs) of
  				    {value, {_OldModName, NewModName}} ->
  					H1 = copy_pos_attrs(H, refac_syntax:qualified_name(
  								 [refac_syntax:atom(NewModName)])),
  					Tree1 = copy_pos_attrs(Tree, refac_syntax:attribute(AttrName, [H1| T])),
  					{Tree1, true};
  				    _ -> {Tree, false}
  				  end;
  			      _ -> {Tree, false}
  			    end;
  			_ -> {Tree, false}
  		      end;
  	    _ -> {Tree, false}
  	  end;
        module_qualifier ->
  	  Mod = refac_syntax:module_qualifier_argument(Tree),
  	  Fun = refac_syntax:module_qualifier_body(Tree),
  	  case refac_syntax:type(Mod) of
  	    atom ->
  		case lists:keysearch(refac_syntax:atom_value(Mod), 1, OldNewModPairs) of
  		  {value, {_OldModName, NewModName}} ->
  		      Mod1 = copy_pos_attrs(Mod, refac_syntax:atom(NewModName)),
  		      Tree1 = copy_pos_attrs(Tree, refac_syntax:module_qualifier(Mod1, Fun)),
  		      {Tree1, true};
  		  _ -> {Tree, false}
  		end;
  	    _ -> {Tree, false}
  	  end;
        atom ->
  	  As = refac_syntax:get_ann(Tree),
  	  case lists:keysearch(type, 1, As) of
  	    {value, {type, m_atom}} ->
  		case lists:keysearch(refac_syntax:atom_value(Tree), 1, OldNewModPairs) of
  		  {value, {_OldModName, NewModName}} ->
  		      Tree1 = copy_pos_attrs(Tree, refac_syntax:atom(NewModName)),
  		      {Tree1, true};
  		  _ -> {Tree, false}
  		end;
  	    _ ->
  		{Tree, false}
  	  end;
  	_ -> {Tree, false}
      end.
  rename_mod_in_client_modules(Files, OldModName, OldNewModPairs, SearchPaths, TabWidth, Pid) ->
      case Files of 
          [] -> [];
          [F|Fs] -> 
  	    ?wrangler_io("The current file under refactoring is:\n~p\n",[F]), 
  	    {AnnAST,Info} =  parse_file_with_type_ann(F, SearchPaths, TabWidth),
  	    case lists:keysearch(module,1, Info) of 
  		{value, {module, OldModName}} ->
  		    throw({error, "The same module name, "++atom_to_list(OldModName)
  			   ++", is also used by file: "++F++"."});
  		_ -> ok
  	    end,
  	    {AnnAST1, Changed} = do_rename_mod_1(AnnAST, {F, OldNewModPairs,Pid}),
  	    OldModNames = element(1, lists:unzip(OldNewModPairs)),
  	    check_atoms(F, AnnAST1, OldModNames, Pid),
  	    if Changed ->
  		    [{{F,F}, AnnAST1}|rename_mod_in_client_modules(
  					Fs, OldModName, OldNewModPairs, SearchPaths, TabWidth, Pid)];
  	       true -> 
  		    rename_mod_in_client_modules(
  		      Fs, OldModName, OldNewModPairs, SearchPaths, TabWidth,Pid)
  	    end
      end.    
  
  copy_pos_attrs(E1, E2) ->
      refac_syntax:copy_pos(E1, refac_syntax:copy_attrs(E1, E2)).
  
  do_rename_mod_in_eunit_funs(FileName, AnnAST, OldNewModPairs, Pid) ->
      refac_util:full_tdTP(fun do_rename_mod_in_eunit_funs_1/2, AnnAST, {FileName, OldNewModPairs, Pid}).
  do_rename_mod_in_eunit_funs_1(Node, Others) ->
      case refac_syntax:type(Node) of
        function ->
  	  FunName = refac_syntax:data(refac_syntax:function_name(Node)),
  	  Arity = refac_syntax:function_arity(Node),
  	  case (Arity == 0) and lists:suffix(?DEFAULT_EUNIT_GENERATOR_SUFFIX, atom_to_list(FunName)) of
  	    true ->
  		refac_util:full_tdTP(fun do_rename_mod_in_eunit_funs_3/2, Node, Others);
  	    _ -> {Node, false}
  	  end;
        _ -> {Node, false}
      end.
  do_rename_mod_in_eunit_funs_3(Node, {FileName,OldNewModPairs,Pid}) ->
      case refac_syntax:type(Node) of 
  	tuple ->
  	    case refac_syntax:tuple_elements(Node) of 
  		[E1, E2, E3] ->
  		    case refac_syntax:type(E1)==atom andalso
  			refac_syntax:atom_value(E1)==generator andalso
  			refac_syntax:type(E2) == atom of 
  			true ->
  			    case lists:keysearch(refac_syntax:atom_value(E2), 1, OldNewModPairs) of 
  				{value, {_OldModName, NewModName}} ->
  				    Pid ! {add_renamed, {FileName, Node}},
  				    {copy_pos_attrs(Node, refac_syntax:tuple(
  					     [E1, copy_pos_attrs(E2, refac_syntax:atom(NewModName)), E3])),
  				     true};
  				false-> {Node, false}
  			    end;
  			false ->
  			    {Node, false}
  		    end;
  		[E1,E2] -> case refac_syntax:type(E1) of 
  			       atom ->
  