aboutsummaryrefslogtreecommitdiffstats
path: root/lib/erl_interface/test/ei_format_SUITE.erl
diff options
context:
space:
mode:
authorSteve Vinoski <[email protected]>2010-10-06 11:28:08 -0400
committerSteve Vinoski <[email protected]>2010-10-06 11:28:08 -0400
commit386050e35675d3e4336f48a19b8562f9a62c1624 (patch)
tree8be3626133c7e7d696640f6c315b4d1dfcf3db7f /lib/erl_interface/test/ei_format_SUITE.erl
parentd8f8eeba477fd8872f1136fc507fa299f013cc46 (diff)
downloadotp-386050e35675d3e4336f48a19b8562f9a62c1624.tar.gz
otp-386050e35675d3e4336f48a19b8562f9a62c1624.tar.bz2
otp-386050e35675d3e4336f48a19b8562f9a62c1624.zip
teach ei_x_format to handle unary - and +
Teach the format string parser used for ei_x_format() and ei_x_format_wo_ver() about unary negative and positive operators on numbers. Previously, passing a negative numeric constant or a positive numeric constant with an explicit leading plus sign within the format string would cause these functions to fail. Augment the format_wo_ver unit test in the ei_format suite with a regression test for these cases. An easy way to reproduce the problem is to use erl_call: erl_call -s foo@bar -a 'erlang list_to_integer [-1]' Without this change, erl_call fails with a -1 exit status. With this change, it properly prints "-1".
Diffstat (limited to 'lib/erl_interface/test/ei_format_SUITE.erl')
-rw-r--r--lib/erl_interface/test/ei_format_SUITE.erl2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/erl_interface/test/ei_format_SUITE.erl b/lib/erl_interface/test/ei_format_SUITE.erl
index 7871f07ae9..cbe9fa52d7 100644
--- a/lib/erl_interface/test/ei_format_SUITE.erl
+++ b/lib/erl_interface/test/ei_format_SUITE.erl
@@ -155,7 +155,7 @@ format_wo_ver(suite) -> [];
format_wo_ver(Config) when is_list(Config) ->
?line P = runner:start(?format_wo_ver),
- ?line {term, [{a, "b"}, {c, 10}]} = get_term(P),
+ ?line {term, [-1, 2, {a, "b"}, {c, 10}]} = get_term(P),
?line runner:recv_eot(P),
ok.