aboutsummaryrefslogtreecommitdiffstats
path: root/lib/stdlib/test
diff options
context:
space:
mode:
authorHans Bolinder <[email protected]>2017-04-27 11:57:28 +0200
committerHans Bolinder <[email protected]>2017-04-27 11:57:28 +0200
commit89a66ab9110033350d6cd90ba9b3fe47252bc708 (patch)
tree9df65d3b7da87941a34282982673b6bf201b8a3e /lib/stdlib/test
parentd9c2e78d4e7b6166245e79a70bd4d95c8a1b742a (diff)
parent4567b6afc41a5d18384916c171ae413112ee57cc (diff)
downloadotp-89a66ab9110033350d6cd90ba9b3fe47252bc708.tar.gz
otp-89a66ab9110033350d6cd90ba9b3fe47252bc708.tar.bz2
otp-89a66ab9110033350d6cd90ba9b3fe47252bc708.zip
Merge branch 'hasse/unicode_atoms/OTP-14285'
* hasse/unicode_atoms/OTP-14285: stdlib: Add Unicode modifier t to control sequence a stdlib: Add Unicode modifier t to control sequences w and W
Diffstat (limited to 'lib/stdlib/test')
-rw-r--r--lib/stdlib/test/io_SUITE.erl24
1 files changed, 24 insertions, 0 deletions
diff --git a/lib/stdlib/test/io_SUITE.erl b/lib/stdlib/test/io_SUITE.erl
index b2754e47ba..ef3f0be5d7 100644
--- a/lib/stdlib/test/io_SUITE.erl
+++ b/lib/stdlib/test/io_SUITE.erl
@@ -2348,4 +2348,28 @@ otp_14285(_Config) ->
L1 = [S || C <- Chars, S <- io_lib:write_atom(list_to_atom([C])),
not is_latin1(S)],
L1 = lists:seq(256, 512),
+
+ latin1_fmt("~w", ['кирилли́ческий атом']),
+ latin1_fmt("~w", ['\x{10FFFF}']),
+ "'кирилли́ческий атом'" = fmt("~tw", ['кирилли́ческий атом']),
+ [$',16#10FFFF,$'] = fmt("~tw", ['\x{10FFFF}']),
+
+ latin1_fmt("~W", ['кирилли́ческий атом', 13]),
+ latin1_fmt("~W", ['\x{10FFFF}', 13]),
+ "'кирилли́ческий атом'" = fmt("~tW", ['кирилли́ческий атом', 13]),
+ [$',16#10FFFF,$'] = fmt("~tW", ['\x{10FFFF}', 13]),
+
+ {ok, [an_atom],[]} = io_lib:fread("~a", "an_atom"),
+ {ok, [an_atom],[]} = io_lib:fread("~ta", "an_atom"),
+ Str = "\"ab" ++ [1089] ++ "cd\"",
+ {ok, ["\"ab"], [1089]++"cd\""} = io_lib:fread("~s", Str),
+ {ok, ['\"ab'], [1089]++"cd\""} = io_lib:fread("~a", Str),
+ {ok,[Str], []} = io_lib:fread("~ts", Str),
+ {ok,[Atom],[]} = io_lib:fread("~ta", Str),
+ Str = atom_to_list(Atom),
+
ok.
+
+latin1_fmt(Fmt, Args) ->
+ L = fmt(Fmt, Args),
+ true = lists:all(fun is_latin1/1, L).