From 95189a3a371b8b5d85f0c0ef25813a4c9f2ee438 Mon Sep 17 00:00:00 2001 From: Ari Lazier Date: Mon, 17 Aug 2015 11:46:08 -0700 Subject: [PATCH] a few more tests --- tests/RealmTests.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/RealmTests.js b/tests/RealmTests.js index b6f6ce9d..fed846ba 100644 --- a/tests/RealmTests.js +++ b/tests/RealmTests.js @@ -116,6 +116,7 @@ var RealmTests = { testRealmObjects: function() { var realm = new Realm({schema: [PersonObject]}); realm.write(function() { + realm.create('PersonObject', ['Ari', 10]); realm.create('PersonObject', ['Tim', 11]); realm.create('PersonObject', {'name': 'Bjarne', 'age': 12}); realm.create('PersonObject', {'name': 'Alex', 'age': 12}); @@ -137,12 +138,14 @@ var RealmTests = { realm.objects('PersonObject', []); }); - TestCase.assertEqual(realm.objects('PersonObject').length, 3); + TestCase.assertEqual(realm.objects('PersonObject').length, 4); TestCase.assertEqual(realm.objects('PersonObject', 'age = 11').length, 1); TestCase.assertEqual(realm.objects('PersonObject', 'age = 11')[0].name, 'Tim'); TestCase.assertEqual(realm.objects('PersonObject', 'age = 12').length, 2); TestCase.assertEqual(realm.objects('PersonObject', 'age = 13').length, 0); - TestCase.assertEqual(realm.objects('PersonObject', 'age < 12').length, 1); + TestCase.assertEqual(realm.objects('PersonObject', 'age < 12').length, 2); + TestCase.assertEqual(realm.objects('PersonObject', 'age > 10 && age < 13').length, 3); + TestCase.assertEqual(realm.objects('PersonObject', 'age >= 11 && age < 13').length, 3); TestCase.assertEqual(realm.objects('PersonObject', 'name = \'Tim\'').length, 1); },