aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2012-08-02 10:07:58 +0200
committerBjörn Gustavsson <[email protected]>2012-08-06 10:20:57 +0200
commit85a5f71087785c4eada6a4101ffeef6a15f5c409 (patch)
tree96c7c52c2608a0a272381b8498b820cead9fb557
parent24ad2d1d985bbadb28dc8fe9dfee5e33c3bdcbbc (diff)
downloadotp-85a5f71087785c4eada6a4101ffeef6a15f5c409.tar.gz
otp-85a5f71087785c4eada6a4101ffeef6a15f5c409.tar.bz2
otp-85a5f71087785c4eada6a4101ffeef6a15f5c409.zip
compile_SUITE: Correct the forms_2 test case to work on Windows
Correct the forms_2 test case introduced in 2d785c07fbf9f533bf so that it will work on Windows. As originally written, the test case assumed that filename:absname("/foo/bar") would return "/foo/bar", which is not true on Windows (typically, the result will be "c:/foo/bar"). While at it, clean up indentation, the overlong line, and comments.
-rw-r--r--lib/compiler/test/compile_SUITE.erl30
1 files changed, 17 insertions, 13 deletions
diff --git a/lib/compiler/test/compile_SUITE.erl b/lib/compiler/test/compile_SUITE.erl
index 0dfa18490a..9dbfb5883b 100644
--- a/lib/compiler/test/compile_SUITE.erl
+++ b/lib/compiler/test/compile_SUITE.erl
@@ -106,19 +106,23 @@ file_1(Config) when is_list(Config) ->
ok.
forms_2(Config) when is_list(Config) ->
- {ok, simple, Binary} = compile:forms([{attribute,1,module,simple}], [binary, {source,"/foo/bar"}]),
- code:load_binary(simple, "/foo/bar", Binary),
- Info = simple:module_info(compile),
-
- %% Test proper source is returned.
- "/foo/bar" = proplists:get_value(source, Info),
- %% Ensure options is not polluted with the source.
- [] = proplists:get_value(options, Info),
-
- %% Cleanup.
- true = code:delete(simple),
- false = code:purge(simple),
- ok.
+ Src = "/foo/bar",
+ AbsSrc = filename:absname(Src),
+ {ok,simple,Binary} = compile:forms([{attribute,1,module,simple}],
+ [binary,{source,Src}]),
+ code:load_binary(simple, Src, Binary),
+ Info = simple:module_info(compile),
+
+ %% Test that the proper source is returned.
+ AbsSrc = proplists:get_value(source, Info),
+
+ %% Ensure that the options are not polluted with 'source'.
+ [] = proplists:get_value(options, Info),
+
+ %% Cleanup.
+ true = code:delete(simple),
+ false = code:purge(simple),
+ ok.
module_mismatch(Config) when is_list(Config) ->
?line DataDir = ?config(data_dir, Config),