anchor.diff:       || {dep, App} <- Apps],
       %% A second run to another profile also links default to the right spot
       rebar_test_utils:run_and_check(
  -        Config, RebarConfig, ["as", "other", "install_deps"], Expect
  +        Config, RebarConfig, ["as", "other", "lock"], Expect
       ),
       [?assertMatch({ok, #file_info{type=directory}}, % somehow symlinks return dirs
                     file:read_file_info(filename:join([BuildDir, "other", "lib", App])))
        || {dep, App} <- Apps].
   
   nondefault_profile(Config) ->
  -    {ok, RebarConfig} = file:consult(?config(rebarconfig, Config)),
  -    AppDir = ?config(apps, Config),
  -    {ok, Apps} = Expect = ?config(expect, Config),
  -    rebar_test_utils:run_and_check(
  -        Config, RebarConfig, ["as", "nondef", "install_deps"], Expect
  +    %% The dependencies here are saved directly to the 
  +    {ok, RebarConfig} = file:consult(?config(rebarconfig, Config)),
  +    AppDir = ?config(apps, Config),
  +    {ok, AppLocks} = ?config(expect, Config),
  +    try
  +        rebar_test_utils:run_and_check(
  +            Config, RebarConfig, ["as", "nondef", "lock"], {ok, AppLocks}
  +        ),
  +        error(generated_locks)
  +    catch
  +        error:generated_locks -> error(generated_locks);
  +        _:{assertNotEqual, _} -> ok
  +    end,
  +    Apps = [App || App = {dep, _} <- AppLocks],
  +    Expect = {ok, Apps},
  +    rebar_test_utils:run_and_check(
  +        Config, RebarConfig, ["as", "nondef", "lock"], Expect
       ),
       check_warnings(error_calls(), ?config(warnings, Config), ?config(deps_type, Config)),
       BuildDir = filename:join([AppDir, "_build"]),
  
positive.code: run(Config) ->
      {ok, RebarConfig} = file:consult(?config(rebarconfig, Config)),
      rebar_test_utils:run_and_check(
          Config, RebarConfig, ["install_deps"], ?config(expect, Config)
      ),
      check_warnings(warning_calls(), ?config(warnings, Config), ?config(deps_type, Config)).
  
  
negative.code:      || {dep, App} <- Apps],
      %% A second run to another profile doesn't link dependencies
      rebar_test_utils:run_and_check(
          Config, RebarConfig, ["as", "other", "lock"], Expect
      ),
      [?assertMatch({error, enoent},
                    file:read_file_info(filename:join([BuildDir, "default", "lib", App])))
  