diff options
author | Björn Gustavsson <[email protected]> | 2017-10-05 13:10:42 +0200 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2017-10-13 11:55:47 +0200 |
commit | 20c2b1b174b44ed24afe73b3ac604e14d8c9318f (patch) | |
tree | 12de0b016a086e9bfc45ee498f201e36fe4c6e6f /erts/emulator/test/port_SUITE.erl | |
parent | 0f2e313475bae2d3870333b0340e8453bbff51a5 (diff) | |
download | otp-20c2b1b174b44ed24afe73b3ac604e14d8c9318f.tar.gz otp-20c2b1b174b44ed24afe73b3ac604e14d8c9318f.tar.bz2 otp-20c2b1b174b44ed24afe73b3ac604e14d8c9318f.zip |
Eliminate use of deprecated functions in string
Diffstat (limited to 'erts/emulator/test/port_SUITE.erl')
-rw-r--r-- | erts/emulator/test/port_SUITE.erl | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/erts/emulator/test/port_SUITE.erl b/erts/emulator/test/port_SUITE.erl index 730a17d7e8..f29528a22f 100644 --- a/erts/emulator/test/port_SUITE.erl +++ b/erts/emulator/test/port_SUITE.erl @@ -1662,13 +1662,7 @@ spawn_executable(Config) when is_list(Config) -> [ExactFile2,"hello world","dlrow olleh"] = run_echo_args_2(unicode:characters_to_binary("\""++ExactFile2++"\" "++"\"hello world\" \"dlrow olleh\"")), - ExeExt = - case string:to_lower(lists:last(string:tokens(ExactFile2,"."))) of - "exe" -> - ".exe"; - _ -> - "" - end, + ExeExt = filename:extension(ExactFile2), Executable2 = "spoky name"++ExeExt, file:copy(ExactFile1,filename:join([SpaceDir,Executable2])), ExactFile3 = filename:nativename(filename:join([SpaceDir,Executable2])), @@ -1836,7 +1830,7 @@ collect_data(Port) -> end. parse_echo_args_output(Data) -> - [lists:last(string:tokens(S,"|")) || S <- string:tokens(Data,"\r\n")]. + [lists:last(string:lexemes(S,"|")) || S <- string:lexemes(Data,["\r\n",$\n])]. %% Test that the emulator does not mix up ports when the port table wraps mix_up_ports(Config) when is_list(Config) -> @@ -1962,7 +1956,7 @@ max_ports() -> erlang:system_info(port_limit). port_ix(Port) when is_port(Port) -> - ["#Port",_,PortIxStr] = string:tokens(erlang:port_to_list(Port), + ["#Port",_,PortIxStr] = string:lexemes(erlang:port_to_list(Port), "<.>"), list_to_integer(PortIxStr). |