| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 package memory | 5 package memory |
| 6 | 6 |
| 7 import ( | 7 import ( |
| 8 "fmt" | 8 "fmt" |
| 9 "strings" | 9 "strings" |
| 10 "testing" | 10 "testing" |
| (...skipping 528 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 539 err := r
unner(func(c context.Context) error { | 539 err := r
unner(func(c context.Context) error { |
| 540
data := ds.Get(c) | 540
data := ds.Get(c) |
| 541
count, err := data.Count(expect.q) | 541
count, err := data.Count(expect.q) |
| 542
So(err, ShouldBeNil) | 542
So(err, ShouldBeNil) |
| 543
So(count, ShouldEqual, expect.count) | 543
So(count, ShouldEqual, expect.count) |
| 544 | 544 |
| 545
rslt := []ds.PropertyMap(nil) | 545
rslt := []ds.PropertyMap(nil) |
| 546
So(data.GetAll(expect.q, &rslt), ShouldBeNil) | 546
So(data.GetAll(expect.q, &rslt), ShouldBeNil) |
| 547
So(len(rslt), ShouldEqual, len(expect.get)) | 547
So(len(rslt), ShouldEqual, len(expect.get)) |
| 548
for i, r := range rslt { | 548
for i, r := range rslt { |
| 549 » » » » » » » » » »
» So(r, ShouldResembleV, expect.get[i]) | 549 » » » » » » » » » »
» So(r, ShouldResemble, expect.get[i]) |
| 550
} | 550
} |
| 551
return nil | 551
return nil |
| 552 }, &ds.T
ransactionOptions{XG: true}) | 552 }, &ds.T
ransactionOptions{XG: true}) |
| 553 So(err,
ShouldBeNil) | 553 So(err,
ShouldBeNil) |
| 554 }) | 554 }) |
| 555 } | 555 } |
| 556 } | 556 } |
| 557 | 557 |
| 558 for j, fn := range stage.extraFn
s { | 558 for j, fn := range stage.extraFn
s { |
| 559 Convey(fmt.Sprintf("extr
aFn %d", j), func() { | 559 Convey(fmt.Sprintf("extr
aFn %d", j), func() { |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 591 count, err := data.Count(q) | 591 count, err := data.Count(q) |
| 592 So(err, ShouldErrLike, "Insufficient indexes") | 592 So(err, ShouldErrLike, "Insufficient indexes") |
| 593 | 593 |
| 594 testing.AutoIndex(true) | 594 testing.AutoIndex(true) |
| 595 | 595 |
| 596 count, err = data.Count(q) | 596 count, err = data.Count(q) |
| 597 So(err, ShouldBeNil) | 597 So(err, ShouldBeNil) |
| 598 So(count, ShouldEqual, 2) | 598 So(count, ShouldEqual, 2) |
| 599 }) | 599 }) |
| 600 } | 600 } |
| OLD | NEW |