mboudreau / Alternator

A mock DynamoDB that runs locally for testing purposes - DEPRECATED, PLEASE USE DYNAMODB LOCAL: https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/DynamoDBLocal.html
Apache License 2.0
78 stars 39 forks source link

Minor bug fix for .scan with limit higher than result set size. #47

Closed rrutt closed 12 years ago

rrutt commented 12 years ago

If a limit is passed in a scan request, and the limit is larger than the number of items that meet the scan criteria, a bounds exception was thrown by the .subList method.

This fix checks the limit vs. the original items.size() to determine if .subList is required.

Two additional unit tests were added to exercise both "low" and "high" limits. The "high" limit was the one that previously triggered an exception.