From 85a5f71087785c4eada6a4101ffeef6a15f5c409 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= Date: Thu, 2 Aug 2012 10:07:58 +0200 Subject: 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. --- lib/compiler/test/compile_SUITE.erl | 30 +++++++++++++++++------------- 1 file 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), -- cgit v1.2.3