(t *testing.T)
| 155 | } |
| 156 | |
| 157 | func TestParserRootValue(t *testing.T) { |
| 158 | parserExamples{ |
| 159 | {Description: "string", Data: "abc", |
| 160 | Expected: yamlmeta.NewDocumentSet(&yamlmeta.DocumentSetProto{ |
| 161 | Items: []*yamlmeta.DocumentProto{ |
| 162 | &yamlmeta.DocumentProto{ |
| 163 | Value: "abc", |
| 164 | Position: filepos.NewPosition(1), |
| 165 | }, |
| 166 | }, |
| 167 | Position: filepos.NewUnknownPosition(), |
| 168 | }), |
| 169 | }, |
| 170 | {Description: "integer", Data: "1", |
| 171 | Expected: yamlmeta.NewDocumentSet(&yamlmeta.DocumentSetProto{ |
| 172 | Items: []*yamlmeta.DocumentProto{ |
| 173 | &yamlmeta.DocumentProto{ |
| 174 | Value: 1, |
| 175 | Position: filepos.NewPosition(1), |
| 176 | }, |
| 177 | }, |
| 178 | Position: filepos.NewUnknownPosition(), |
| 179 | }), |
| 180 | }, |
| 181 | {Description: "float", Data: "2000.1", |
| 182 | Expected: yamlmeta.NewDocumentSet(&yamlmeta.DocumentSetProto{ |
| 183 | Items: []*yamlmeta.DocumentProto{ |
| 184 | &yamlmeta.DocumentProto{ |
| 185 | Value: 2000.1, |
| 186 | Position: filepos.NewPosition(1), |
| 187 | }, |
| 188 | }, |
| 189 | Position: filepos.NewUnknownPosition(), |
| 190 | }), |
| 191 | }, |
| 192 | {Description: "float (exponent)", Data: "9e3", |
| 193 | Expected: yamlmeta.NewDocumentSet(&yamlmeta.DocumentSetProto{ |
| 194 | Items: []*yamlmeta.DocumentProto{ |
| 195 | &yamlmeta.DocumentProto{ |
| 196 | Value: 9000.0, |
| 197 | Position: filepos.NewPosition(1), |
| 198 | }, |
| 199 | }, |
| 200 | Position: filepos.NewUnknownPosition(), |
| 201 | }), |
| 202 | }, |
| 203 | {Description: "array", Data: "- 1", |
| 204 | Expected: yamlmeta.NewDocumentSet(&yamlmeta.DocumentSetProto{ |
| 205 | Items: []*yamlmeta.DocumentProto{ |
| 206 | &yamlmeta.DocumentProto{ |
| 207 | Value: &yamlmeta.ArrayProto{ |
| 208 | Items: []*yamlmeta.ArrayItemProto{ |
| 209 | &yamlmeta.ArrayItemProto{Value: 1, Position: filepos.NewPosition(1)}, |
| 210 | }, |
| 211 | Position: filepos.NewPosition(1), |
| 212 | }, |
| 213 | Position: filepos.NewPosition(1), |
| 214 | }, |
nothing calls this directly
no test coverage detected
searching dependent graphs…