( array_init )
凡例
| → | 対応コードあり |
| → | 直接対応していないが代替の書き方あり |
| → | 対応コードなし |
| - | 未確認 |
| ( .. ) | ローカライズまだ |
| Example | Python pytest |
PHP PHPUnit |
Swift Testing |
Csharp xunit |
Bash bats |
Powershell pester |
C++ GoogleTest |
JavaScript Jest |
Kotlin jUnit |
|---|---|---|---|---|---|---|---|---|---|
| ( init_empty_array ) | [] | - | items: [Int] = [] | - | declare -a items=() | - | {} | - | emptyList<Type> |
| ( init_empty_set ) | set() | - | TODO: .. | - | - | - | {} | - | emptySet<Type> |
| ( init_array ) | [1, 2, 3] | $items = [1, 2, 3] | [ .. ] | - | declare -a items=(1 2 3) | - | { ... } | - | listOf( .. ) |
| ( init_tuple ) | (1, 2, 3) | - | ( .. ) | - | - | - | - | - | - |
| ( is_tuple_allows_size_1 ) | Yes | - | No | - | - | - | - | - | - |
| ( init_array_ignores_last_separator ) | Yes | Yes | - | - | Yes | - | - | - | - |
| ( init_set ) | { .. } | - | - | - | - | - | - | - | - |
| ( sequence_1_to_n ) | range(1, n+1) | range(1, n) | - | - | seq 1 n | - | - | - | 1..N |
| ( sequence_n_to_1 ) | range(n, 0, -1) | range(n, 1) | - | - | seq n -1 1 | - | - | - | - |
| ( sequence_step_by_x ) | range(1, n+1, x) | range(1, n, x) | - | - | seq 1 x n | - | - | - | - |
| ( sequence_a_to_z ) | → | range('a', 'z') | - | - | ({a..z}) | - | - | - | - |
| ( init_array_with_size ) | items = [x] * n | array_fill(0, n, x) | - | - | → | - | - | - | - |
| ( immutable_array ) | tuple | - | - | - | - | - | - | - | - |
| ( immutable_set ) | frozenset | - | - | - | - | - | - | - | - |
| ( named_tuple ) | namedtuple('T', ['x', 'y']) | - | (x: 1, y: 2) | - | - | - | - | - | - |
| ( set_to_array ) | list(s) | - | - | - | - | - | items(s.begin(), s.end()) | - | - |
| ( init_emptyray ) | - | $items = [] | - | - | - | - | - | - | - |
| ( sequence_ato_z ) | - | - | - | - | - | - | - | - | 'a'..'z' |
| ( test_immutable_array ) | - | - | - | - | - | - | - | - | → |
| ( test_immutable_set ) | - | - | - | - | - | - | - | - | → |