Converts a list to an array of either decimal width
All 3 scenarios hold
A [bracketed] list converts to an array parameter for any element type: object, primitive, nested, or map. An array also nests inside another collection parameter.
Every table below reads the same way. Input value is the text as written in the cell, quoted so that it stays text. Parameter type is the array type the test method declares. Converted value is the array the method received, one entry per element.
A family of array types that convert the same text shares one table. The value column's own header names the type there, in place of a column of its own. Each column holds the list that its own type receives. A cell that fails to convert never reaches the test method, so every row that runs is a row that converted.
The map rule is the exception. Its input column is unquoted, because that column is the array itself. The published cell therefore shows the parsed value, and not the text. The rule reports the keys and the values in place of a converted value, because Java's map notation is not a TableTest format.
| Scenario | float[] | double[] | Converted value? |
|---|---|---|---|
| Single element |
|
| [1.5] |
| Several |
|
| [1.25, 2.5, 3.75] |
| Empty list | [] | [] | [] |