aboutsummaryrefslogtreecommitdiffstats
path: root/lib/stdlib/test
diff options
context:
space:
mode:
authorHans Bolinder <[email protected]>2013-03-28 10:07:13 +0100
committerHans Bolinder <[email protected]>2013-03-28 10:07:13 +0100
commitb90269e836b72e1ceeacbbac697cd16aa529cd31 (patch)
tree242abc2987473c2821c1a84839de8543f490f190 /lib/stdlib/test
parenta3054e29956b5da4c5b56d83edcd15b6648b3958 (diff)
downloadotp-b90269e836b72e1ceeacbbac697cd16aa529cd31.tar.gz
otp-b90269e836b72e1ceeacbbac697cd16aa529cd31.tar.bz2
otp-b90269e836b72e1ceeacbbac697cd16aa529cd31.zip
Fix a bug in the Erlang scanner
The scanner did not crash when a floating point number was encountered in the input string.
Diffstat (limited to 'lib/stdlib/test')
-rw-r--r--lib/stdlib/test/erl_scan_SUITE.erl13
1 files changed, 11 insertions, 2 deletions
diff --git a/lib/stdlib/test/erl_scan_SUITE.erl b/lib/stdlib/test/erl_scan_SUITE.erl
index ecd181e87c..7e33166c6a 100644
--- a/lib/stdlib/test/erl_scan_SUITE.erl
+++ b/lib/stdlib/test/erl_scan_SUITE.erl
@@ -21,7 +21,8 @@
-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1,
init_per_group/2,end_per_group/2]).
--export([ error_1/1, error_2/1, iso88591/1, otp_7810/1, otp_10302/1]).
+-export([ error_1/1, error_2/1, iso88591/1, otp_7810/1, otp_10302/1,
+ otp_10990/1]).
-import(lists, [nth/2,flatten/1]).
-import(io_lib, [print/1]).
@@ -60,7 +61,7 @@ end_per_testcase(_Case, Config) ->
suite() -> [{ct_hooks,[ts_install_cth]}].
all() ->
- [{group, error}, iso88591, otp_7810, otp_10302].
+ [{group, error}, iso88591, otp_7810, otp_10302, otp_10990].
groups() ->
[{error, [], [error_1, error_2]}].
@@ -1121,6 +1122,14 @@ otp_10302(Config) when is_list(Config) ->
erl_parse:abstract("a"++[1024]++"c", [{encoding,latin1}]),
ok.
+otp_10990(doc) ->
+ "OTP-10990. Floating point number in input string.";
+otp_10990(suite) ->
+ [];
+otp_10990(Config) when is_list(Config) ->
+ {'EXIT',_} = (catch {foo, erl_scan:string([$",42.0,$"],1)}),
+ ok.
+
test_string(String, Expected) ->
{ok, Expected, _End} = erl_scan:string(String),
test(String).