We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0a53a47 commit 0fbf8c7Copy full SHA for 0fbf8c7
objectbox/test/query_property_test.dart
@@ -152,6 +152,25 @@ void main() {
152
query.close();
153
});
154
155
+ test('.sum integers overflow', () {
156
+ box.removeAll();
157
+ // Max int for Dart native (64-bit signed integer).
158
+ box.put(TestEntity(tLong: 0x7fffffffffffffff));
159
+ box.put(TestEntity(tLong: 1));
160
+
161
+ expect(box.get(1)!.tLong, 0x7fffffffffffffff);
162
+ expect(box.get(2)!.tLong, 1);
163
164
+ final query = box.query().build();
165
+ expect(() {
166
+ query.property(tLong).sum();
167
+ },
168
+ throwsA(predicate((e) =>
169
+ e is NumericOverflowException &&
170
+ e.message == "Numeric overflow: 9223372036854775808 high: 0")));
171
+ query.close();
172
+ });
173
174
test('.min integers', () {
175
box.putMany(integerList());
176
0 commit comments