(t *testing.T)
| 3120 | } |
| 3121 | |
| 3122 | func TestMaxPredicateSize(t *testing.T) { |
| 3123 | // Create a string that has more than 2^16 chars. |
| 3124 | var b strings.Builder |
| 3125 | for i := 0; i < 10000; i++ { |
| 3126 | b.WriteString("abcdefg") |
| 3127 | } |
| 3128 | largePred := b.String() |
| 3129 | |
| 3130 | query := fmt.Sprintf(` |
| 3131 | { |
| 3132 | me(func: uid(0x2)) { |
| 3133 | %s { |
| 3134 | name |
| 3135 | } |
| 3136 | } |
| 3137 | } |
| 3138 | `, largePred) |
| 3139 | |
| 3140 | _, err := processQuery(context.Background(), t, query) |
| 3141 | require.Error(t, err) |
| 3142 | require.Contains(t, err.Error(), "Predicate name length cannot be bigger than 2^16") |
| 3143 | } |
| 3144 | |
| 3145 | func TestQueryUnknownType(t *testing.T) { |
| 3146 | query := `schema(type: UnknownType) {}` |
nothing calls this directly
no test coverage detected