(t *testing.T)
| 94 | } |
| 95 | |
| 96 | func TestArray_Constructors(t *testing.T) { |
| 97 | testValue := []interface{}{"Foo", 123} |
| 98 | |
| 99 | t.Run("reporter", func(t *testing.T) { |
| 100 | reporter := newMockReporter(t) |
| 101 | |
| 102 | value := NewArray(reporter, testValue) |
| 103 | |
| 104 | value.IsEqual(testValue) |
| 105 | value.chain.assert(t, success) |
| 106 | }) |
| 107 | |
| 108 | t.Run("config", func(t *testing.T) { |
| 109 | reporter := newMockReporter(t) |
| 110 | |
| 111 | value := NewArrayC(Config{ |
| 112 | Reporter: reporter, |
| 113 | }, testValue) |
| 114 | |
| 115 | value.IsEqual(testValue) |
| 116 | value.chain.assert(t, success) |
| 117 | }) |
| 118 | |
| 119 | t.Run("chain", func(t *testing.T) { |
| 120 | chain := newMockChain(t) |
| 121 | |
| 122 | value := newArray(chain, testValue) |
| 123 | |
| 124 | assert.NotSame(t, value.chain, chain) |
| 125 | assert.Equal(t, value.chain.context.Path, chain.context.Path) |
| 126 | }) |
| 127 | |
| 128 | t.Run("invalid value", func(t *testing.T) { |
| 129 | reporter := newMockReporter(t) |
| 130 | |
| 131 | value := NewArray(reporter, nil) |
| 132 | |
| 133 | value.chain.assert(t, failure) |
| 134 | }) |
| 135 | } |
| 136 | |
| 137 | func TestArray_Raw(t *testing.T) { |
| 138 | reporter := newMockReporter(t) |
nothing calls this directly
no test coverage detected
searching dependent graphs…