Skip to content

Commit 54c5f62

Browse files
committed
updated doc message to be consistent with other apis, used proper variables in tests
1 parent f625f3b commit 54c5f62

File tree

2 files changed

+17
-9
lines changed

2 files changed

+17
-9
lines changed

packages/amplify_core/lib/src/types/storage/list_options.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class StorageListOptions
2828
/// {@macro amplify_core.storage.list_plugin_options}
2929
final StorageListPluginOptions? pluginOptions;
3030

31-
/// an optional bucket to specify which bucket to return the list for
31+
/// Optionally specify which bucket to retrieve
3232
final StorageBucket? bucket;
3333

3434
/// an optional bucket to specify which bucket to return the list for

packages/storage/amplify_storage_s3/example/integration_test/list_test.dart

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,16 +33,20 @@ void main() {
3333
);
3434
setUpAll(() async {
3535
await configure(amplifyEnvironments['main']!);
36-
for (var i = 0; i < 4; i++) {
36+
for (var pathIndex = 0;
37+
pathIndex < uploadedPaths.length ~/ 2;
38+
pathIndex++) {
3739
await Amplify.Storage.uploadData(
38-
path: StoragePath.fromString(uploadedPaths[i]),
40+
path: StoragePath.fromString(uploadedPaths[pathIndex]),
3941
data: StorageDataPayload.bytes('test content'.codeUnits),
4042
bucket: mainBucket,
4143
).result;
4244
}
43-
for (var i = 4; i < 8; i++) {
45+
for (var pathIndex = uploadedPaths.length ~/ 2;
46+
pathIndex < uploadedPaths.length;
47+
pathIndex++) {
4448
await Amplify.Storage.uploadData(
45-
path: StoragePath.fromString(uploadedPaths[i]),
49+
path: StoragePath.fromString(uploadedPaths[pathIndex]),
4650
data: StorageDataPayload.bytes('test content'.codeUnits),
4751
bucket: secondaryBucket,
4852
).result;
@@ -64,17 +68,21 @@ void main() {
6468
bucket: secondaryBucket,
6569
),
6670
).result;
67-
for (var i = 0; i < 4; i++) {
71+
for (var pathIndex = 0;
72+
pathIndex < uploadedPaths.length ~/ 2;
73+
pathIndex++) {
6874
expect(
6975
listResultMainBucket.items
70-
.any((item) => item.path == uploadedPaths[i]),
76+
.any((item) => item.path == uploadedPaths[pathIndex]),
7177
isTrue,
7278
);
7379
}
74-
for (var i = 4; i < 8; i++) {
80+
for (var pathIndex = uploadedPaths.length ~/ 2;
81+
pathIndex < uploadedPaths.length;
82+
pathIndex++) {
7583
expect(
7684
listResultSecondaryBucket.items
77-
.any((item) => item.path == uploadedPaths[i]),
85+
.any((item) => item.path == uploadedPaths[pathIndex]),
7886
isTrue,
7987
);
8088
}

0 commit comments

Comments
 (0)