Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(227)

Side by Side Diff: impl/memory/datastore_query_execution_test.go

Issue 2517833002: Fix #66. (Closed)
Patch Set: Move test Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « impl/memory/datastore_index_test.go ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The LUCI Authors. All rights reserved. 1 // Copyright 2015 The LUCI Authors. All rights reserved.
2 // Use of this source code is governed under the Apache License, Version 2.0 2 // Use of this source code is governed under the Apache License, Version 2.0
3 // that can be found in the LICENSE file. 3 // that can be 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 493 matching lines...) Expand 10 before | Expand all | Expand 10 after
504 }, 504 },
505 }, 505 },
506 506
507 { 507 {
508 q: nq("Kind").Offset(2), 508 q: nq("Kind").Offset(2),
509 get: []ds.PropertyMap{}, 509 get: []ds.PropertyMap{},
510 }, 510 },
511 }, 511 },
512 }, 512 },
513 }}, 513 }},
514
515 {"regression: avoid index bleedover for common fields in compound indice s", []qExStage{
516 {
517 addIdxs: []*ds.IndexDefinition{
518 indx("Kind", "A", "B"),
519 indx("Other", "A", "B"),
520 },
521 putEnts: []ds.PropertyMap{
522 pmap(
523 "$key", key("Kind", 1), Next,
524 "A", "value", Next,
525 "B", "value", Next),
526 },
527 },
528 {
529 expect: []qExpect{
530 {
531 q: nq("Other").Eq("A", "value").Order( "B"),
532 get: []ds.PropertyMap{},
533 },
534 },
535 },
536 }},
514 } 537 }
515 538
516 func TestQueryExecution(t *testing.T) { 539 func TestQueryExecution(t *testing.T) {
517 t.Parallel() 540 t.Parallel()
518 541
519 Convey("Test query execution", t, func() { 542 Convey("Test query execution", t, func() {
520 c, err := info.Namespace(Use(context.Background()), "ns") 543 c, err := info.Namespace(Use(context.Background()), "ns")
521 if err != nil { 544 if err != nil {
522 panic(err) 545 panic(err)
523 } 546 }
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
661 684
662 v, ok := actual.(error) 685 v, ok := actual.(error)
663 if !ok { 686 if !ok {
664 return fmt.Sprintf("type of 'actual' must be error, not %T", act ual) 687 return fmt.Sprintf("type of 'actual' must be error, not %T", act ual)
665 } 688 }
666 if v == nil || v == ds.Stop { 689 if v == nil || v == ds.Stop {
667 return "" 690 return ""
668 } 691 }
669 return fmt.Sprintf("expected success value, not %v", v) 692 return fmt.Sprintf("expected success value, not %v", v)
670 } 693 }
OLDNEW
« no previous file with comments | « impl/memory/datastore_index_test.go ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698