(t *testing.T)
| 563 | } |
| 564 | |
| 565 | func TestDeclPackage(t *testing.T) { |
| 566 | tests := []struct { |
| 567 | predicate string |
| 568 | want string |
| 569 | }{ |
| 570 | {predicate: "bar", want: ""}, |
| 571 | {predicate: "foo.bar", want: "foo"}, |
| 572 | {predicate: "foo.baz.bar", want: "foo.baz"}, |
| 573 | } |
| 574 | for _, test := range tests { |
| 575 | decl := makeSyntheticDecl(t, NewQuery(PredicateSym{test.predicate, 1})) |
| 576 | |
| 577 | if got := decl.PackageID(); got != test.want { |
| 578 | t.Fatalf("PackageID(%v)=%v want %v", decl, got, test.want) |
| 579 | } |
| 580 | |
| 581 | if !decl.IsSynthetic() { |
| 582 | t.Fatalf("(%v).IsSynthetic() = false want true", decl) |
| 583 | } |
| 584 | } |
| 585 | } |
| 586 | |
| 587 | func TestDeclPackageDecl(t *testing.T) { |
| 588 | tests := []string{ |
nothing calls this directly
no test coverage detected