(t *testing.T)
| 8 | ) |
| 9 | |
| 10 | func TestStringifyAnyValue(t *testing.T) { |
| 11 | testCases := []struct { |
| 12 | name string |
| 13 | v *v1common.AnyValue |
| 14 | expected string |
| 15 | }{ |
| 16 | { |
| 17 | name: "string value", |
| 18 | v: &v1common.AnyValue{ |
| 19 | Value: &v1common.AnyValue_StringValue{ |
| 20 | StringValue: "test", |
| 21 | }, |
| 22 | }, |
| 23 | expected: "test", |
| 24 | }, |
| 25 | { |
| 26 | name: "int value", |
| 27 | v: &v1common.AnyValue{ |
| 28 | Value: &v1common.AnyValue_IntValue{ |
| 29 | IntValue: 1, |
| 30 | }, |
| 31 | }, |
| 32 | expected: "1", |
| 33 | }, |
| 34 | { |
| 35 | name: "bool value", |
| 36 | v: &v1common.AnyValue{ |
| 37 | Value: &v1common.AnyValue_BoolValue{ |
| 38 | BoolValue: true, |
| 39 | }, |
| 40 | }, |
| 41 | expected: "true", |
| 42 | }, |
| 43 | { |
| 44 | name: "float value", |
| 45 | v: &v1common.AnyValue{ |
| 46 | Value: &v1common.AnyValue_DoubleValue{ |
| 47 | DoubleValue: 1.1, |
| 48 | }, |
| 49 | }, |
| 50 | expected: "1.1", |
| 51 | }, |
| 52 | { |
| 53 | name: "array value", |
| 54 | v: &v1common.AnyValue{ |
| 55 | Value: &v1common.AnyValue_ArrayValue{ |
| 56 | ArrayValue: &v1common.ArrayValue{ |
| 57 | Values: []*v1common.AnyValue{ |
| 58 | { |
| 59 | Value: &v1common.AnyValue_StringValue{ |
| 60 | StringValue: "test", |
| 61 | }, |
| 62 | }, |
| 63 | }, |
| 64 | }, |
| 65 | }, |
| 66 | }, |
| 67 | expected: "[test]", |
nothing calls this directly
no test coverage detected