From e31bb921c799c5782ecf7db8d2521a5e71167f22 Mon Sep 17 00:00:00 2001 From: Jan Uhlig Date: Mon, 24 Jun 2024 15:02:35 +0200 Subject: [PATCH] Add format string tests --- lib/stdlib/test/io_SUITE.erl | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/lib/stdlib/test/io_SUITE.erl b/lib/stdlib/test/io_SUITE.erl index 877e4eec75f7..82fc97f6b4c8 100644 --- a/lib/stdlib/test/io_SUITE.erl +++ b/lib/stdlib/test/io_SUITE.erl @@ -3135,7 +3135,15 @@ error_info(Config) -> {Format,["~s",["Спутник-1"]],[{1,"failed to format string"}]}, {Format,["~s",[1]],[{2,"1 must be of type string"}]}, {Format,["~s~s",[a,1]],[{2,"2 must be of type string"}]}, - {Format,["~s",[[a]]],[{2,"1 must be of type string"}]}] || Format <- [format,fwrite]] + {Format,["~s",[[a]]],[{2,"1 must be of type string"}]}, + + %% Ensure error messages contain the correct reason (GH-8568) + {Format, ["~ltkKltkKp", []], [{1,"wrong number of arguments"}]}, + {Format, ["~ltkKltkKm", [undefined, ordered, a]], [{1,"format string"}]}, + {Format, ["~ltkKltkKb", [undefined, ordered, a]], [{2,"3 must be of type integer"}]}, + {Format, ["~ltkKp", [foo, #{a => b}]], [{2,"1 must be 'undefined', 'ordered', 'reversed', or a fun that takes two arguments"}]} + ] + || Format <- [format,fwrite]] ],