From 03b8b273e972ad1cb2b4a5e4a68a7c2ca4a29640 Mon Sep 17 00:00:00 2001 From: Luis Rascao Date: Tue, 27 Sep 2016 19:48:13 +0100 Subject: Add test coverage for the extended bin script --- test/rlx_test_utils.erl | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'test/rlx_test_utils.erl') diff --git a/test/rlx_test_utils.erl b/test/rlx_test_utils.erl index 279a887..2e6045f 100644 --- a/test/rlx_test_utils.erl +++ b/test/rlx_test_utils.erl @@ -80,6 +80,13 @@ test_template_contents() -> "{prop1, \"{{prop1}}\"}.\n" "{prop2, {{prop2}}}.\n". +escript_contents() -> + "#!/usr/bin/env escript\n" + "\n" + "main(_Args) ->\n" + "io:format(\"~s\n\",\n" + " [os:getenv(\"RELEASE_ROOT_DIR\")]).\n". + -ifdef(rand_module). random_uniform(N) -> rand:uniform(N). @@ -88,3 +95,12 @@ random_uniform(N) -> random:seed(os:timestamp()), random:uniform(N). -endif. + +list_to_term(String) -> + {ok, T, _} = erl_scan:string(String++"."), + case erl_parse:parse_term(T) of + {ok, Term} -> + Term; + {error, Error} -> + Error + end. -- cgit v1.2.3