aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Klötzke <[email protected]>2012-06-23 20:36:59 +0200
committerU-AXEL\Jan <Jan@Axel.(none)>2012-07-30 22:01:05 +0200
commitf2b8bdca45a275fe95089c57049172157fecd53c (patch)
treec48d116507c5af9aaebe10a04a5a8d3b033b9fec
parent92eb89bd630e822cfc93a07dad7d6c7a25f45d63 (diff)
downloadotp-f2b8bdca45a275fe95089c57049172157fecd53c.tar.gz
otp-f2b8bdca45a275fe95089c57049172157fecd53c.tar.bz2
otp-f2b8bdca45a275fe95089c57049172157fecd53c.zip
Add filename:nativename/1 binary argument test to suite
The filename module accepts binaries as file names. Add a test for filename:nativename/1 with binary input data as it currently fails on win32.
-rw-r--r--lib/stdlib/test/filename_SUITE.erl15
1 files changed, 13 insertions, 2 deletions
diff --git a/lib/stdlib/test/filename_SUITE.erl b/lib/stdlib/test/filename_SUITE.erl
index 4cfa589660..99516c0c04 100644
--- a/lib/stdlib/test/filename_SUITE.erl
+++ b/lib/stdlib/test/filename_SUITE.erl
@@ -25,7 +25,7 @@
-export([pathtype/1,rootname/1,split/1,find_src/1]).
-export([absname_bin/1, absname_bin_2/1,
basename_bin_1/1, basename_bin_2/1,
- dirname_bin/1, extension_bin/1, join_bin/1]).
+ dirname_bin/1, extension_bin/1, join_bin/1, t_nativename_bin/1]).
-export([pathtype_bin/1,rootname_bin/1,split_bin/1]).
-include_lib("test_server/include/test_server.hrl").
@@ -38,7 +38,7 @@ all() ->
join, pathtype, rootname, split, t_nativename, find_src,
absname_bin, absname_bin_2, basename_bin_1, basename_bin_2, dirname_bin,
extension_bin,
- join_bin, pathtype_bin, rootname_bin, split_bin].
+ join_bin, pathtype_bin, rootname_bin, split_bin, t_nativename_bin].
groups() ->
[].
@@ -804,3 +804,14 @@ split_bin(Config) when is_list(Config) ->
ok
end.
+t_nativename_bin(Config) when is_list(Config) ->
+ ?line <<"abcedf">> = filename:nativename(<<"abcedf">>),
+ case os:type() of
+ {win32, _} ->
+ ?line <<"a:\\temp\\arne.exe">> =
+ filename:nativename(<<"A:/temp//arne.exe/">>);
+ _ ->
+ ?line <<"/usr/tmp/arne">> =
+ filename:nativename(<<"/usr/tmp//arne/">>)
+ end.
+