(t *testing.T)
| 47 | } |
| 48 | |
| 49 | func TestVector(t *testing.T) { |
| 50 | tree := &mathTree{ |
| 51 | Fn: "sqrt", |
| 52 | Child: []*mathTree{{ |
| 53 | Fn: "dot", |
| 54 | Child: []*mathTree{ |
| 55 | { |
| 56 | Fn: "-", |
| 57 | Child: []*mathTree{ |
| 58 | { |
| 59 | Var: "v1", |
| 60 | Val: createShardedMap(0, types.Val{Tid: types.VFloatID, Value: []float32{1.0, 2.0}}), |
| 61 | }, |
| 62 | { |
| 63 | Var: "v2", |
| 64 | Val: createShardedMap(123, types.Val{Tid: types.VFloatID, Value: []float32{1.0, 2.0}}), |
| 65 | }, |
| 66 | }, |
| 67 | }, |
| 68 | { |
| 69 | Fn: "-", |
| 70 | Child: []*mathTree{ |
| 71 | { |
| 72 | Var: "v1", |
| 73 | Val: createShardedMap(0, types.Val{Tid: types.VFloatID, Value: []float32{1.0, 2.0}}), |
| 74 | }, |
| 75 | { |
| 76 | Var: "v2", |
| 77 | Val: createShardedMap(123, types.Val{Tid: types.VFloatID, Value: []float32{1.0, 2.0}}), |
| 78 | }, |
| 79 | }, |
| 80 | }, |
| 81 | }, |
| 82 | }}, |
| 83 | } |
| 84 | |
| 85 | require.NoError(t, evalMathTree(tree)) |
| 86 | } |
| 87 | |
| 88 | func TestProcessBinary(t *testing.T) { |
| 89 | tests := []struct { |
nothing calls this directly
no test coverage detected