File tree Expand file tree Collapse file tree 8 files changed +4
-24
lines changed
src/main/java/org/truffleruby/core/format/printf Expand file tree Collapse file tree 8 files changed +4
-24
lines changed Original file line number Diff line number Diff line change @@ -60,6 +60,7 @@ Bug fixes:
60
60
* Fixed ` String#capitalize! ` for strings that weren't full ASCII.
61
61
* Fixed enumeration issue in ` ENV.{select, filter} ` .
62
62
* Fixed ` Complex ` and ` Rational ` should be frozen after initializing.
63
+ * Fixed ` printf ` should raise error when not enough arguments for positional argument.
63
64
64
65
Compatibility:
65
66
Original file line number Diff line number Diff line change 1
1
fails:File#printf other formats c raises ArgumentError if argument is an empty string
2
2
fails:File#printf other formats c supports Unicode characters
3
3
fails:File#printf other formats s does not try to convert with to_str
4
- fails:File#printf flags (digit)$ raises exception if argument number is bigger than actual arguments list
5
4
fails:File#printf flags # applies to format o does nothing for negative argument
6
5
fails:File#printf flags # applies to formats bBxX does nothing for zero argument
7
6
fails:File#printf flags # applies to formats aAeEfgG forces a decimal point to be added, even if no digits follow
Original file line number Diff line number Diff line change @@ -116,7 +116,6 @@ fails:Kernel.printf formatting io is specified reference by name %{name} style c
116
116
fails:Kernel.printf formatting io is not specified other formats c raises ArgumentError if argument is an empty string
117
117
fails:Kernel.printf formatting io is not specified other formats c supports Unicode characters
118
118
fails:Kernel.printf formatting io is not specified other formats s does not try to convert with to_str
119
- fails:Kernel.printf formatting io is not specified flags (digit)$ raises exception if argument number is bigger than actual arguments list
120
119
fails:Kernel.printf formatting io is not specified flags # applies to format o does nothing for negative argument
121
120
fails:Kernel.printf formatting io is not specified flags # applies to formats bBxX does nothing for zero argument
122
121
fails:Kernel.printf formatting io is not specified flags # applies to formats aAeEfgG forces a decimal point to be added, even if no digits follow
Original file line number Diff line number Diff line change @@ -4,7 +4,6 @@ fails:Kernel#sprintf raises Encoding::CompatibilityError if both encodings are A
4
4
fails:Kernel#sprintf other formats c raises ArgumentError if argument is an empty string
5
5
fails:Kernel#sprintf other formats c supports Unicode characters
6
6
fails:Kernel#sprintf other formats s does not try to convert with to_str
7
- fails:Kernel#sprintf flags (digit)$ raises exception if argument number is bigger than actual arguments list
8
7
fails:Kernel#sprintf flags # applies to format o does nothing for negative argument
9
8
fails:Kernel#sprintf flags # applies to formats bBxX does nothing for zero argument
10
9
fails:Kernel#sprintf flags # applies to formats aAeEfgG forces a decimal point to be added, even if no digits follow
@@ -21,7 +20,6 @@ fails:Kernel.sprintf raises Encoding::CompatibilityError if both encodings are A
21
20
fails:Kernel.sprintf other formats c raises ArgumentError if argument is an empty string
22
21
fails:Kernel.sprintf other formats c supports Unicode characters
23
22
fails:Kernel.sprintf other formats s does not try to convert with to_str
24
- fails:Kernel.sprintf flags (digit)$ raises exception if argument number is bigger than actual arguments list
25
23
fails:Kernel.sprintf flags # applies to format o does nothing for negative argument
26
24
fails:Kernel.sprintf flags # applies to formats bBxX does nothing for zero argument
27
25
fails:Kernel.sprintf flags # applies to formats aAeEfgG forces a decimal point to be added, even if no digits follow
Original file line number Diff line number Diff line change @@ -9,7 +9,6 @@ fails:String#% other formats c raises ArgumentError if argument is an empty stri
9
9
fails:String#% other formats c supports Unicode characters
10
10
fails:String#% other formats s does not try to convert with to_str
11
11
fails:String#% other formats % alone raises an ArgumentError
12
- fails:String#% flags (digit)$ raises exception if argument number is bigger than actual arguments list
13
12
fails:String#% flags # applies to format o does nothing for negative argument
14
13
fails:String#% flags # applies to formats bBxX does nothing for zero argument
15
14
fails:String#% flags # applies to formats aAeEfgG forces a decimal point to be added, even if no digits follow
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -2,7 +2,6 @@ fails:StringIO#printf formatting other formats c raises ArgumentError if argumen
2
2
fails:StringIO#printf formatting other formats c supports Unicode characters
3
3
fails:StringIO#printf formatting other formats s does not try to convert with to_str
4
4
fails:StringIO#printf formatting other formats % is escaped by %
5
- fails:StringIO#printf formatting flags (digit)$ raises exception if argument number is bigger than actual arguments list
6
5
fails:StringIO#printf formatting flags # applies to format o does nothing for negative argument
7
6
fails:StringIO#printf formatting flags # applies to formats bBxX does nothing for zero argument
8
7
fails:StringIO#printf formatting flags # applies to formats aAeEfgG forces a decimal point to be added, even if no digits follow
Original file line number Diff line number Diff line change @@ -106,6 +106,9 @@ public List<SprintfConfig> parse() {
106
106
if (config .getAbsoluteArgumentIndex () != null ) {
107
107
throw new InvalidFormatException ("value given twice - " + r .getNumber () + "$" );
108
108
}
109
+ if (arguments .length < r .getNumber ()) {
110
+ throw new InvalidFormatException ("too few arguments" );
111
+ }
109
112
checkPosArg (argType , r .getNumber ());
110
113
argType = ArgType .NUMBERED ;
111
114
argTypeSet = true ;
You can’t perform that action at this time.
0 commit comments