diff --git a/packages/realm_dart/lib/realm.dart b/packages/realm_dart/lib/realm.dart index b6935627e..319b3a140 100644 --- a/packages/realm_dart/lib/realm.dart +++ b/packages/realm_dart/lib/realm.dart @@ -3,4 +3,4 @@ // dart.library.cli is available only on dart desktop export 'src/realm_flutter.dart' if (dart.library.cli) 'src/realm_dart.dart'; -export 'package:ejson/ejson.dart'; +export 'package:ejson/ejson.dart'; \ No newline at end of file diff --git a/packages/realm_dart/test/results_test.dart b/packages/realm_dart/test/results_test.dart index add587f33..cd23180ee 100644 --- a/packages/realm_dart/test/results_test.dart +++ b/packages/realm_dart/test/results_test.dart @@ -1550,4 +1550,18 @@ void main() { expect(results.skip(2), results.toList().sublist(2)); expect(results.skip(2).take(3), [results[2], results[3], results[4]]); }); + + test('BETWEEN op', () { + final realm = getRealm(Configuration.local([Friend.schema, Party.schema])); + + final alice = Friend('alice', age: 36); + final bob = Friend('bob', age: 49, bestFriend: alice); + alice.bestFriend = bob; + + realm.write(() => realm.addAll([alice, bob])); + + expect(realm.query(r'age BETWEEN {$0, $1}', [20, 40]), [alice]); + // the following used to fail due to: https://github.com/realm/realm-core/issues/7935 + expect(realm.query(r'bestFriend.age BETWEEN {$0, $1}', [20, 40]), [bob]); + }); } diff --git a/packages/realm_dart/test/test.dart b/packages/realm_dart/test/test.dart index 624eac951..b2f13b2ae 100644 --- a/packages/realm_dart/test/test.dart +++ b/packages/realm_dart/test/test.dart @@ -258,6 +258,9 @@ class _Friend { var age = 42; _Friend? bestFriend; final friends = <_Friend>[]; + + @override + String toString() => '$name $age'; } @RealmModel()