diff options
author | alisdair sullivan <alisdair.sullivan@askuity.com> | 2015-09-14 11:46:53 -0700 |
---|---|---|
committer | alisdair sullivan <alisdair.sullivan@askuity.com> | 2015-09-14 11:46:53 -0700 |
commit | ae275c6396545defc80a765a6b835d01f4c76599 (patch) | |
tree | a58ef845596c5310cc2c0f1bb08b7032c06493c7 /test | |
parent | 6a8948544838073d5c5f829403ee7e7f1d6cf4d9 (diff) |
function name changes:
`reduce_path/1` -> `canonical_path/1`
`relative_path/2` -> `path_from_ancestor/2`
Diffstat (limited to 'test')
-rw-r--r-- | test/rebar_file_utils_SUITE.erl | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/test/rebar_file_utils_SUITE.erl b/test/rebar_file_utils_SUITE.erl index ba34723..0f444d5 100644 --- a/test/rebar_file_utils_SUITE.erl +++ b/test/rebar_file_utils_SUITE.erl @@ -11,8 +11,8 @@ reset_nonexistent_dir/1, reset_empty_dir/1, reset_dir/1, - relative_path/1, - reduce_path/1]). + path_from_ancestor/1, + canonical_path/1]). -include_lib("common_test/include/ct.hrl"). -include_lib("eunit/include/eunit.hrl"). @@ -22,7 +22,7 @@ all() -> [{group, tmpdir}, {group, reset_dir}, - relative_path, reduce_path]. + path_from_ancestor, canonical_path]. groups() -> [{tmpdir, [], [raw_tmpdir, empty_tmpdir, simple_tmpdir, multi_tmpdir]}, @@ -88,19 +88,19 @@ reset_dir(Config) -> ?assert(filelib:is_dir(TmpDir)), {ok, []} = file:list_dir(TmpDir). -relative_path(_Config) -> - ?assertEqual({ok, "foo/bar/baz"}, rebar_file_utils:relative_path("/foo/bar/baz", "/")), - ?assertEqual({ok, "bar/baz"}, rebar_file_utils:relative_path("/foo/bar/baz", "/foo")), - ?assertEqual({ok, "bar"}, rebar_file_utils:relative_path("foo/bar", "foo")), - ?assertEqual({ok, "bar"}, rebar_file_utils:relative_path("foo/bar/", "foo/")), - ?assertEqual({error, not_relative}, rebar_file_utils:relative_path("/foo/bar/baz", "/qux")), - ?assertEqual({error, not_relative}, rebar_file_utils:relative_path("/foo/bar/baz", "/foo/bar/baz/qux")). +path_from_ancestor(_Config) -> + ?assertEqual({ok, "foo/bar/baz"}, rebar_file_utils:path_from_ancestor("/foo/bar/baz", "/")), + ?assertEqual({ok, "bar/baz"}, rebar_file_utils:path_from_ancestor("/foo/bar/baz", "/foo")), + ?assertEqual({ok, "bar"}, rebar_file_utils:path_from_ancestor("foo/bar", "foo")), + ?assertEqual({ok, "bar"}, rebar_file_utils:path_from_ancestor("foo/bar/", "foo/")), + ?assertEqual({error, badparent}, rebar_file_utils:path_from_ancestor("/foo/bar/baz", "/qux")), + ?assertEqual({error, badparent}, rebar_file_utils:path_from_ancestor("/foo/bar/baz", "/foo/bar/baz/qux")). -reduce_path(_Config) -> - ?assertEqual("/", rebar_file_utils:reduce_path("/")), - ?assertEqual("/", rebar_file_utils:reduce_path("/../../..")), - ?assertEqual("/foo", rebar_file_utils:reduce_path("/foo/bar/..")), - ?assertEqual("/foo", rebar_file_utils:reduce_path("/foo/../foo")), - ?assertEqual("/foo", rebar_file_utils:reduce_path("/foo/.")), - ?assertEqual("/foo", rebar_file_utils:reduce_path("/foo/./.")), - ?assertEqual("/foo/bar", rebar_file_utils:reduce_path("/foo/./bar")).
\ No newline at end of file +canonical_path(_Config) -> + ?assertEqual("/", rebar_file_utils:canonical_path("/")), + ?assertEqual("/", rebar_file_utils:canonical_path("/../../..")), + ?assertEqual("/foo", rebar_file_utils:canonical_path("/foo/bar/..")), + ?assertEqual("/foo", rebar_file_utils:canonical_path("/foo/../foo")), + ?assertEqual("/foo", rebar_file_utils:canonical_path("/foo/.")), + ?assertEqual("/foo", rebar_file_utils:canonical_path("/foo/./.")), + ?assertEqual("/foo/bar", rebar_file_utils:canonical_path("/foo/./bar")).
\ No newline at end of file |