File tree Expand file tree Collapse file tree 2 files changed +5
-10
lines changed
Expand file tree Collapse file tree 2 files changed +5
-10
lines changed Original file line number Diff line number Diff line change @@ -687,14 +687,9 @@ defmodule Path do
687687
688688 defp resolve_home ( rest ) do
689689 case { rest , major_os_type ( ) } do
690- { "\\ " <> _ , :win32 } ->
691- System . user_home! ( ) <> rest
692-
693- { "/" <> _ , _ } ->
694- System . user_home! ( ) <> rest
695-
696- _ ->
697- rest
690+ { "\\ " <> _ , :win32 } -> System . user_home! ( ) <> rest
691+ { "/" <> _ , _ } -> System . user_home! ( ) <> rest
692+ _ -> "~" <> rest
698693 end
699694 end
700695
Original file line number Diff line number Diff line change @@ -135,9 +135,9 @@ defmodule PathTest do
135135
136136 assert Path . expand ( "~/file" ) == Path . join ( home , "file" )
137137 assert Path . expand ( "~/file" , "whatever" ) == Path . join ( home , "file" )
138- assert Path . expand ( "file" , Path . expand ( "~" ) ) == Path . expand ( "~/ file")
138+ assert Path . expand ( "file" , Path . expand ( "~" ) ) == Path . join ( home , " file")
139139 assert Path . expand ( "file" , "~" ) == Path . join ( home , "file" )
140- assert Path . expand ( "~file" ) == Path . join ( File . cwd! ( ) , "file" )
140+ assert Path . expand ( "~file" ) == Path . join ( File . cwd! ( ) , "~ file" )
141141 end
142142
143143 test "expand/1,2" do
You can’t perform that action at this time.
0 commit comments