| 1 | package ctyscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/ |
| 2 | |
| 3 | import ( |
| 4 | "testingscip-go gomod github.com/golang/go/src go1.18 testing/" |
| 5 | ) |
| 6 | |
| 7 | func TestUnknownAsNullscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/TestUnknownAsNull().(t *testingscip-go gomod github.com/golang/go/src go1.18 testing/.Tscip-go gomod github.com/golang/go/src go1.18 testing/T#) { |
| 8 | tests := []struct { |
| 9 | Input Valuescip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/Value# |
| 10 | Want Valuescip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/Value# |
| 11 | }{ |
| 12 | { |
| 13 | StringValscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/StringVal().("hello"), |
| 14 | StringValscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/StringVal().("hello"), |
| 15 | }, |
| 16 | { |
| 17 | NullValscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/NullVal().(Stringscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/String.), |
| 18 | NullValscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/NullVal().(Stringscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/String.), |
| 19 | }, |
| 20 | { |
| 21 | UnknownValscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/UnknownVal().(Stringscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/String.), |
| 22 | NullValscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/NullVal().(Stringscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/String.), |
| 23 | }, |
| 24 | |
| 25 | { |
| 26 | NullValscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/NullVal().(DynamicPseudoTypescip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/DynamicPseudoType.), |
| 27 | NullValscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/NullVal().(DynamicPseudoTypescip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/DynamicPseudoType.), |
| 28 | }, |
| 29 | { |
| 30 | NullValscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/NullVal().(Objectscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/Object().(map[string]Typescip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/Type#{"test": Stringscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/String.})), |
| 31 | NullValscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/NullVal().(Objectscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/Object().(map[string]Typescip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/Type#{"test": Stringscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/String.})), |
| 32 | }, |
| 33 | { |
| 34 | DynamicValscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/DynamicVal., |
| 35 | NullValscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/NullVal().(DynamicPseudoTypescip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/DynamicPseudoType.), |
| 36 | }, |
| 37 | |
| 38 | { |
| 39 | ListValEmptyscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/ListValEmpty().(Stringscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/String.), |
| 40 | ListValEmptyscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/ListValEmpty().(Stringscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/String.), |
| 41 | }, |
| 42 | { |
| 43 | ListValscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/ListVal().([]Valuescip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/Value#{ |
| 44 | StringValscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/StringVal().("hello"), |
| 45 | }), |
| 46 | ListValscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/ListVal().([]Valuescip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/Value#{ |
| 47 | StringValscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/StringVal().("hello"), |
| 48 | }), |
| 49 | }, |
| 50 | { |
| 51 | ListValscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/ListVal().([]Valuescip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/Value#{ |
| 52 | NullValscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/NullVal().(Stringscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/String.), |
| 53 | }), |
| 54 | ListValscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/ListVal().([]Valuescip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/Value#{ |
| 55 | NullValscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/NullVal().(Stringscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/String.), |
| 56 | }), |
| 57 | }, |
| 58 | { |
| 59 | ListValscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/ListVal().([]Valuescip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/Value#{ |
| 60 | UnknownValscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/UnknownVal().(Stringscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/String.), |
| 61 | }), |
| 62 | ListValscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/ListVal().([]Valuescip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/Value#{ |
| 63 | NullValscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/NullVal().(Stringscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/String.), |
| 64 | }), |
| 65 | }, |
| 66 | |
| 67 | { |
| 68 | SetValEmptyscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/SetValEmpty().(Stringscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/String.), |
| 69 | SetValEmptyscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/SetValEmpty().(Stringscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/String.), |
| 70 | }, |
| 71 | { |
| 72 | SetValscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/SetVal().([]Valuescip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/Value#{ |
| 73 | StringValscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/StringVal().("hello"), |
| 74 | }), |
| 75 | SetValscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/SetVal().([]Valuescip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/Value#{ |
| 76 | StringValscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/StringVal().("hello"), |
| 77 | }), |
| 78 | }, |
| 79 | { |
| 80 | SetValscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/SetVal().([]Valuescip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/Value#{ |
| 81 | NullValscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/NullVal().(Stringscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/String.), |
| 82 | }), |
| 83 | SetValscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/SetVal().([]Valuescip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/Value#{ |
| 84 | NullValscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/NullVal().(Stringscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/String.), |
| 85 | }), |
| 86 | }, |
| 87 | { |
| 88 | SetValscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/SetVal().([]Valuescip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/Value#{ |
| 89 | UnknownValscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/UnknownVal().(Stringscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/String.), |
| 90 | }), |
| 91 | SetValscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/SetVal().([]Valuescip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/Value#{ |
| 92 | NullValscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/NullVal().(Stringscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/String.), |
| 93 | }), |
| 94 | }, |
| 95 | |
| 96 | { |
| 97 | EmptyTupleValscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/EmptyTupleVal., |
| 98 | EmptyTupleValscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/EmptyTupleVal., |
| 99 | }, |
| 100 | { |
| 101 | TupleValscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/TupleVal().([]Valuescip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/Value#{ |
| 102 | StringValscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/StringVal().("hello"), |
| 103 | }), |
| 104 | TupleValscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/TupleVal().([]Valuescip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/Value#{ |
| 105 | StringValscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/StringVal().("hello"), |
| 106 | }), |
| 107 | }, |
| 108 | { |
| 109 | TupleValscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/TupleVal().([]Valuescip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/Value#{ |
| 110 | NullValscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/NullVal().(Stringscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/String.), |
| 111 | }), |
| 112 | TupleValscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/TupleVal().([]Valuescip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/Value#{ |
| 113 | NullValscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/NullVal().(Stringscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/String.), |
| 114 | }), |
| 115 | }, |
| 116 | { |
| 117 | TupleValscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/TupleVal().([]Valuescip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/Value#{ |
| 118 | UnknownValscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/UnknownVal().(Stringscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/String.), |
| 119 | }), |
| 120 | TupleValscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/TupleVal().([]Valuescip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/Value#{ |
| 121 | NullValscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/NullVal().(Stringscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/String.), |
| 122 | }), |
| 123 | }, |
| 124 | |
| 125 | { |
| 126 | MapValEmptyscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/MapValEmpty().(Stringscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/String.), |
| 127 | MapValEmptyscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/MapValEmpty().(Stringscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/String.), |
| 128 | }, |
| 129 | { |
| 130 | MapValscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/MapVal().(map[string]Valuescip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/Value#{ |
| 131 | "greeting": StringValscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/StringVal().("hello"), |
| 132 | }), |
| 133 | MapValscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/MapVal().(map[string]Valuescip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/Value#{ |
| 134 | "greeting": StringValscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/StringVal().("hello"), |
| 135 | }), |
| 136 | }, |
| 137 | { |
| 138 | MapValscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/MapVal().(map[string]Valuescip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/Value#{ |
| 139 | "greeting": NullValscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/NullVal().(Stringscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/String.), |
| 140 | }), |
| 141 | MapValscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/MapVal().(map[string]Valuescip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/Value#{ |
| 142 | "greeting": NullValscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/NullVal().(Stringscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/String.), |
| 143 | }), |
| 144 | }, |
| 145 | { |
| 146 | MapValscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/MapVal().(map[string]Valuescip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/Value#{ |
| 147 | "greeting": UnknownValscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/UnknownVal().(Stringscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/String.), |
| 148 | }), |
| 149 | MapValscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/MapVal().(map[string]Valuescip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/Value#{ |
| 150 | "greeting": NullValscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/NullVal().(Stringscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/String.), |
| 151 | }), |
| 152 | }, |
| 153 | |
| 154 | { |
| 155 | EmptyObjectValscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/EmptyObjectVal., |
| 156 | EmptyObjectValscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/EmptyObjectVal., |
| 157 | }, |
| 158 | { |
| 159 | ObjectValscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/ObjectVal().(map[string]Valuescip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/Value#{ |
| 160 | "greeting": StringValscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/StringVal().("hello"), |
| 161 | }), |
| 162 | ObjectValscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/ObjectVal().(map[string]Valuescip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/Value#{ |
| 163 | "greeting": StringValscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/StringVal().("hello"), |
| 164 | }), |
| 165 | }, |
| 166 | { |
| 167 | ObjectValscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/ObjectVal().(map[string]Valuescip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/Value#{ |
| 168 | "greeting": NullValscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/NullVal().(Stringscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/String.), |
| 169 | }), |
| 170 | ObjectValscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/ObjectVal().(map[string]Valuescip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/Value#{ |
| 171 | "greeting": NullValscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/NullVal().(Stringscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/String.), |
| 172 | }), |
| 173 | }, |
| 174 | { |
| 175 | ObjectValscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/ObjectVal().(map[string]Valuescip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/Value#{ |
| 176 | "greeting": UnknownValscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/UnknownVal().(Stringscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/String.), |
| 177 | }), |
| 178 | ObjectValscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/ObjectVal().(map[string]Valuescip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/Value#{ |
| 179 | "greeting": NullValscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/NullVal().(Stringscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/String.), |
| 180 | }), |
| 181 | }, |
| 182 | } |
| 183 | |
| 184 | for _, test := range tests { |
| 185 | t.Runscip-go gomod github.com/golang/go/src go1.18 testing/T#Run().(test.Input.GoStringscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/Value#GoString().(), func(t *testingscip-go gomod github.com/golang/go/src go1.18 testing/.Tscip-go gomod github.com/golang/go/src go1.18 testing/T#) { |
| 186 | got := UnknownAsNullscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/UnknownAsNull().(test.Input) |
| 187 | if !got.RawEqualsscip-go gomod github.com/zclconf/go-cty . `github.com/zclconf/go-cty/cty`/Value#RawEquals().(test.Want) { |
| 188 | t.Errorfscip-go gomod github.com/golang/go/src go1.18 testing/common#Errorf().( |
| 189 | "wrong result\ninput: %#v\ngot: %#v\nwant: %#v", |
| 190 | test.Input, got, test.Want, |
| 191 | ) |
| 192 | } |
| 193 | }) |
| 194 | } |
| 195 | } |