(t *testing.T)
| 749 | } |
| 750 | |
| 751 | func TestVectorWithoutQuote(t *testing.T) { |
| 752 | pred := "test-ve" |
| 753 | dropPredicate(pred) |
| 754 | setSchema(fmt.Sprintf(vectorSchemaWithIndex, pred, "4", "euclidean")) |
| 755 | |
| 756 | setJson := ` |
| 757 | { |
| 758 | "set": [ |
| 759 | { |
| 760 | "test-ve": [1,0], |
| 761 | "v-name":"ve1" |
| 762 | }, |
| 763 | { |
| 764 | "test-ve": [0.866025,0.5], |
| 765 | "v-name":"ve2" |
| 766 | }, |
| 767 | { |
| 768 | "test-ve": [0.5,0.866025], |
| 769 | "v-name":"ve3" |
| 770 | }, |
| 771 | { |
| 772 | "test-ve": [0,1], |
| 773 | "v-name":"ve4" |
| 774 | }, |
| 775 | { |
| 776 | "test-ve": [-0.5,0.866025], |
| 777 | "v-name":"ve5" |
| 778 | }, |
| 779 | { |
| 780 | "test-ve": [-0.866025,0.5], |
| 781 | "v-name":"ve6" |
| 782 | } |
| 783 | ] |
| 784 | } |
| 785 | ` |
| 786 | txn1 := client.NewTxn() |
| 787 | _, err := txn1.Mutate(context.Background(), &api.Mutation{ |
| 788 | SetJson: []byte(setJson), |
| 789 | }) |
| 790 | require.Error(t, err) |
| 791 | require.Contains(t, err.Error(), "Input for predicate \"test-ve\" of type vector is not vector") |
| 792 | } |
| 793 | |
| 794 | func TestVectorTwoTxnWithoutCommit(t *testing.T) { |
| 795 | pred := "vtest" |
nothing calls this directly
no test coverage detected