anchor.diff:  -include_lib("eunit/include/eunit.hrl").
   -include_lib("kernel/include/file.hrl").
   
  +-define(TMPDIR, "/test").
  +
   
   all() ->
       [{group, tmpdir},
  
positive.code:     Config.
  
  raw_tmpdir(_Config) ->
      UnixTmpdir = os:getenv("TMPDIR", "/tmp"),
      case rebar_file_utils:system_tmpdir() of
          UnixTmpdir -> ok;
          "./tmp"    -> ok
      end.
  
  empty_tmpdir(_Config) ->
      UnixTmpdir = os:getenv("TMPDIR", "/tmp"),
      case rebar_file_utils:system_tmpdir([]) of
          UnixTmpdir -> ok;
          "./tmp"    -> ok
      end.
  
  simple_tmpdir(_Config) ->
      UnixTmpdir = os:getenv("TMPDIR", "/tmp") ++ "/test",
      case rebar_file_utils:system_tmpdir(["test"]) of
          UnixTmpdir   -> ok;
          "./tmp/test" -> ok
      end.
  
  multi_tmpdir(_Config) ->
      UnixTmpdir = os:getenv("TMPDIR", "/tmp") ++ "/a/b/c",
      case rebar_file_utils:system_tmpdir(["a", "b", "c"]) of
          UnixTmpdir    -> ok;
          "./tmp/a/b/c" -> ok
      end.
  
  reset_nonexistent_dir(Config) ->
  
negative.code: 
  init_per_group(reset_dir, Config) ->
      TmpDir = rebar_file_utils:system_tmpdir(["rebar_file_utils_SUITE", "resetable"]),
      [{tmpdir, TmpDir} | Config];
  init_per_group(tmpdir, Config) ->
      PreviousTmpDir = os:getenv("TMPDIR"),
      os:putenv("TMPDIR", ?TMPDIR),
      [{previous_tmp, PreviousTmpDir} | Config];
  init_per_group(_, Config) -> Config.
  
  end_per_group(tmpdir, Config) ->
      case ?config(previous_tmp, Config) of
          false -> os:unsetenv("TMPDIR");
          Val -> os:putenv("TMPDIR", Val)
      end,
      Config;
  end_per_group(_, Config) -> Config.
  
  init_per_testcase(Test, Config) ->
  