Keyboard

↓ ↑
move between the rows you can see
→
open a feature, then step into it
←
close a feature, or step out to the one above
Enter
go to the page in focus
Tab
the same rows, plus everything else on the page
/
search the whole report
m
open or close the navigation drawer
Esc
leave the search box, or close the drawer
?
this list

Converts each element of a list to an array

All 1 scenario 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.

The parameter is a List, so the element type is the array. Each element shows it.

expected outcome broken scenario
ScenarioInput valueElement type?Converted value?
String arrays[[a, b], [c]]String[]
    • a
    • b
    • c